Re: [PATCH] drm/amdgpu/acpi: NULL check before some freeing functions is not needed

2018-12-05 Thread Lyude Paul
Reviewed-by: Lyude Paul Thanks! On Wed, 2018-12-05 at 15:43 +0800, Wen Yang wrote: > kfree(NULL) is safe, so removes NULL check before freeing the mem. > This patch also fix the ifnullfree.cocci warnings. > > Signed-off-by: Wen Yang > CC: Alex Deucher > CC: christian.k

Re: [PATCH 2/2] drm/atomic: Create and use __drm_atomic_helper_crtc_reset() everywhere

2018-11-21 Thread Lyude Paul
For the nouveau and drm core changes Reviewed-by: Lyude Paul On Mon, 2018-11-12 at 16:01 +0100, Maarten Lankhorst wrote: > We already have __drm_atomic_helper_connector_reset() and > __drm_atomic_helper_plane_reset(), extend this to crtc as well. > > Most drivers already have a gp

[PATCH 0/2] drm/amd/dm: Misc MST connector fixes

2018-11-16 Thread Lyude Paul
Some fixes for things I spotted after trying to look at a bug Jerry Zuo mentioned to me. Didn't manage to reproduce the bug! But I found these. Cc: Jerry Zuo Lyude Paul (2): drm/amd/dm: Don't forget to attach MST encoders drm/amd/dm: Understand why attaching path/tile properties are needed

[PATCH 2/2] drm/amd/dm: Understand why attaching path/tile properties are needed

2018-11-16 Thread Lyude Paul
Path property is used for userspace to know what MST connector goes to what actual DRM DisplayPort connector, the tiling property is for tiling configurations. Not sure what else there is to figure out. Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Re: [PATCH 1/2] drm/amd/dm: Don't forget to attach MST encoders

2018-11-19 Thread Lyude Paul
ched encoder in the process of adding MST connector. The > iteration search takes time to push drm_dp_send_enum_path_resources() aux > transaction after the mode probe, and causes conflict to > drm_dp_mst_i2c_xfer(), leading to the aux transaction timeout. > > -----Original Message- >

Re: [PATCH v2 0/3] drm/amdgpu: Fix suspend/resume issues with MST

2019-01-08 Thread Lyude Paul
On Tue, 2019-01-08 at 16:17 -0500, Alex Deucher wrote: > On Tue, Jan 8, 2019 at 4:11 PM Lyude Paul wrote: > > Fix the suspend/issues that Jerry Zuo found in amdgpu, and add some > > compiler warnings for drivers ignoring the return code of > > drm_dp_mst_topology_mgr_resum

[PATCH v2 3/3] drm/dp_mst: Add __must_check to drm_dp_mst_topology_mgr_resume()

2019-01-08 Thread Lyude Paul
Since I've had to fix two cases of drivers not checking the return code from this function, let's make the compiler complain so this doesn't come up again in the future. Changes since v1: * Remove unneeded __must_check in function declaration - danvet Signed-off-by: Lyude Paul Cc: Jerry Zuo

[PATCH v2 1/3] drm/amdgpu: Don't ignore rc from drm_dp_mst_topology_mgr_resume()

2019-01-08 Thread Lyude Paul
this by actually checking the rc from drm_dp_mst_topology_mgr_resume(). Also, reformat the rest of the function while we're at it to fix the over-indenting. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Jerry Zuo Cc: # v4.15+ --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32

[PATCH v2 2/3] drm/amdgpu: Don't fail resume process if resuming atomic state fails

2019-01-08 Thread Lyude Paul
because of a potentially unavoidable atomic commit failure. Eventually, we'll have a real fix for this problem on the DRM level. But we've got some more important low-hanging fruit to deal with first. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Jerry Zuo Cc: # v4.15+ --- drivers/gpu

Re: [PATCH v4 00/16] MST refcounting/atomic helpers cleanup

2019-01-08 Thread Lyude Paul
On Tue, 2019-01-08 at 19:57 +, Wentland, Harry wrote: > On 2019-01-04 7:14 p.m., Lyude Paul wrote: > > This is the series I've been working on for a while now to get all of > > the atomic DRM drivers in the tree to use the atomic MST helpers, and to > > make the atomic

