[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 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 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:

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

2019-01-10 Thread Lyude Paul
ecovery handling for VCPI 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

[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 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 06/20] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-10 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 Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc:

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

2019-01-10 Thread Lyude Paul
port - danvet 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

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

2019-01-10 Thread Lyude Paul
his code in the 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 fi

[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 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

[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

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

2019-01-10 Thread Lyude Paul
anvet - 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 call themselves Signed-off-by: Lyude Paul Reviewed-by: D

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

2019-01-10 Thread Lyude Paul
at assignment 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/dr

[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(

[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 Wentlan

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

2019-01-10 Thread Lyude Paul
t the ports 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

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

2019-01-10 Thread Lyude Paul
hanges since v5: * 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 ---

[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
mstc->port 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

[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

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

2019-01-10 Thread Lyude Paul
good place to start 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: Fi

[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 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 07/20] drm/dp_mst: Restart last_connected_port_and_mstb() if topology ref fails

2019-01-10 Thread Lyude Paul
ecovery handling for VCPI 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

[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:

[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 06/20] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports

2019-01-10 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 Reviewed-by: Harry Wentland Reviewed-by: Daniel Vetter Cc: David Airlie Cc: Jerry Zuo Cc:

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

2019-01-10 Thread Lyude Paul
t the ports 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

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

2019-01-10 Thread Lyude Paul
his code in the 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.

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

2019-01-10 Thread Lyude Paul
port - danvet 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

[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 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(

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

2019-01-10 Thread Lyude Paul
hanges since v5: * 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 Wentl

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

2019-01-10 Thread Lyude Paul
at assignment 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/dr

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

2019-01-10 Thread Lyude Paul
anvet - 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 call themselves Signed-off-by: Lyude Paul Reviewed-by: D

[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 Wentlan

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

2019-01-10 Thread Lyude Paul
mstc->port 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 --gi

[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 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 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 C

[PATCH] drm/i915: Pass down rc in intel_encoder->compute_config()

2019-01-14 Thread Lyude Paul
e instead of a bool so that the atomic check can be restarted on modeset deadlocks. Thanks to Ville Syrjälä for pointing this out! Signed-off-by: Lyude Paul Cc: Ville Syrjälä Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations") Bugzilla: https://bugs.freedeskt

[PATCH v2] drm/i915: Pass down rc in intel_encoder->compute_config()

2019-01-15 Thread Lyude Paul
* Change all of the intel_dp_compute_link_config*() variants * Don't miss if (hdmi_port_clock_valid()) branch in intel_hdmi_compute_config() Signed-off-by: Lyude Paul Cc: Ville Syrjälä Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations") Bugzilla: https://bugs.free

[PATCH 0/3] drm/dp_mst: Misc drive-by fixes

2019-01-16 Thread Lyude Paul
Two not terribly important fixes, and one actually important fix. Should be pretty easy to review :) Lyude Paul (3): drm/dp_mst: Remove lock check in drm_atomic_get_mst_topology_state() drm/dp_mst: Fix potential topology ref leak in drm_dp_atomic_find_vcpi_slots() drm/dp_mst: Fix

[PATCH 3/3] drm/dp_mst: Fix topology ref leak in drm_dp_mst_allocate_vcpi()

2019-01-16 Thread Lyude Paul
oved from the system. So, fix this by making sure that we always drop the topology ref to port when returning from this function. Additionally: it looks like this bug exists pre-topology & malloc krefs, so let's also make sure this gets backported to stable. Signed-off-by: Lyude Paul Fix

[PATCH 1/3] drm/dp_mst: Remove lock check in drm_atomic_get_mst_topology_state()

2019-01-16 Thread Lyude Paul
l docs for the function. Additionally since all function is now is a simple wrapper around drm_atomic_get_private_obj_state(), it seems more reasonable to move this out of drm_dp_mst_topology.c and turn it into an inline function in drm_dp_mst_helper.h Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm

[PATCH 2/3] drm/dp_mst: Fix potential topology ref leak in drm_dp_atomic_find_vcpi_slots()

2019-01-16 Thread Lyude Paul
turning -EINVAL immediately. Signed-off-by: Lyude Paul Fixes: eceae1472467 ("drm/dp_mst: Start tracking per-port VCPI allocations") Cc: Daniel Vetter Cc: David Airlie Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 3 ++- 1 file changed, 2

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-03-13 Thread Lyude Paul
Fri, 2019-02-15 at 16:17 -0500, Lyude Paul wrote: > On Thu, 2019-02-14 at 18:43 -0600, Bjorn Helgaas wrote: > > Hi Lyude, > > > > On Tue, Feb 12, 2019 at 05:02:30PM -0500, Lyude Paul wrote: > > > On a very specific subset of ThinkPad P50 SKUs, particularly ones t

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

2019-06-03 Thread Lyude Paul
On Thu, 2019-05-30 at 18:20 +, Li, Sun peng (Leo) wrote: > Hey, sorry for my late response! > > On 2019-05-16 5:40 p.m., Lyude Paul wrote: > > > >if (old_pdt != port->pdt && !port->input) { > > > @@ -1220,6 +1268,8 @@ static void dr

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

2019-06-03 Thread Lyude Paul
On Mon, 2019-06-03 at 15:25 -0400, Lyude Paul wrote: > On Thu, 2019-05-30 at 18:20 +, Li, Sun peng (Leo) wrote: > > Hey, sorry for my late response! > > > > On 2019-05-16 5:40 p.m., Lyude Paul wrote: > > > > > >if (old_pdt != port->pdt &am

Re: [PATCH 0/2] drm/nouveau/bios/init: Improve pre-PMU devinit opcode coverage

2019-06-04 Thread Lyude Paul
For the whole series: Reviewed-by: Lyude Paul Tested on a GK104 and GK110 (same ones as my vbios traces in our vbios repo) On Mon, 2019-06-03 at 00:13 +1000, Rhys Kidd wrote: > NVIDIA GPUs include a common scripting language (devinit) that can be > interpreted by a number of "en

Re: [PATCH] drm/nouveau/bios: downgrade absence of tmds table to info from an error

2019-06-04 Thread Lyude Paul
Reviewed-by: Lyude Paul On Sun, 2019-06-02 at 22:07 +1000, Rhys Kidd wrote: > Absence of a TMDS Info Table is common on Optimus setups where the NVIDIA > gpu is not connected directly to any outputs. > > Reporting an error in this scenario is too harsh. Accordingly, change the >

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

2019-06-06 Thread Lyude Paul
On Thu, 2019-06-06 at 19:41 +, Li, Sun peng (Leo) wrote: > > On 2019-06-03 3:28 p.m., Lyude Paul wrote: > > > I'm reproducing this just by reloading i915 on a machine with some MST > > > displays connected. I uploaded a copy of the script that I us

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

2019-06-14 Thread Lyude Paul
ogy.c:2715:2: error: implicit > declaration of function ‘drm_dp_put_port’; did you mean ‘drm_dp_get_port’? > [-Werror=implicit-function-declaration] > > v4.19.50: Build OK! > v4.14.125: Build OK! > v4.9.181: Build OK! > v4.4.181: Build OK! &

[PATCH] drm/amdgpu: Don't skip display settings in hwmgr_resume()

2019-06-20 Thread Lyude Paul
ing setup seems to fix it. Hopefully if there is a better fix for this, this patch will spark discussion around it. Fixes: 921935dc6404 ("drm/amd/powerplay: enforce display related settings only on needed") Cc: Evan Quan Cc: Alex Deucher Cc: Huang Rui Cc: Rex Zhu Cc: Likun Gao Cc:

[PATCH] drm/nouveau: Enable i2c pads & busses during preinit

2019-06-26 Thread Lyude Paul
e this never caused us any issues before! So, fix this by initializing our i2c pad and busses during subdev pre-init. We skip initializing aux busses during pre-init, as those are guaranteed to only ever be used by nouveau for DP aux transactions. Signed-off-by: Lyude Paul Tested-by: Marc Mele

Re: [PATCH v2 1/3] drm: Add helper to compare edids.

2019-07-01 Thread Lyude Paul
ng to determine if > + * edid had changed. > + */ > +bool drm_edid_are_equal(struct edid *edid1, struct edid *edid2); > + > int > drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, >struct drm_connector *connector, -- Cheers, Lyude Paul ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-07-01 Thread Lyude Paul
On Thu, 2019-06-27 at 22:21 +, Li, Sun peng (Leo) wrote: > Sorry for the late response! just jumping back on this now. > > On 2019-05-16 5:40 p.m., Lyude Paul wrote: > > [CAUTION: External Email] > > > > So a couple of things: > > > > On Thu, 2019-0

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-03-19 Thread Lyude Paul
Bump, sorry to bug you but is there any update on this or any information you still need from me which would help get this upstream? On Wed, 2019-03-13 at 18:25 -0400, Lyude Paul wrote: > [note to David Ober: you -should- be able to reply to this, hopefully, but I > haven't actually

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-03-22 Thread Lyude Paul
Note: I did read your response lower down in the thread, but I wanted to make sure I addressed one of the comments here (see below) On Thu, 2019-03-21 at 17:48 -0500, Bjorn Helgaas wrote: > [+cc Rafael] > > On Wed, Mar 13, 2019 at 06:25:02PM -0400, Lyude Paul wrote: > > On Fri, 2

Re: [PATCH] pci/quirks: Add quirk to reset nvgpu at boot for the Lenovo ThinkPad P50

2019-04-03 Thread Lyude Paul
Hi, any update on this/do you guys need any more information here? Would very much like to get this upstream On Fri, 2019-03-22 at 06:30 -0500, Bjorn Helgaas wrote: > On Thu, Mar 21, 2019 at 05:48:19PM -0500, Bjorn Helgaas wrote: > > On Wed, Mar 13, 2019 at 06:25:02PM -0400, Lyude P

[PATCH] drm/nouveau/i2c: Disable i2c bus access after ->fini()

2019-04-03 Thread Lyude Paul
al more difficult than it might seem, mostly due to the fact that we have to use the i2c bus during runtime resume of the GPU, we instead opt for the easiest solution: don't let userspace access i2c busses on the GPU at all while it's in runtime suspend. Signed-off-by: Lyude Paul Cc: sta...@vg

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

2019-07-10 Thread Lyude Paul
msg->reply.u.remote_dpcd_read_ack.num_bytes, > + size); > + memcpy(bytes, txmsg->reply.u.remote_dpcd_read_ack.bytes, ret); > + > +fail_free: > + kfree(txmsg); > +fail_put: > + drm_dp_mst_topology_put_mstb(mstb); > + > + return ret; &g

Re: [Intel-gfx] [RFC][PATCH 0/2] drm: PATH prop for all connectors?

2019-07-10 Thread Lyude Paul
(adding sunpeng...@amd.com to the thread here, since this is relevant to the DP aux device work) I mentioned this in IRC, but figured I should mention it on the ML as well so it can be discussed further. Honestly: I don't like the way we implement the path prop for MST. Mainly because * It looks

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

2019-07-10 Thread Lyude Paul
gah. So, I was originally going to ask "why didn't we add the connector name into this?", but then I realized we're doing the right thing already and just doing card%d-%s % (card_number, path_prop). Which means we probably really don't want to add a property called mstpath, since it's hardly differ

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

2019-07-10 Thread Lyude Paul
On Thu, 2019-07-04 at 15:05 -0400, sunpeng...@amd.com wrote: > 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. > > Althou

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

2019-07-12 Thread Lyude Paul
ate_register = intel_connector_register, > - .early_unregister = intel_connector_unregister, > + .late_register = intel_dp_mst_connector_late_register, > + .early_unregister = intel_dp_mst_connector_early_unregister, > .destroy = intel_connector_destroy, > .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, > .atomic_duplicate_state = intel_digital_connector_duplicate_state, -- Cheers, Lyude Paul ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-07-12 Thread Lyude Paul
erty, > .atomic_get_property = nouveau_conn_atomic_get_property, > + .late_register = nv50_mstc_late_register, > + .early_unregister = nv50_mstc_early_unregister, > }; > > static int -- Cheers, Lyude Paul ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-07-12 Thread Lyude Paul
Reviewed-by: Lyude Paul On Thu, 2019-07-04 at 15:05 -0400, sunpeng...@amd.com wrote: > 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 d

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

2019-07-16 Thread Lyude Paul
On Tue, 2019-07-16 at 18:28 +, Li, Sun peng (Leo) wrote: > > > On 2019-07-10 6:50 p.m., Lyude Paul wrote: > > gah. So, I was originally going to ask "why didn't we add the connector > > name > > into this?", but then I realized we're doing the

[PATCH 10/26] drm/dp_mst: Constify guid in drm_dp_get_mst_branch_by_guid()

2019-07-17 Thread Lyude Paul
And it's helper, we'll be using this in just a moment. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH 11/26] drm/dp_mst: Refactor drm_dp_mst_handle_up_req()

2019-07-17 Thread Lyude Paul
stb != NULL at that point in the function Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 75 ++- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 02/26] drm/dp_mst: Destroy mstbs from destroy_connector_work

2019-07-17 Thread Lyude Paul
fs on MSTBs in any locking context. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 121 +- include/drm/drm_dp_mst_helper.h | 10 +++ 2 files changed, 90 insertions(+), 41

[PATCH 12/26] drm/dp_mst: Refactor drm_dp_mst_handle_down_rep()

2019-07-17 Thread Lyude Paul
* Remove the big ugly have_eomt conditional * Store &mgr->down_rep_recv.initial_hdr in a var to make line wrapping easier * Remove duplicate memset() calls * Actually wrap lines Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/

[PATCH 04/26] drm/print: Add drm_err_printer()

2019-07-17 Thread Lyude Paul
A simple convienence function that returns a drm_printer which prints using pr_err() Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_print.c | 6 ++ include/drm/drm_print.h | 17 + 2 files changed

[PATCH 07/26] drm/dp_mst: Get rid of list clear in drm_dp_finish_destroy_port()

2019-07-17 Thread Lyude Paul
This seems to be some leftover detritus from before the port/mstb kref cleanup and doesn't do anything anymore, so get rid of it. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 2 -- 1 file chang

[PATCH 09/26] drm/dp_mst: Remove huge conditional in drm_dp_mst_handle_up_req()

2019-07-17 Thread Lyude Paul
Which reduces indentation and makes this function more legible. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 90 +-- 1 file changed, 45 insertions(+), 45 deletions(-) diff

[PATCH 13/26] drm/dp_mst: Destroy topology_mgr mutexes

2019-07-17 Thread Lyude Paul
Turns out we've been forgetting for a while now to actually destroy any of the mutexes that we create in drm_dp_mst_topology_mgr. So, let's do that. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topo

[PATCH 01/26] drm/dp_mst: Move link address dumping into a function

2019-07-17 Thread Lyude Paul
Since we're about to be calling this from multiple places. Also it makes things easier to read! Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 35 ++- 1 file change

[PATCH 03/26] drm/dp_mst: Move test_calc_pbn_mode() into an actual selftest

2019-07-17 Thread Lyude Paul
ff-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 27 -- drivers/gpu/drm/selftests/Makefile| 2 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 1 + .../drm/selftests/test-drm_dp_mst_helper.c| 36 +++ .../drm/selftests

[PATCH 05/26] drm/dp_mst: Add sideband down request tracing + selftests

2019-07-17 Thread Lyude Paul
oding as well. Enjoy! Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 308 +- .../gpu/drm/drm_dp_mst_topology_internal.h| 24 ++ .../gpu/drm/selftests/drm_modeset_selftests.h |

[PATCH 06/26] drm/dp_mst: Move PDT teardown for ports into destroy_connector_work

2019-07-17 Thread Lyude Paul
ned-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 42 +++ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index defc5e09fb9a..0295e007c836 100644 --- a/drive

[PATCH 08/26] drm/dp_mst: Refactor drm_dp_send_enum_path_resources

2019-07-17 Thread Lyude Paul
Use more pointers so we don't have to write out txmsg->reply.u.path_resources each time. Also, fix line wrapping + rearrange local variables. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topolog

[PATCH 00/26] DP MST Refactors + debugging tools + suspend/resume reprobing

2019-07-17 Thread Lyude Paul
with some basic selftests for testing our encoding/decoding functions Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Lyude Paul (26): drm/dp_mst: Move link address dumping into a function drm/dp_mst: Destroy mstbs from destroy_connector_work drm/dp_mst: Move test_calc_pbn

[PATCH 14/26] drm/dp_mst: Cleanup drm_dp_send_link_address() a bit

2019-07-17 Thread Lyude Paul
variable declarations a bit. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 42 +++ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topol

[PATCH 18/26] drm/dp_mst: Handle UP requests asynchronously

2019-07-17 Thread Lyude Paul
send sideband messages from most contexts without having to deal with getting blocked if we hold connection_mutex. This also fixes MST branch device hotplugging on i915, finally! Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gp

[PATCH 20/26] drm/dp_mst: Don't forget to update port->input in drm_dp_mst_handle_conn_stat()

2019-07-17 Thread Lyude Paul
ke sure we read the input_port field in connection status notifications in drm_dp_mst_handle_conn_stat() to prevent this from happening once we've implemented suspend/resume reprobing. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers

[PATCH 15/26] drm/dp_mst: Refactor pdt setup/teardown, add more locking

2019-07-17 Thread Lyude Paul
rdown_pdt() into a single function: drm_dp_port_set_pdt(). This function also handles actually ensuring that we grab the correct locks when we need to modify port->mstb. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm

[PATCH 23/26] drm/amdgpu/dm: Resume short HPD IRQs before resuming MST topology

2019-07-17 Thread Lyude Paul
tland Signed-off-by: Lyude Paul --- 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/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 0ef49db0f08d..e33e080cf16d 1

[PATCH 16/26] drm/dp_mst: Rename drm_dp_add_port and drm_dp_update_port

2019-07-17 Thread Lyude Paul
to start using drm_dp_add_port() differently for suspend/resume reprobing, let's rename both functions to clarify what they actually do. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 17 ++---

[PATCH 17/26] drm/dp_mst: Remove lies in {up,down}_rep_recv documentation

2019-07-17 Thread Lyude Paul
These are most certainly accessed from far more than the mgr work. In fact, up_req_recv is -only- ever accessed from outside the mgr work. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- include/drm/drm_dp_mst_helper.h | 8 ++-- 1 file

[PATCH 19/26] drm/dp_mst: Protect drm_dp_mst_port members with connection_mutex

2019-07-17 Thread Lyude Paul
ss responses or connection status notifications under drm_device->mode_config.connection_mutex. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 144 +++--- include/drm/drm_dp_mst_he

[PATCH 22/26] drm/amdgpu: Iterate through DRM connectors correctly

2019-07-17 Thread Lyude Paul
Harry Wentland Signed-off-by: Lyude Paul --- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c| 13 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 20 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c | 40 +-- dr

[PATCH 21/26] drm/nouveau: Don't grab runtime PM refs for HPD IRQs

2019-07-17 Thread Lyude Paul
ng with runtime suspend/resume. Now that those requests are handled asynchronously, this change should be completely safe. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/nouveau_connector.c | 33 +++-- 1 f

[PATCH 24/26] drm/dp_mst: Add basic topology reprobing when resuming

2019-07-17 Thread Lyude Paul
would on a hotplug, removing any leftover ports that no longer appear in the topology state. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/drm_dp_mst_topology.c | 13

[PATCH 25/26] drm/dp_mst: Also print unhashed pointers for malloc/topology references

2019-07-17 Thread Lyude Paul
efully make it a lot easier to figure out which port/mstb is causing KASAN to get upset. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 34 --- 1 file changed, 20 insertions(+), 1

[PATCH 26/26] drm/dp_mst: Add topology ref history tracking for debugging

2019-07-17 Thread Lyude Paul
onfig option to enable or disable this feature, CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS. Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Signed-off-by: Lyude Paul --- drivers/gpu/drm/Kconfig | 14 ++ drivers/gpu/drm/drm_dp_mst_topology.c | 230

[PATCH] drm/amdgpu/dm: Remove unneeded hotplug event in s3_handle_mst()

2019-07-17 Thread Lyude Paul
The DRM DP MST topology manager will send it's own hotplug events when connectors are destroyed, so there's no reason to send an additional hotplug event here. Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 - 1 file changed, 4 insert

[PATCH 0/2] drm/nouveau: i2c over DP AUX fixes

2019-07-25 Thread Lyude Paul
This is another attempt at fixing an issue with yes | sensors-detect Causing some machines with nouveau loaded to hang if certain kinds of displays are attached. I've also included one minor fix that I found along the way of troubleshooting this issue. Lyude Paul (2): drm/nouveau: Fix mi

[PATCH 2/2] drm/nouveau: Don't retry infinitely when receiving no data on i2c over AUX

2019-07-25 Thread Lyude Paul
l the transaction if we continue to not write or receive any data after 32 retries. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c | 24 +-- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/

<    2   3   4   5   6   7   8   9   10   11   >