[PATCH v2 2/2] drm/amd/display: Move PRIMARY plane zpos higher

2024-04-29 Thread sunpeng.li
From: Leo Li [Why] Compositors have different ways of assigning surfaces to DRM planes for render offloading. It may decide between various strategies: overlay, underlay, or a mix of both (see here for more info: https://gitlab.freedesktop.org/emersion/libliftoff/-/issues/76) One way for compos

[PATCH v2 1/2] drm/amd/display: Introduce overlay cursor mode

2024-04-29 Thread sunpeng.li
From: Leo Li [Why] DCN is the display hardware for amdgpu. DRM planes are backed by DCN hardware pipes, which carry pixel data from one end (memory), to the other (output encoder). Each DCN pipe has the ability to blend in a cursor early on in the pipeline. In other words, there are no dedicate

[PATCH 2/2] drm/amd/display: Move PRIMARY plane zpos higher

2024-03-15 Thread sunpeng.li
From: Leo Li [Why] Compositors have different ways of assigning surfaces to DRM planes for render offloading. It may decide between various strategies: overlay, underlay, or a mix of both One way for compositors to implement the underlay strategy is to assign a higher zpos to the DRM_PRIMARY pl

[PATCH 1/2] drm/amd/display: Introduce overlay cursor mode

2024-03-15 Thread sunpeng.li
From: Leo Li [Why] DCN is the display hardware for amdgpu. DRM planes are backed by DCN hardware pipes, which carry pixel data from one end (memory), to the other (output encoder). Each DCN pipe has the ability to blend in a cursor early on in the pipeline. In other words, there are no dedicate

[PATCH 0/2] drm/amdgpu/display: Make multi-plane configurations more flexible

2024-03-15 Thread sunpeng.li
From: Leo Li These patches aim to make the amdgpgu KMS driver play nicer with compositors when building multi-plane scanout configurations. They do so by: 1. Making cursor behavior more sensible. 2. Allowing placement of DRM OVERLAY planes underneath the PRIMARY plane for 'underlay' configura

[PATCH] drm: Add PSR version 4 macro

2022-01-17 Thread sunpeng.li
From: Leo Li eDP 1.5 specification defines PSR version 4. It defines PSR1 and PSR2 support with selective-update (SU) capabilities, with additional support for Y-coordinate and Early Transport of the selective-update region. This differs from PSR version 3 in that early transport is supported f

[PATCH v2] drm/amdgpu: Add DC feature mask to disable fractional pwm

2019-10-21 Thread sunpeng.li
From: Leo Li [Why] Some LED panel drivers might not like fractional PWM. In such cases, backlight flickering may be observed. [How] Add a DC feature mask to disable fractional PWM, and associate it with the preexisting dc_config flag. The flag is only plumbed through the dmcu firmware, so plu

[PATCH] drm/amdgpu: Add DC feature mask to disable fractional pwm

2019-10-21 Thread sunpeng.li
From: Leo Li [Why] Some LED panel drivers might not like fractional PWM. In such cases, backlight flickering may be observed. [How] Add a DC feature mask to disable fractional PWM, and associate it with the preexisting dc_config flag. The flag is only plumbed through the dmcu firmware, so plu

[PATCH 6/9 v2] drm/i915: Implement MST Aux device registration

2019-07-23 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Signed-off-by: Leo Li v2 changes: Unwind intel_connector_register on mst late register failure. --- drivers/gpu/drm/i915/displa

[PATCH 8/9] drm/radeon: Implement MST Aux device registration

2019-07-23 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Alex Deucher Cc: Harry Wentland Signed-off-by: Leo Li --- drivers/gpu/drm/radeon/radeon_dp_mst.c | 22

[PATCH 4/9] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent

2019-07-23 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. To do so, the connector needs to be registered beforehand. Therefore, shift aux registration to be after connector

[PATCH 9/9] drm/amd/display: Implement MST Aux device registration

2019-07-23 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Jerry Zuo Cc: Nicholas Kazlauskas Cc: Harry Wentland Signed-off-by: Leo Li --- .../display/amdgpu_dm/amdgpu_dm_mst_types.

[PATCH 5/9] drm/amd/display: Use connector kdev as aux device parent

2019-07-23 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. For example, the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*", SY

[PATCH 2/9 v3] drm/dp_mst: Enable registration of AUX devices for MST ports

2019-07-23 Thread sunpeng.li
From: Ville Syrjälä All available downstream ports - physical and logical - are exposed for each MST device. They are listed in /dev/, following the same naming scheme as SST devices by appending an incremental ID. Although all downstream ports are exposed, only some will work as expected. Consi

[PATCH 3/9] drm/nouveau: Use connector kdev as aux device parent

2019-07-23 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. Cc: Ben Skeggs Signed-off-by: Leo Li Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/nouveau_connector.c |

[PATCH 7/9] drm/nouveau/kms/nv50: Implement MST Aux device registration

2019-07-23 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Ben Skeggs Signed-off-by: Leo Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 1 file changed, 20

[PATCH 0/9] MST AUX Devices (v3)

2019-07-23 Thread sunpeng.li
From: Leo Li Here's what changed in v3: * Dropped patch to expose the mst-path device attribute, in lieu of ongoing discussion for defining a better connector path property * Change WARN_ON_ONCE -> DRM_ERROR on MST dpcd read errors to avoid tainting the kernel * Unwind intel_connector_regist

[PATCH 1/9] drm/dp: Use non-cyclic idr

2019-07-23 Thread sunpeng.li
From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Lyude Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_aux_dev.c | 3

[PATCH v2] drm/sysfs: Add mstpath attribute to connector devices

2019-07-05 Thread sunpeng.li
From: Leo Li This can be used to create more descriptive symlinks for MST aux devices. Consider the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{mstpath}=="?*", SYMLINK+="drm_dp_aux/by-path/$attr{mstpath}" The following symlinks will be created (depending o

[PATCH 08/10] drm/nouveau/kms/nv50: Implement MST Aux device registration

2019-07-04 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Ben Skeggs Signed-off-by: Leo Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 20 1 file changed, 20

[PATCH 03/10] drm/sysfs: Add mstpath attribute to connector devices

2019-07-04 Thread sunpeng.li
From: Leo Li This can be used to create more descriptive symlinks for MST aux devices. Consider the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{mstpath}=="?*", SYMLINK+="drm_dp_aux/by-path/$attr{mstpath}" The following symlinks will be created (depending o

[PATCH 04/10] drm/nouveau: Use connector kdev as aux device parent

2019-07-04 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. Cc: Ben Skeggs Signed-off-by: Leo Li --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 1 file changed, 1 i

[PATCH 06/10] drm/amd/display: Use connector kdev as aux device parent

2019-07-04 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. For example, the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*", SY

[PATCH 01/10] drm/dp: Use non-cyclic idr

2019-07-04 Thread sunpeng.li
From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Lyude Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_aux_dev.c | 3

[PATCH 05/10] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent

2019-07-04 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. To do so, the connector needs to be registered beforehand. Therefore, shift aux registration to be after connector

[PATCH 00/10] Enable MST Aux devices (v2)

2019-07-04 Thread sunpeng.li
From: Leo Li Hi all, Here's the second revision of patches to enable mst aux devices. v2 fixes an aux device unregistration issue during driver unload. See patch 2/10 for details. Consequently, drivers supporting mst are modified to use the new mst connector late register and early unregister h

[PATCH 02/10] drm/dp_mst: Enable registration of AUX devices for MST ports (v2)

2019-07-04 Thread sunpeng.li
From: Ville Syrjälä All available downstream ports - physical and logical - are exposed for each MST device. They are listed in /dev/, following the same naming scheme as SST devices by appending an incremental ID. Although all downstream ports are exposed, only some will work as expected. Consi

[PATCH 10/10] drm/amd/display: Implement MST Aux device registration

2019-07-04 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Jerry Zuo Cc: Nicholas Kazlauskas Signed-off-by: Leo Li --- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 24 +++

[PATCH 09/10] drm/radeon: Implement MST Aux device registration

2019-07-04 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Cc: Alex Deucher Signed-off-by: Leo Li --- drivers/gpu/drm/radeon/radeon_dp_mst.c | 22 ++ 1 file changed,

[PATCH 07/10] drm/i915: Implement MST Aux device registration

2019-07-04 Thread sunpeng.li
From: Leo Li Implement late_register and early_unregister hooks for MST connectors. Call drm helpers for MST connector registration, which registers the AUX devices. Signed-off-by: Leo Li --- drivers/gpu/drm/i915/display/intel_dp_mst.c | 29 +++-- 1 file changed, 27 insertions(

[PATCH 2/7] drm/dp_mst: Register AUX devices for MST ports

2019-05-16 Thread sunpeng.li
From: Ville Syrjälä All available downstream ports - physical and logical - are exposed for each MST device. They are listed in /dev/, following the same naming scheme as SST devices by appending an incremental ID. Although all downstream ports are exposed, only some will work as expected. Consi

[PATCH 1/7] drm/dp: Use non-cyclic idr

2019-05-16 Thread sunpeng.li
From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li Reviewed-by: Lyude Paul Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_dp_aux_dev.c | 3

[PATCH 6/7] drm/bridge/analogix-anx78xx: Use connector kdev as aux device parent

2019-05-16 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. To do so, the connector needs to be registered beforehand. Therefore, shift aux registration to be after connector

[PATCH 3/7] drm/dp-mst: Use connector kdev as aux device parent

2019-05-16 Thread sunpeng.li
From: Leo Li Placing the MST aux device as a child of the connector gives udev the ability to access the connector device's attributes. This will come in handy when writing udev rules to create more descriptive symlinks to the MST aux devices. Cc: Ville Syrjälä Cc: Lyude Paul Signed-off-by: Le

[PATCH 4/7] drm/sysfs: Add mstpath attribute to connector devices

2019-05-16 Thread sunpeng.li
From: Leo Li This can be used to create more descriptive symlinks for MST aux devices. Consider the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{mstpath}=="?*", SYMLINK+="drm_dp_aux/by-path/$attr{mstpath}" The following symlinks will be created (depending o

[PATCH 5/7] drm/amd/display: Use connector kdev as aux device parent

2019-05-16 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. For example, the following udev rule: SUBSYSTEM=="drm_dp_aux_dev", SUBSYSTEMS=="drm", ATTRS{edid}=="*", SY

[PATCH 7/7] drm/nouveau: Use connector kdev as aux device parent

2019-05-16 Thread sunpeng.li
From: Leo Li Set the connector's kernel device as the parent for the aux kernel device. This allows udev rules to access connector attributes when creating symlinks to aux devices. Cc: Ben Skeggs Cc: Lyude Paul Signed-off-by: Leo Li --- drivers/gpu/drm/nouveau/nouveau_connector.c | 2 +- 1 f

[PATCH 0/7] Add DP MST AUX devices

2019-05-16 Thread sunpeng.li
From: Leo Li This series adds support for MST AUX devices. A more descriptive 'mstpath' attribute is also added to MST connector devices. In addition, the DP aux device is made to be a child of the corresponding connector's device where possible (*). This allows udev rules to provide descriptiv

[PATCH 3/3] drm/dp_mst: Register AUX devices for MST ports

2019-04-22 Thread sunpeng.li
From: Ville Syrjälä All available downstream ports - physical and logical - are exposed for each MST device. They are listed in /dev/, following the same naming scheme as SST devices by appending an incremental ID. Additionally, a 'path' attribute is attached to the device. This is to allow udev

[PATCH 1/3] drm/dp: Use non-cyclic idr

2019-04-22 Thread sunpeng.li
From: Leo Li In preparation for adding aux devices for DP MST, make the IDR non-cyclic. That way, hotplug cycling MST devices won't needlessly increment the minor version index. Signed-off-by: Leo Li --- drivers/gpu/drm/drm_dp_aux_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH 2/3] drm/dp_mst: Expose build_mst_prop_path()

2019-04-22 Thread sunpeng.li
From: Leo Li To give identifiable attributes to MST DP aux devices, we can use the MST relative address. Expose this function for later use. Signed-off-by: Leo Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++-- include/drm/drm_dp_mst_helper.h | 4 2 files changed, 6 insertions(+

[PATCH 1/2] drm/dp_aux: Use non-cyclic idr, add suffix option for aux device

2019-04-12 Thread sunpeng.li
From: Leo Li In preparation for adding aux devices for DP MST: 1. A non-cyclic idr is used for the device minor version. That way, hotplug cycling MST devices won't needlessly increment the minor version index. 2. A suffix option is added to the aux device file name. It can be used to i

[PATCH 2/2] drm/dp_mst: Register aux-dev nodes for MST ports

2019-04-12 Thread sunpeng.li
From: Ville Syrjälä Expose AUX devices for MST ports, similar to how they are exposed for SST. The registered device will have it's MST port path appended in order to identify it. i.e. /dev/drm_dp_aux4_mst:0-2-1 So for a MST topology like so: +-+ | ASIC

[RFC 0/2] Add AUX device entries for DP MST devices

2019-04-12 Thread sunpeng.li
From: Leo Li Hi all, This is a follup to this change made by Ville to add MST aux nodes: https://github.com/vsyrjala/linux/commit/cac63f799ee2f5fbbe4f0a375383f13e03d640a5 Patch 2/2 describes what I added on top. Sending as an RFC since there are some items I'm not certain on: 1) Only expose au

[PATCH] drm/amd/display: Fix 64-bit division for 32-bit builds

2018-12-19 Thread sunpeng.li
From: Ken Chalmers [Why] 32-bit builds break when doing 64-bit division directly. [How] Use the div_u64() function instead to perform the division. Fixes: https://lists.freedesktop.org/archives/dri-devel/2018-December/201008.html Signed-off-by: Ken Chalmers Reviewed-by: Leo Li --- drivers/g

[PATCH v2] drm: Get ref on CRTC commit object when waiting for flip_done

2018-10-15 Thread sunpeng.li
From: Leo Li This fixes a general protection fault, caused by accessing the contents of a flip_done completion object that has already been freed. It occurs due to the preemption of a non-blocking commit worker thread W by another commit thread X. X continues to clear its atomic state at the end,

[PATCH] drm: Get ref on CRTC commit object when waiting for flip_done

2018-10-11 Thread sunpeng.li
From: Leo Li This fixes a general protection fault, caused by accessing the contents of a flip_done completion object that has already been freed. It occurs due to the preemption of a non-blocking commit worker thread W by another commit thread X. X continues to clear its atomic state at the end,

[PATCH] drm/amd/display: Remove erroneous if statement in gamma set

2018-04-26 Thread sunpeng.li
From: "Leo (Sunpeng) Li" The lines were removed as part of the original change. They may have been missed during merge. This is a fixup to: committ 265083076187e619aa9176aeb05ad630013429b4 Author: Leo (Sunpeng) Li Date: Fri Feb 2 10:18:56 2018 -0500 drm/amd/display: Hook

[PATCH] drm/atomic: Fix memleak on ERESTARTSYS during non-blocking commits

2018-01-04 Thread sunpeng.li
From: "Leo (Sunpeng) Li" During a non-blocking commit, it is possible to return before the commit_tail work is queued (-ERESTARTSYS, for example). Since a reference on the crtc commit object is obtained for the pending vblank event when preparing the commit, the above situation will leave us wit

[PATCH v3 1/6] drm/amd/display: Use DRM new-style object iterators.

2017-10-13 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Use the correct for_each_new/old_* iterators instead of for_each_* The following functions were considered: amdgpu_dm_find_first_crtc_matching_connector: use for_each_new - Old from_state_var flag was always choosing the new state amdgpu_dm_display_resume: use for_

[PATCH 3/6] drm/amd/display: Unify DRM state variable namings.

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Use new_*_state and old_*_state for their respective new/old DRM object states. Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 80 +++ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/g

[PATCH 6/6] drm/amd/display: Remove useless pcrtc pointer

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" in amdgpu_dm_atomic_commit_tail. Just use crtc instead. Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/

[PATCH 0/6] Use new DRM API where possible, and cleanups.

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Hi Dave, This series reworks the previous patch. Patch 1 is a v2 of the previous, and additional patches are from the feedback received. They apply on top of your drm-next-amd-dc-staging branch. Thanks, Leo Leo (Sunpeng) Li (6): drm/amd/display: Use DRM new-style obj

[PATCH 4/6] drm/amd/display: Unify amdgpu_dm state variable namings.

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Use dm_new_*_state and dm_old_*_state for their respective amdgpu_dm new and old object states. Helps with readability, and enforces use of new DRM api (choose either new, or old). Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |

[PATCH 5/6] drm/amd/display: Fix typo

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" undersacn -> underscan Signed-off-by: Leo (Sunpeng) Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_

[PATCH 2/6] drm/amd/display: Use new DRM API where possible

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" To conform to DRM's new API, we should not be accessing a DRM object's internal state directly. Rather, the DRM for_each_old/new_* iterators, and drm_atomic_get_old/new_* interface should be used. This is an ongoing process. For now, update the DRM-facing atomic function

[PATCH v2 1/6] drm/amd/display: Use DRM new-style object iterators.

2017-10-12 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Use the correct for_each_new/old_* iterators instead of for_each_* List of affected functions: amdgpu_dm_find_first_crtc_matching_connector: use for_each_new - Old from_state_var flag was always choosing the new state amdgpu_dm_display_resume: use for_each_new

[PATCH] amdgpu/dc: Use DRM new-style object iterators.

2017-10-11 Thread sunpeng.li
From: "Leo (Sunpeng) Li" Use the correct for_each_new/old_* iterators instead of for_each_* List of affected functions: amdgpu_dm_find_first_crtc_matching_connector: use for_each_new - Old from_state_var flag was always choosing the new state amdgpu_dm_display_resume: use for_each_new