[PATCH v2 0/3] drm/amdgpu: Fix suspend/resume issues with MST

2019-01-08 Thread Lyude Paul
Fix the suspend/issues that Jerry Zuo found in amdgpu, and add some compiler warnings for drivers ignoring the return code of drm_dp_mst_topology_mgr_resume() to help ensure we don't need to fix this again in the future for someone else's driver. Cc: Jerry Zuo Lyude Paul (3): drm/amdgpu

[PATCH v5 07/20] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-08 Thread Lyude Paul
allocations in the rest of the DP MST helpers. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 54 ++- 1 file changed, 44 insertions(+), 10 deletions(-) diff

[PATCH v5 04/20] drm/dp_mst: Fix some formatting in drm_dp_mst_deallocate_vcpi()

2019-01-08 Thread Lyude Paul
Split some stuff across multiple lines Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm

[PATCH v5 02/20] drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg()

2019-01-08 Thread Lyude Paul
Split some stuff across multiple lines, remove some unnecessary braces Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 14 -- 1 file changed, 8 insertions(+), 6

[PATCH v5 00/20] MST refcounting/atomic helpers cleanup

2019-01-08 Thread Lyude Paul
off for now :). Also available on gitlab: https://gitlab.freedesktop.org/lyudess/linux/commits/wip/mst-dual-kref-start-v5 Cc: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li Lyude Paul (20): drm/dp_mst: Fix some formatting in drm_dp_add_port() drm/dp_mst

[PATCH v5 06/20] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-08 Thread Lyude Paul
|mstb)() -> drm_dp_mst_topology_get_(port|mstb)() - danvet * s/should/must in docs - danvet * WARN_ON(refcount == 0) in topology_get_(mstb|port) - danvet * Move kdocs for mstb/port structs inline - danvet * Split drm_dp_get_last_connected_port_and_mstb() changes into their own commit - danvet

[PATCH v5 03/20] drm/dp_mst: Fix some formatting in drm_dp_mst_allocate_vcpi()

2019-01-08 Thread Lyude Paul
Fix some indenting, split some stuff across multiple lines. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v5 01/20] drm/dp_mst: Fix some formatting in drm_dp_add_port()

2019-01-08 Thread Lyude Paul
Reindent some stuff, and split some stuff across multiple lines so we aren't going over the text width limit. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 18

[PATCH v5 15/20] drm/nouveau: Stop unsetting mstc->port, use malloc refs

2019-01-08 Thread Lyude Paul
Same as we did for i915, but for nouveau this time. Additionally, we grab a malloc reference to the port that lasts for the entire lifetime of nv50_mstc, which gives us the guarantee that mstc->port will always point to valid memory for as long as the mstc stays around. Signed-off-by: Lyude P

[PATCH v5 18/20] drm/dp_mst: Start tracking per-port VCPI allocations

2019-01-08 Thread Lyude Paul
Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to call themselves Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/

[PATCH v5 12/20] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2019-01-08 Thread Lyude Paul
Trying to destroy the connector using mstc->connector.funcs->destroy() if connector initialization fails is wrong: there is no possible codepath in nv50_mstc_new where nv50_mstm_add_connector() would return <0 and mstc would be non-NULL. Signed-off-by: Lyude Paul Cc: Daniel Vetter

[PATCH v5 17/20] drm/dp_mst: Add some atomic state iterator macros

2019-01-08 Thread Lyude Paul
Changes since v6: - Move EXPORT_SYMBOL() for drm_dp_mst_topology_state_funcs to this commit - Document __drm_dp_mst_state_iter_get() and note that it shouldn't be called directly Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc

[PATCH v5 11/20] drm/amdgpu/display: Keep malloc ref to MST port

2019-01-08 Thread Lyude Paul
ent that I can see anyway. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/

[PATCH v5 08/20] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2019-01-08 Thread Lyude Paul
This has never actually worked, and isn't needed anyway: the driver's always going to try to deallocate VCPI when it tears down the display that the VCPI belongs to. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li

