[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

Re: [Intel-gfx] [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

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

2019-01-04 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/

[Intel-gfx] [PATCH v4 12/16] drm/nouveau: Grab payload lock in nv50_msto_payload()

2019-01-04 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

[Intel-gfx] [PATCH v4 16/16] drm/nouveau: Use atomic VCPI helpers for MST

2019-01-04 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

[Intel-gfx] [PATCH v4 13/16] drm/dp_mst: Add some atomic state iterator macros

2019-01-04 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

[Intel-gfx] [PATCH v4 15/16] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2019-01-04 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

[Intel-gfx] [PATCH v4 10/16] drm/nouveau: Keep malloc references to MST ports

2019-01-04 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/

[Intel-gfx] [PATCH v4 05/16] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2019-01-04 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

[Intel-gfx] [PATCH v4 09/16] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2019-01-04 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

[Intel-gfx] [PATCH v4 07/16] drm/amdgpu/display: Keep malloc ref to MST port

2019-01-04 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/

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

2019-01-04 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

[Intel-gfx] [PATCH v4 08/16] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2019-01-04 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

[Intel-gfx] [PATCH v4 02/16] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-04 Thread Lyude Paul
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 Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li squash! drm/dp_mst: Introduce

[Intel-gfx] [PATCH v4 01/16] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2019-01-04 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 Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114 ++ 1

[Intel-gfx] [PATCH v4 03/16] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-04 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 | 54 ++- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git

[Intel-gfx] [PATCH v4 06/16] drm/i915: Keep malloc references to MST ports

2019-01-04 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

[Intel-gfx] [PATCH v4 04/16] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2019-01-04 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 Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu

[Intel-gfx] [PATCH v4 00/16] MST refcounting/atomic helpers cleanup

2019-01-04 Thread Lyude Paul
://gitlab.freedesktop.org/lyudess/linux/commits/wip/mst-dual-kref-start-v4 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

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

2019-01-02 Thread Lyude Paul
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/gpu/drm/drm_dp_mst_topology.c | 247 ++ drivers/gpu/drm/i915/intel_displ

[Intel-gfx] [PATCH v3 13/16] drm/dp_mst: Add some atomic state iterator macros

2019-01-02 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

[Intel-gfx] [PATCH v3 08/16] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2019-01-02 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

[Intel-gfx] [PATCH v3 09/16] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2019-01-02 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

[Intel-gfx] [PATCH v3 12/16] drm/nouveau: Grab payload lock in nv50_msto_payload()

2019-01-02 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

[Intel-gfx] [PATCH v3 16/16] drm/nouveau: Use atomic VCPI helpers for MST

2019-01-02 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

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

2019-01-02 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

[Intel-gfx] [PATCH v3 15/16] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2019-01-02 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

[Intel-gfx] [PATCH v3 01/16] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends

2019-01-02 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 Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 114 ++ 1

[Intel-gfx] [PATCH v3 06/16] drm/i915: Keep malloc references to MST ports

2019-01-02 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

[Intel-gfx] [PATCH v3 02/16] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-02 Thread Lyude Paul
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 Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li squash! drm/dp_mst: Introduce

[Intel-gfx] [PATCH v3 10/16] drm/nouveau: Keep malloc references to MST ports

2019-01-02 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/

[Intel-gfx] [PATCH v3 05/16] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2019-01-02 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

[Intel-gfx] [PATCH v3 00/16] MST refcounting/atomic helpers cleanup

2019-01-02 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

[Intel-gfx] [PATCH v3 03/16] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-02 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 | 54 ++- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git

[Intel-gfx] [PATCH v3 07/16] drm/amdgpu/display: Keep malloc ref to MST port

2019-01-02 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/

[Intel-gfx] [PATCH v3 04/16] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2019-01-02 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 Cc: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc: Harry Wentland Cc: Juston Li --- drivers/gpu

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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/

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [PATCH v2 10/16] drm/nouveau: Keep malloc references to MST ports

2018-12-19 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/

[Intel-gfx] [PATCH v2 09/16] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2018-12-19 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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [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

[Intel-gfx] [PATCH v2 12/16] drm/nouveau: Grab payload lock in nv50_msto_payload()

2018-12-19 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

[Intel-gfx] [PATCH v2 06/16] drm/i915: Keep malloc references to MST ports

2018-12-19 Thread Lyude Paul
vet Signed-off-by: Lyude Paul Cc: 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/i915/intel_connector.c

[Intel-gfx] [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

Re: [Intel-gfx] [PATCH] drm/i915/dsc: Fix the deadlock in dsc debugfs node

2018-12-19 Thread Lyude Paul
Reviewed-by: Lyude Paul On Wed, 2018-12-19 at 15:51 -0800, Manasi Navare wrote: > The DSC debugfs node causes a possible deadlock situation. This patch > resets the try_again at the beginning of loop to fix this. > > Fixes: e845f099f1c6 ('drm/i915/dsc: Add Per connector debugfs

Re: [Intel-gfx] [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

Re: [Intel-gfx] [WIP PATCH 05/15] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2018-12-18 Thread Lyude Paul
On Fri, 2018-12-14 at 10:38 +0100, Daniel Vetter wrote: > On Thu, Dec 13, 2018 at 08:25:34PM -0500, Lyude Paul wrote: > > Up until now, freeing payloads on remote MST hubs that just had ports > > removed has almost never worked because we've been relying on port > > validatio

Re: [Intel-gfx] [WIP PATCH 06/15] drm/i915: Keep malloc references to MST ports

2018-12-18 Thread Lyude Paul
On Fri, 2018-12-14 at 10:32 +0100, Daniel Vetter wrote: > On Thu, Dec 13, 2018 at 08:25:35PM -0500, Lyude Paul wrote: > > So that the ports stay around until we've destroyed the connectors, in > > order to ensure that we don't pass an invalid pointer to any MST helpers > &

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

2018-12-18 Thread Lyude Paul
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 current way of handling refcounting in the DP MST helpers is really > > confusing and probably just plain wrong because it's been hacked up many > >

[Intel-gfx] [WIP PATCH 15/15] drm/nouveau: Use atomic VCPI helpers for MST

2018-12-13 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 --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 52 ++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b

[Intel-gfx] [WIP PATCH 10/15] drm/nouveau: Stop unsetting mstc->port, use malloc refs

2018-12-13 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

[Intel-gfx] [WIP PATCH 12/15] drm/dp_mst: Add some atomic state iterator macros

2018-12-13 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 --- drivers/gpu/drm/drm_dp_mst_topology.c | 5

[Intel-gfx] [WIP PATCH 09/15] drm/nouveau: Fix potential use-after-frees for MSTCs

2018-12-13 Thread Lyude Paul
ort could technically be pointing at freed memory. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 0f7d72518604..982054bbcc

[Intel-gfx] [WIP PATCH 04/15] drm/dp_mst: Stop releasing VCPI when removing ports from topology

2018-12-13 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 --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 1 file changed, 8 deletions(-) diff --git

[Intel-gfx] [WIP PATCH 05/15] drm/dp_mst: Fix payload deallocation on hotplugs using malloc refs

2018-12-13 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 --- drivers/gpu/drm/drm_dp_mst_topology.c | 54

[Intel-gfx] [WIP PATCH 11/15] drm/nouveau: Grab payload lock in nv50_msto_payload()

2018-12-13 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 --- drivers/gpu/drm/nouveau/dispnv50/disp.c

[Intel-gfx] [WIP PATCH 14/15] drm/dp_mst: Check payload count in drm_dp_mst_atomic_check()

2018-12-13 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 --- drivers/gpu/drm/drm_dp_mst_topology.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b

[Intel-gfx] [WIP PATCH 13/15] drm/dp_mst: Start tracking per-port VCPI allocations

2018-12-13 Thread Lyude Paul
ns 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 call themselves Signed-off-by: Lyude Paul Cc: Daniel Vetter --- drivers/gpu/drm/drm_dp_mst_topology.c | 271 +++--- d

[Intel-gfx] [WIP PATCH 00/15] MST refcounting/atomic helpers cleanup

2018-12-13 Thread Lyude Paul
for the series this is based off of: drm/dp_mst: Improve VCPI helpers, use in nouveau https://patchwork.freedesktop.org/series/51414/ This is just getting put on the ML so I can get some feedback on this. Lyude Paul (15): drm/dp_mst: Remove bogus conditional in drm_dp_update_payload_part1() drm

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

2018-12-13 Thread Lyude Paul
t;1) Since we now can guarantee memory safety for ports and branches as-needed, we also can make our main reference counting functions fix this problem by using kref_get_unless_zero() internally so that topology refcounts can only ever reach 0 once. Signed-off-by: Lyude Paul Cc: Daniel Vetter Cc: David

[Intel-gfx] [WIP PATCH 06/15] drm/i915: Keep malloc references to MST ports

2018-12-13 Thread Lyude Paul
So that the ports stay around until we've destroyed the connectors, in order to ensure that we don't pass an invalid pointer to any MST helpers once we introduce the new MST VCPI helpers. Signed-off-by: Lyude Paul --- drivers/gpu/drm/i915/intel_connector.c | 4 drivers/gpu/drm/i915

[Intel-gfx] [WIP PATCH 07/15] drm/nouveau: Remove bogus cleanup in nv50_mstm_add_connector()

2018-12-13 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 --- drivers/gpu/dr

[Intel-gfx] [WIP PATCH 01/15] drm/dp_mst: Remove bogus conditional in drm_dp_update_payload_part1()

2018-12-13 Thread Lyude Paul
There's no reason we need this, it's just confusing looking. Signed-off-by: Lyude Paul Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c

[Intel-gfx] [WIP PATCH 08/15] drm/nouveau: Remove unnecessary VCPI checks in nv50_msto_cleanup()

2018-12-13 Thread Lyude Paul
future, use msto->disabled instead to check whether or not we need to deallocate VCPI instead. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/

[Intel-gfx] [WIP PATCH 02/15] drm/dp_mst: Refactor drm_dp_update_payload_part1()

2018-12-13 Thread Lyude Paul
There should be no functional changes here Signed-off-by: Lyude Paul Cc: Juston Li --- drivers/gpu/drm/drm_dp_mst_topology.c | 71 --- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm

Re: [Intel-gfx] [PATCH v7] drm/i915/dsc: Add Per connector debugfs node for DSC support/enable

2018-12-05 Thread Lyude Paul
written through this debugfs node is used to force > DSC even for lower resolutions. > > Credits to Ville Syrjala for suggesting the proper locks to be used > and to Lyude Paul for explaining how to use them in this context > > v7: > * Get crtc, crtc_state from connector atomic stat

Re: [Intel-gfx] [PATCH v6] drm/i915/dsc: Add Per connector debugfs node for DSC support/enable

2018-12-05 Thread Lyude Paul
On Wed, 2018-12-05 at 11:29 -0800, Manasi Navare wrote: > On Wed, Dec 05, 2018 at 02:00:39PM -0500, Lyude Paul wrote: > > Looks good, some small nitpicks > > > > On Tue, 2018-12-04 at 11:55 -0800, Manasi Navare wrote: > > > DSC can be supported per DP connector. T

Re: [Intel-gfx] [PATCH v6] drm/i915/dsc: Add Per connector debugfs node for DSC support/enable

2018-12-05 Thread Lyude Paul
(Lyude) > * Rebase on drm-tip (Manasi) > > Cc: Rodrigo Vivi > Cc: Ville Syrjala > Cc: Anusha Srivatsa > Cc: Lyude Paul > Signed-off-by: Manasi Navare > --- > drivers/gpu/drm/i915/i915_debugfs.c | 80 + > drivers/gpu/drm/i915/intel_d

Re: [Intel-gfx] [PATCH v3] Return only active connectors for get_resources ioctl

2018-11-29 Thread Lyude Paul
; > return -EFAULT; > } > + DRM_DEBUG_KMS("GetResources: connector %s", connector- > >name); > count++; > } > } > card_res->count_connectors = count; > + DRM

Re: [Intel-gfx] [PATCH] drm/dp-mst-helper: Remove hotplug callback

2018-11-29 Thread Lyude Paul
Reviewed-by: Lyude Paul On Wed, 2018-11-28 at 23:12 +0100, Daniel Vetter wrote: > When everyone implements it exactly the same way, among all 4 > implementations, there's not really a need to overwrite this at all. > > Aside: drm_kms_helper_hotplug_event is pretty much core f

Re: [Intel-gfx] [PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations

2018-11-28 Thread Lyude Paul
On Wed, 2018-11-28 at 09:17 +0100, Daniel Vetter wrote: > On Tue, Nov 27, 2018 at 08:44:14PM -0500, Lyude Paul wrote: > > On Tue, 2018-11-27 at 20:44 +0100, Daniel Vetter wrote: > > > > We could do this the other way around so it looks like this maybe > > > &

Re: [Intel-gfx] [PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations

2018-11-28 Thread Lyude Paul
On Wed, 2018-11-28 at 09:17 +0100, Daniel Vetter wrote: > On Tue, Nov 27, 2018 at 08:44:14PM -0500, Lyude Paul wrote: > > On Tue, 2018-11-27 at 20:44 +0100, Daniel Vetter wrote: > > > On Tue, Nov 27, 2018 at 12:48:59PM -0500, Lyude Paul wrote: > > > > On Mon, 201

Re: [Intel-gfx] [PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations

2018-11-27 Thread Lyude Paul
On Tue, 2018-11-27 at 20:44 +0100, Daniel Vetter wrote: > On Tue, Nov 27, 2018 at 12:48:59PM -0500, Lyude Paul wrote: > > On Mon, 2018-11-26 at 22:22 +0100, Daniel Vetter wrote: > > > On Mon, Nov 26, 2018 at 10:04:21PM +0100, Daniel Vetter wrote: > > > > On Thu, No

Re: [Intel-gfx] [Nouveau] [PATCH 1/6] drm/dp_mst: Add drm_dp_get_payload_info()

2018-11-27 Thread Lyude Paul
On Tue, 2018-11-27 at 22:23 +0100, Daniel Vetter wrote: > On Fri, Nov 16, 2018 at 07:21:15PM -0500, Lyude Paul wrote: > > Some hardware (nvidia hardware in particular) needs to be notified of > > the exact VCPI and payload settings that the topology manager decided on > > for

Re: [Intel-gfx] [PATCH 4/6] drm/nouveau: Stop reading port->mgr in nv50_mstc_detect()

2018-11-27 Thread Lyude Paul
ouveau: Grab runtime PM ref in nv50_mstc_detect()") Should also be backported for v4.9+, and then this patch should be applied on top of that. > > -- > Thanks, > Sasha -- Cheers, Lyude Paul ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Re: [Intel-gfx] [PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations

2018-11-27 Thread Lyude Paul
On Mon, 2018-11-26 at 22:22 +0100, Daniel Vetter wrote: > On Mon, Nov 26, 2018 at 10:04:21PM +0100, Daniel Vetter wrote: > > On Thu, Nov 15, 2018 at 07:50:05PM -0500, Lyude Paul wrote: > > > There has been a TODO waiting for quite a long time in > > > drm_dp_mst_topol

Re: [Intel-gfx] [RESEND PATCH v2 1/2] drm/dp/mst: Reprobe EDID for MST ports on resume

2018-11-26 Thread Lyude Paul
logy. Feel free to poke me about this on irc btw, might be quicker to discuss it there > > Thanks > Juston > > On Thu, 2018-11-08 at 19:43 -0500, Lyude Paul wrote: > > Are you still looking into this at all? Even if it's not the right > > approach > > I'm still

Re: [Intel-gfx] [PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations

2018-11-26 Thread Lyude Paul
On Mon, 2018-11-26 at 22:04 +0100, Daniel Vetter wrote: > On Thu, Nov 15, 2018 at 07:50:05PM -0500, Lyude Paul wrote: > > There has been a TODO waiting for quite a long time in > > drm_dp_mst_topology.c: > > > > /* We cannot rely on port->vcpi.num_slots to up

Re: [Intel-gfx] [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

[Intel-gfx] [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show()

2018-11-20 Thread Lyude Paul
work, dig_port_work, and hotplug_work before printing out the HPD storm status in i915_hpd_storm_ctl_show(). Signed-off-by: Lyude Paul Cc: Ville Syrjälä --- drivers/gpu/drm/i915/i915_debugfs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers

[Intel-gfx] [PATCH 3/6] drm/nouveau: Stop reading port->mgr in nv50_mstc_get_modes()

2018-11-16 Thread Lyude Paul
mstc->port isn't validated here so it could be null or worse when we access it. And drivers aren't ever supposed to be looking at it's contents anyway. Plus, we can already get the MST manager from >mstm->mgr. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/dr

[Intel-gfx] [PATCH 1/6] drm/dp_mst: Add drm_dp_get_payload_info()

2018-11-16 Thread Lyude Paul
by themselves, ever), let's add one. Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 56 +++ include/drm/drm_dp_mst_helper.h | 5 ++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b

[Intel-gfx] [PATCH 5/6] drm/dp_mst: Hide drm_dp_mst_port contents from drivers

2018-11-16 Thread Lyude Paul
out of drm_dp_mst_helper.h, into drm_dp_mst_topology.c, and then replace it's header definition with an incomplete struct type. This way drivers can still use the struct type, and no one else will make the mistake of trying to access the contents of port. Signed-off-by: Lyude Paul --- drivers/gpu/

[Intel-gfx] [PATCH 4/6] drm/nouveau: Stop reading port->mgr in nv50_mstc_detect()

2018-11-16 Thread Lyude Paul
Same as the previous commit, but for nv50_mstc_detect() this time. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm

[Intel-gfx] [PATCH 6/6] drm/i915: Start using struct drm_dp_mst_port again

2018-11-16 Thread Lyude Paul
when using the proper type. So, move back to struct drm_dp_mst_port from void* for clarity. Signed-off-by: Lyude Paul --- drivers/gpu/drm/i915/intel_dp_mst.c | 2 +- drivers/gpu/drm/i915/intel_drv.h| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915

[Intel-gfx] [PATCH 2/6] drm/nouveau: Use drm_dp_get_payload_info() for getting payload/vcpi

2018-11-16 Thread Lyude Paul
int because it doesn't bother trying to grab the payload lock. So; remove nv50_msto_payload entirely and use the new drm_dp_get_payload_info() helper. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 55 ++--- 1 file changed, 21 insertions(+), 34 deleti

[Intel-gfx] [PATCH 0/6] Remove all bad dp_mst_port uses and hide struct def

2018-11-16 Thread Lyude Paul
So we don't ever have to worry about drivers touching drm_dp_mst_port structs without verifying them and crashing again. Lyude Paul (6): drm/dp_mst: Add drm_dp_get_payload_info() drm/nouveau: Use drm_dp_get_payload_info() for getting payload/vcpi drm/nouveau: Stop reading port->

<    4   5   6   7   8   9   10   11   12   13   >