[PATCH v5 05/20] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2019-01-08 Thread Lyude Paul
, and will make even more sense once we redesign how the current refcounting scheme here works. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114

[PATCH v5 13/20] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2019-01-08 Thread Lyude Paul
future, use msto->disabled instead to check whether or not we need to deallocate VCPI instead. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 +-- 1 file changed, 9 i

[PATCH v5 10/20] drm/i915: Keep malloc references to MST ports

2019-01-08 Thread Lyude Paul
vet Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/i915/intel_connector.c | 4 drivers/gpu/drm/i915/intel_dp_mst.c| 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i

[PATCH v5 19/20] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2019-01-08 Thread Lyude Paul
It occurred to me that we never actually check this! So let's start doing that. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH v5 20/20] drm/nouveau: Use atomic VCPI helpers for MST

2019-01-08 Thread Lyude Paul
: * Update nv50_msto_atomic_check() and nv50_mstc_atomic_check() to the new requirements for drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm

[PATCH v5 16/20] drm/nouveau: Grab payload lock in nv50_msto_payload()

2019-01-08 Thread Lyude Paul
Going through the currently programmed payloads isn't safe without holding mgr->payload_lock, so actually do that and warn if anyone tries calling nv50_msto_payload() in the future without grabbing the right locks. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo

[PATCH v5 14/20] drm/nouveau: Keep malloc references to MST ports

2019-01-08 Thread Lyude Paul
ort could technically be pointing at freed memory. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/

[PATCH v6 03/20] drm/dp_mst: Fix some formatting in drm_dp_mst_allocate_vcpi()

2019-01-10 Thread Lyude Paul
Fix some indenting, split some stuff across multiple lines. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[PATCH v6 12/20] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2019-01-10 Thread Lyude Paul
Trying to destroy the connector using mstc->connector.funcs->destroy() if connector initialization fails is wrong: there is no possible codepath in nv50_mstc_new where nv50_mstm_add_connector() would return <0 and mstc would be non-NULL. Signed-off-by: Lyude Paul Cc: Daniel Vetter

[PATCH v6 09/20] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2019-01-10 Thread Lyude Paul
are still valid and in the topology, any port which has an allocated payload will remain allocated in memory until it's payloads have been removed - finally allowing us to actually release said payloads correctly. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Cc

[PATCH v6 05/20] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2019-01-10 Thread Lyude Paul
, and will make even more sense once we redesign how the current refcounting scheme here works. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114

[PATCH v6 04/20] drm/dp_mst: Fix some formatting in drm_dp_mst_deallocate_vcpi()

2019-01-10 Thread Lyude Paul
Split some stuff across multiple lines Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH v6 07/20] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-10 Thread Lyude Paul
allocations in the rest of the DP MST helpers. Changes since v1: * Convert kerneldoc for drm_dp_get_last_connected_port_and_mstb to normal comment - danvet Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers

[PATCH v6 06/20] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-10 Thread Lyude Paul
Move kdocs for mstb/port structs inline - danvet * Split drm_dp_get_last_connected_port_and_mstb() changes into their own commit - danvet Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- .../gpu/dp-mst/topology-

[PATCH v6 02/20] drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg()

2019-01-10 Thread Lyude Paul
Split some stuff across multiple lines, remove some unnecessary braces Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 14 -- 1 file changed, 8 insertions

[PATCH v6 00/20] MST refcounting/atomic helpers cleanup

2019-01-10 Thread Lyude Paul
off for now :). Also available on gitlab: https://gitlab.freedesktop.org/lyudess/linux/commits/wip/mst-dual-kref-start-v6 Lyude Paul (20): drm/dp_mst: Fix some formatting in drm_dp_add_port() drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg() drm/dp_mst: Fix some formatting

[PATCH v6 16/20] drm/nouveau: Grab payload lock in nv50_msto_payload()

2019-01-10 Thread Lyude Paul
Going through the currently programmed payloads isn't safe without holding mgr->payload_lock, so actually do that and warn if anyone tries calling nv50_msto_payload() in the future without grabbing the right locks. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo

[PATCH v6 01/20] drm/dp_mst: Fix some formatting in drm_dp_add_port()

2019-01-10 Thread Lyude Paul
Reindent some stuff, and split some stuff across multiple lines so we aren't going over the text width limit. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 18

[PATCH v6 13/20] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2019-01-10 Thread Lyude Paul
future, use msto->disabled instead to check whether or not we need to deallocate VCPI instead. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 +-- 1 file changed, 9 i

[PATCH v6 08/20] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2019-01-10 Thread Lyude Paul
This has never actually worked, and isn't needed anyway: the driver's always going to try to deallocate VCPI when it tears down the display that the VCPI belongs to. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li

[PATCH v6 11/20] drm/amdgpu/display: Keep malloc ref to MST port

2019-01-10 Thread Lyude Paul
ent that I can see anyway. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/

[PATCH v6 10/20] drm/i915: Keep malloc references to MST ports

2019-01-10 Thread Lyude Paul
vet Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/i915/intel_connector.c | 4 drivers/gpu/drm/i915/intel_dp_mst.c| 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i

[PATCH v6 18/20] drm/dp_mst: Start tracking per-port VCPI allocations

2019-01-10 Thread Lyude Paul
Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to call themselves Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/

[PATCH v6 20/20] drm/nouveau: Use atomic VCPI helpers for MST

2019-01-10 Thread Lyude Paul
: * Update nv50_msto_atomic_check() and nv50_mstc_atomic_check() to the new requirements for drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm

[PATCH v6 19/20] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2019-01-10 Thread Lyude Paul
It occurred to me that we never actually check this! So let's start doing that. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH v6 17/20] drm/dp_mst: Add some atomic state iterator macros

2019-01-10 Thread Lyude Paul
Changes since v6: - Move EXPORT_SYMBOL() for drm_dp_mst_topology_state_funcs to this commit - Document __drm_dp_mst_state_iter_get() and note that it shouldn't be called directly Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc

[PATCH v6 15/20] drm/nouveau: Stop unsetting mstc->port, use malloc refs

2019-01-10 Thread Lyude Paul
Same as we did for i915, but for nouveau this time. Additionally, we grab a malloc reference to the port that lasts for the entire lifetime of nv50_mstc, which gives us the guarantee that mstc->port will always point to valid memory for as long as the mstc stays around. Signed-off-by: Lyude P

[PATCH v6 14/20] drm/nouveau: Keep malloc references to MST ports

2019-01-10 Thread Lyude Paul
ort could technically be pointing at freed memory. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/

[PATCH 0/3] drm/amdgpu: Fix suspend/resume issues with MST

2019-01-07 Thread Lyude Paul
Fix the suspend/issues that Jerry Zuo found in amdgpu, and add some compiler warnings for drivers ignoring the return code of drm_dp_mst_topology_mgr_resume() to help ensure we don't need to fix this again in the future for someone else's driver. Cc: Jerry Zuo Lyude Paul (3): drm/amdgpu

[PATCH 3/3] drm/dp_mst: Add __must_check to drm_dp_mst_topology_mgr_resume()

2019-01-07 Thread Lyude Paul
Since I've had to fix two cases of drivers not checking the return code from this function, let's make the compiler complain so this doesn't come up again in the future. Signed-off-by: Lyude Paul Cc: Jerry Zuo Cc: Daniel Vetter --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- include/drm

[PATCH 1/3] drm/amdgpu: Don't ignore rc from drm_dp_mst_topology_mgr_resume()

2019-01-07 Thread Lyude Paul
this by actually checking the rc from drm_dp_mst_topology_mgr_resume(). Also, reformat the rest of the function while we're at it to fix the over-indenting. Signed-off-by: Lyude Paul Cc: Jerry Zuo Cc: # v4.15+ --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 32 +-- 1 file changed, 23

[PATCH 2/3] drm/amdgpu: Don't fail resume process if resuming atomic state fails

2019-01-07 Thread Lyude Paul
because of a potentially unavoidable atomic commit failure. Eventually, we'll have a real fix for this problem on the DRM level. But we've got some more important low-hanging fruit to deal with first. Signed-off-by: Lyude Paul Cc: Jerry Zuo Cc: # v4.15+ --- drivers/gpu/drm/amd/display/amdgpu_dm

[PATCH v7 15/20] drm/nouveau: Stop unsetting mstc->port, use malloc refs

2019-01-10 Thread Lyude Paul
Same as we did for i915, but for nouveau this time. Additionally, we grab a malloc reference to the port that lasts for the entire lifetime of nv50_mstc, which gives us the guarantee that mstc->port will always point to valid memory for as long as the mstc stays around. Signed-off-by: Lyude P

[PATCH v7 20/20] drm/nouveau: Use atomic VCPI helpers for MST

2019-01-10 Thread Lyude Paul
: * Update nv50_msto_atomic_check() and nv50_mstc_atomic_check() to the new requirements for drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() Signed-off-by: Lyude Paul Reviewed-By: Ben Skeggs Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston

[PATCH v7 17/20] drm/dp_mst: Add some atomic state iterator macros

2019-01-10 Thread Lyude Paul
Changes since v6: - Move EXPORT_SYMBOL() for drm_dp_mst_topology_state_funcs to this commit - Document __drm_dp_mst_state_iter_get() and note that it shouldn't be called directly Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc

[PATCH v7 12/20] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2019-01-10 Thread Lyude Paul
Trying to destroy the connector using mstc->connector.funcs->destroy() if connector initialization fails is wrong: there is no possible codepath in nv50_mstc_new where nv50_mstm_add_connector() would return <0 and mstc would be non-NULL. Signed-off-by: Lyude Paul Reviewed-By: Ben S

[PATCH v7 19/20] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2019-01-10 Thread Lyude Paul
It occurred to me that we never actually check this! So let's start doing that. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH v7 13/20] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2019-01-10 Thread Lyude Paul
future, use msto->disabled instead to check whether or not we need to deallocate VCPI instead. Signed-off-by: Lyude Paul Reviewed-By: Ben Skeggs Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15

[PATCH v7 18/20] drm/dp_mst: Start tracking per-port VCPI allocations

2019-01-10 Thread Lyude Paul
Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to call themselves Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/

[PATCH v7 16/20] drm/nouveau: Grab payload lock in nv50_msto_payload()

2019-01-10 Thread Lyude Paul
Going through the currently programmed payloads isn't safe without holding mgr->payload_lock, so actually do that and warn if anyone tries calling nv50_msto_payload() in the future without grabbing the right locks. Signed-off-by: Lyude Paul Reviewed-By: Ben Skeggs Cc: Daniel Vetter Cc: Da

Re: [PATCH] drm/amd/display: Remove error message in stream create routine

2019-01-10 Thread Lyude Paul
DRM_ERROR("Failed to create stream for sink!\n"); > + if (stream == NULL) > goto finish; > - } > > stream->dm_stream_context = aconnector; > -- Cheers, Lyude Paul ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amd/display: Don't fail atomic check in MST S3 topology change

2019-01-10 Thread Lyude Paul
DRM_DEBUG_DRIVER("Mode change not expected on %s\n", > aconnector->base.name); > + goto next_crtc; > } > > dm_new_crtc_state->abm_level = dm_new_conn_state->abm_level; -- Cheers, Lyude Paul ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH v7 07/20] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-10 Thread Lyude Paul
allocations in the rest of the DP MST helpers. Changes since v1: * Convert kerneldoc for drm_dp_get_last_connected_port_and_mstb to normal comment - danvet Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers

[PATCH v7 06/20] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-10 Thread Lyude Paul
Move kdocs for mstb/port structs inline - danvet * Split drm_dp_get_last_connected_port_and_mstb() changes into their own commit - danvet Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- .../gpu/dp-mst/topology-

[PATCH v7 14/20] drm/nouveau: Keep malloc references to MST ports

2019-01-10 Thread Lyude Paul
ort could technically be pointing at freed memory. Signed-off-by: Lyude Paul Reviewed-By: Ben Skeggs Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/driver

[PATCH v7 08/20] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2019-01-10 Thread Lyude Paul
This has never actually worked, and isn't needed anyway: the driver's always going to try to deallocate VCPI when it tears down the display that the VCPI belongs to. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li

[PATCH v7 03/20] drm/dp_mst: Fix some formatting in drm_dp_mst_allocate_vcpi()

2019-01-10 Thread Lyude Paul
Fix some indenting, split some stuff across multiple lines. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[PATCH v7 11/20] drm/amdgpu/display: Keep malloc ref to MST port

2019-01-10 Thread Lyude Paul
ent that I can see anyway. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/

[PATCH v7 02/20] drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg()

2019-01-10 Thread Lyude Paul
Split some stuff across multiple lines, remove some unnecessary braces Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 14 -- 1 file changed, 8 insertions

[PATCH v7 10/20] drm/i915: Keep malloc references to MST ports

2019-01-10 Thread Lyude Paul
vet Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/i915/intel_connector.c | 4 drivers/gpu/drm/i915/intel_dp_mst.c| 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i

[PATCH v7 09/20] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2019-01-10 Thread Lyude Paul
are still valid and in the topology, any port which has an allocated payload will remain allocated in memory until it's payloads have been removed - finally allowing us to actually release said payloads correctly. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Cc

[PATCH v7 04/20] drm/dp_mst: Fix some formatting in drm_dp_mst_deallocate_vcpi()

2019-01-10 Thread Lyude Paul
Split some stuff across multiple lines Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH v7 00/20] MST refcounting/atomic helpers cleanup

2019-01-10 Thread Lyude Paul
off for now :). Not available on gitlab, as this is the final version of the series before I push! hooray~ Lyude Paul (20): drm/dp_mst: Fix some formatting in drm_dp_add_port() drm/dp_mst: Fix some formatting in drm_dp_payload_send_msg() drm/dp_mst: Fix some formatting

[PATCH v7 05/20] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2019-01-10 Thread Lyude Paul
, and will make even more sense once we redesign how the current refcounting scheme here works. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114

[PATCH v7 01/20] drm/dp_mst: Fix some formatting in drm_dp_add_port()

2019-01-10 Thread Lyude Paul
Reindent some stuff, and split some stuff across multiple lines so we aren't going over the text width limit. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 18

[PATCH 5/6] drm/i915: Fix intel_dp_mst_best_encoder()

2018-09-18 Thread Lyude Paul
eck() to prevent new modesets on no-longer-present MSTB ports. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/i915/intel_dp_mst.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i

[PATCH 2/6] drm/nouveau: Unbreak nv50_mstc->best_encoder()

2018-09-18 Thread Lyude Paul
ble CRTCs on MST connectors after the connector's respective topology has disappeared. So, fix this by instead using the new drm_dp_mst_connector_atomic_check() helper instead while always returning a valid encoder from ->best_encoder(). Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- d

[PATCH 6/6] drm/amdgpu/dm/mst: Use drm_dp_mst_connector_atomic_check()

2018-09-18 Thread Lyude Paul
gpu. Congrats AMD! Signed-off-by: Lyude Paul --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c in

[PATCH 4/6] drm/i915: Skip vcpi allocation for MSTB ports that are gone

2018-09-18 Thread Lyude Paul
fig() is called on an MST port that's gone. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/i915/intel_dp_mst.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_ms

[PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()

2018-09-18 Thread Lyude Paul
ically if the MST port driving the connector no longer exists. We'll also be able to expand upon this later as well once we add MST fallback retraining support. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/drm_dp_mst_topology.c | 76 +++ inclu

[PATCH 3/6] drm/i915: Leave intel_conn->mst_port set, use mst_port_gone instead

2018-09-18 Thread Lyude Paul
e connector has disappeared from the system. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/i915/intel_dp_mst.c | 14 +++--- drivers/gpu/drm/i915/intel_drv.h| 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp_m

[PATCH 0/6] Fix legacy DPMS changes with MST

2018-09-18 Thread Lyude Paul
ailing with legacy modesetting users after an MST connector's topology has disappeared, which resulted in CRTCs being left on when they shouldn't have been Lyude Paul (6): drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check() drm/nouveau: Unbreak nv50_mstc->best_encoder() drm/i9

Re: [WIP PATCH 03/15] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2018-12-19 Thread Lyude Paul
On Wed, 2018-12-19 at 13:48 +0100, Daniel Vetter wrote: > On Tue, Dec 18, 2018 at 04:27:58PM -0500, Lyude Paul wrote: > > On Fri, 2018-12-14 at 10:29 +0100, Daniel Vetter wrote: > > > On Thu, Dec 13, 2018 at 08:25:32PM -0500, Lyude Paul wrote: > > > > The curre

[PATCH v2 03/16] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2018-12-19 Thread Lyude Paul
allocations in the rest of the DP MST helpers. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 55 +-- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git

[PATCH v2 07/16] drm/amdgpu/display: Keep malloc ref to MST port

2018-12-19 Thread Lyude Paul
ent that I can see anyway. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH v2 02/16] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2018-12-19 Thread Lyude Paul
() -> drm_dp_mst_topology_try_get_(port|mstb)() and drm_dp_mst_topology_ref_(port|mstb)() -> drm_dp_mst_topology_get_(port|mstb)() - danvet * s/should/must in docs - danvet * WARN_ON(refcount == 0) in topology_get_(mstb|port) - danvet * Move kdocs for mstb/port structs inline - danvet * Split drm_dp_get_la

[PATCH v2 01/16] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2018-12-19 Thread Lyude Paul
, and will make even more sense once we redesign how the current refcounting scheme here works. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114 ++ 1 file

[PATCH v2 00/16] MST refcounting/atomic helpers cleanup

2018-12-19 Thread Lyude Paul
off for now :). Lyude Paul (16): drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends drm/dp_mst: Introduce new refcounting scheme for mstbs and ports drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails drm/dp_mst: Stop releasing VCPI when

[PATCH v2 15/16] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2018-12-19 Thread Lyude Paul
It occurred to me that we never actually check this! So let's start doing that. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 11 +++ 1 file changed, 7 insertions

[PATCH v2 08/16] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2018-12-19 Thread Lyude Paul
Trying to destroy the connector using mstc->connector.funcs->destroy() if connector initialization fails is wrong: there is no possible codepath in nv50_mstc_new where nv50_mstm_add_connector() would return <0 and mstc would be non-NULL. Signed-off-by: Lyude Paul Cc: Daniel Vetter

[PATCH v2 05/16] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2018-12-19 Thread Lyude Paul
are still valid and in the topology, any port which has an allocated payload will remain allocated in memory until it's payloads have been removed - finally allowing us to actually release said payloads correctly. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc

[PATCH v2 14/16] drm/dp_mst: Start tracking per-port VCPI allocations

2018-12-19 Thread Lyude Paul
te new payloads. - Add function references in drm_dp_atomic_release_vcpi_slots() - danvet - Annotate atomic VCPI and atomic check functions with __must_check - danvet Changes since v1: - Don't use the now-removed ->atomic_check() for private objects hook, just give drivers a function to ca

[PATCH v2 16/16] drm/nouveau: Use atomic VCPI helpers for MST

2018-12-19 Thread Lyude Paul
for drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 52 ++--- 1 file changed, 46 insertions(+), 6

[PATCH v2 04/16] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2018-12-19 Thread Lyude Paul
This has never actually worked, and isn't needed anyway: the driver's always going to try to deallocate VCPI when it tears down the display that the VCPI belongs to. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li

[PATCH v2 13/16] drm/dp_mst: Add some atomic state iterator macros

2018-12-19 Thread Lyude Paul
Changes since v6: - Move EXPORT_SYMBOL() for drm_dp_mst_topology_state_funcs to this commit - Document __drm_dp_mst_state_iter_get() and note that it shouldn't be called directly Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc

[PATCH v2 11/16] drm/nouveau: Stop unsetting mstc->port, use malloc refs

2018-12-19 Thread Lyude Paul
Same as we did for i915, but for nouveau this time. Additionally, we grab a malloc reference to the port that lasts for the entire lifetime of nv50_mstc, which gives us the guarantee that mstc->port will always point to valid memory for as long as the mstc stays around. Signed-off-by: Lyude P

<    1   2   3   4   5   6   7   >