Re: [PATCH v2 0/3] Cleanup evergreen/si IRQ handling code

2017-05-22 Thread Lyude Paul
On Sat, 2017-05-20 at 13:39 +0200, Christian König wrote: > Am 20.05.2017 um 01:48 schrieb Lyude: > > This is the first part of me going through and cleaning up the IRQ > > handling > > code for radeon, since after taking a look at it the other day > > while trying to > > debug something I

[PATCH 0/4] Backported amdgpu ttm deadlock fixes for 4.14

2017-11-30 Thread Lyude Paul
I haven't gone to see where it started, but as of late a good number of pretty nasty deadlock issues have appeared with the kernel. Easy reproduction recipe on a laptop with i915/amdgpu prime with lockdep enabled: DRI_PRIME=1 glxinfo Additionally, some more race conditions exist that I've

[PATCH 3/4] drm/amdgpu: reserve root PD while releasing it

2017-11-30 Thread Lyude Paul
d-by: Michel Dänzer <michel.daen...@amd.com> Reviewed-by: Alex Deucher <alexander.deuc...@amd.com> Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> Signed-off-by: Lyude Paul <ly...@redhat.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 13 +++-- 1 file ch

Re: radeon_dp_aux_transfer_native: 74 callbacks suppressed

2017-11-06 Thread Lyude Paul
The main reason I added this was because the radeon driver's hotplugging paths for DP do a ton of unnessecary probing, and because the driver usually also checks all connectors every time there's a hotplug (there isn't much of a good reason for this, it's just an old driver) it's not at all

[PATCH] drm/amdgpu: Grab/put runtime PM references in atomic_commit_tail()

2018-06-04 Thread Lyude Paul
new atomic state. Signed-off-by: Lyude Paul --- As a note, I'm not entirely happy with this fix and I wouldn't be surprised if I missed something while looking through amdgpu. So, please don't hesistate to suggest a better fix :). drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +

[PATCH 1/4] drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c

2018-06-25 Thread Lyude Paul
, the type definition for acpi_handle and all of the other acpi headers) doesn't need to be included within the amdgpu_drv struct itself. This follows the example set by amdgpu_atpx_handler.c. Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 40 +- drivers/gpu/drm

[PATCH 3/4] drm/amdgpu: Add amdgpu_atpx_get_dhandle()

2018-06-25 Thread Lyude Paul
Since it seems that some vendors are storing the ATIF ACPI methods under the same handle that ATPX lives under instead of the device's own handle, we're going to need to be able to retrieve this handle later so we can probe for ATIF there. Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd

[PATCH 2/4] drm/amdgpu: s/disp_detetion_ports/disp_detection_ports/

2018-06-25 Thread Lyude Paul
Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index 1ae5ae8c45a4..717cc5a90313 100644

[PATCH 0/4] Fix HPD detection in runtime suspend

2018-06-25 Thread Lyude Paul
Does what it says on the label, more information in the patches Lyude Paul (4): drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c drm/amdgpu: s/disp_detetion_ports/disp_detection_ports/ drm/amdgpu: Add amdgpu_atpx_get_dhandle() drm/amdgpu: Dynamically probe for ATIF handle

[PATCH 4/4] drm/amdgpu: Dynamically probe for ATIF handle

2018-06-25 Thread Lyude Paul
to use for ATIF and using that instead of the device's handle. This fixes HPD detection while in runtime suspend for this ZBook! Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 80 +--- 1 file changed, 59 insertions(+), 21 deletions(-) diff --git

Re: [PATCH] drm/amdgpu: Count disabled CRTCs in commit tail earlier

2018-06-22 Thread Lyude Paul
On Fri, 2018-06-22 at 13:34 -0400, Andrey Grodzovsky wrote: > > On 06/21/2018 04:48 PM, Lyude Paul wrote: > > This fixes a regression I accidentally reduced that was picked up by > > kasan, where we were checking the CRTC atomic states after DRM's helpers > > had alr

[PATCH] drm/amdgpu: Count disabled CRTCs in commit tail earlier

2018-06-21 Thread Lyude Paul
ore their atomic states have been freed, then use that count later to do the appropriate number of RPM puts at the end of the function. Fixes: 97028037a38ae ("drm/amdgpu: Grab/put runtime PM references in atomic_commit_tail()") Signed-off-by: Lyude Paul Cc: Michel Dänzer Reported-by:

Re: [PATCH (repost) 4/5] drm/nouveau: add DisplayPort CEC-Tunneling-over-AUX support

2018-08-20 Thread Lyude Paul
ector->aux.transfer) { With the comments I made about this on patch 1 addressed/resolved: Reviewed-by: Lyude Paul > + drm_dp_cec_unregister_connector(_connector->aux); > drm_dp_aux_unregister(_connector->aux); > + } > kfree(connector); >

Re: [PATCH (repost) 3/5] drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read()

2018-08-20 Thread Lyude Paul
Reviewed-by: Lyude Paul We really need to add support for using this into the MST helpers. A good way to test this would probably be to hook up an aux device to the DP AUX adapters we create for each MST topology On Fri, 2018-08-17 at 16:11 +0200, Hans Verkuil wrote: > From: Hans Verk

Re: [PATCH (repost) 1/5] drm_dp_cec: check that aux has a transfer function

2018-08-20 Thread Lyude Paul
On Fri, 2018-08-17 at 16:11 +0200, Hans Verkuil wrote: > From: Hans Verkuil > > If aux->transfer == NULL, then just return without doing > anything. In that case the function is likely called for > a non-(e)DP connector. > > This never happened for the i915 driver, but the nouveau and amdgpu >

Re: [Nouveau] [PATCH (repost) 2/5] drm_dp_cec: add note about good MegaChips 2900 CEC support

2018-08-20 Thread Lyude Paul
Reviewed-by: Lyude Paul On Fri, 2018-08-17 at 16:11 +0200, Hans Verkuil wrote: > From: Hans Verkuil > > A big problem with DP CEC-Tunneling-over-AUX is that it is tricky > to find adapters with a chipset that supports this AND where the > manufacturer actually connected th

Re: [PATCH (repost) 3/5] drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read()

2018-08-20 Thread Lyude Paul
On Mon, 2018-08-20 at 22:43 +0200, Hans Verkuil wrote: > On 08/20/2018 08:59 PM, Lyude Paul wrote: > > Reviewed-by: Lyude Paul > > > > We really need to add support for using this into the MST helpers. A good > > way to > > test this would probably be to ho

Re: [PATCH (repost) 1/5] drm_dp_cec: check that aux has a transfer function

2018-08-20 Thread Lyude Paul
On Mon, 2018-08-20 at 22:47 +0200, Hans Verkuil wrote: > On 08/20/2018 08:51 PM, Lyude Paul wrote: > > On Fri, 2018-08-17 at 16:11 +0200, Hans Verkuil wrote: > > > From: Hans Verkuil > > > > > > If aux->transfer == NULL, then just return without doing &g

[PATCH v2 0/4] drm/dp_mst: Add DP MST debugfs nodes for all drivers

2018-08-28 Thread Lyude Paul
that got noticed by the kbuild bot in "drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()" Cc: Maarten Lankhorst Cc: Daniel Stone Lyude Paul (4): drm/debugfs: Add support for dynamic debugfs initialization drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_in

[PATCH v2 2/4] drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()

2018-08-28 Thread Lyude Paul
with userspace which happens after debugfs init. So, just pass the entire drm_connector struct instead of just its id. Signed-off-by: Lyude Paul --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c| 2 +- drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++ drivers/gpu/drm/i915

[PATCH 0/4] drm/dp_mst: Add DP MST debugfs nodes for all drivers

2018-08-27 Thread Lyude Paul
This is the next version of my patch series for teaching DRM how to automatically create debugfs nodes for drivers with MST topologies. This was originally intended just for nouveau, but has since been expanded to all DRM drivers. Cc: Maarten Lankhorst Cc: Daniel Stone Lyude Paul (4): drm

[PATCH 2/4] drm/dp_mst: Pass entire connector to drm_dp_mst_topology_mgr_init()

2018-08-27 Thread Lyude Paul
with userspace which happens after debugfs init. So, just pass the entire drm_connector struct instead of just it's id. Signed-off-by: Lyude Paul --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- drivers/gpu/drm/drm_dp_mst_topology.c | 8 +--- drivers/gpu/drm/i915

[PATCH v7 05/10] drm/dp_mst: Make drm_dp_mst_topology_state subclassable

2018-04-11 Thread Lyude Paul
. Signed-off-by: Lyude Paul <ly...@redhat.com> Cc: Manasi Navare <manasi.d.nav...@intel.com> Cc: Ville Syrjälä <ville.syrj...@linux.intel.com> V7: - Fix CHECKPATCH errors Signed-off-by: Lyude Paul <ly...@redhat.com> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |

[PATCH v7 00/10] drm/i915: Implement proper fallback training for MST

2018-04-11 Thread Lyude Paul
Next version of https://patchwork.freedesktop.org/series/41576/ All changes in this patch series are just to make checkpatch a little happier, no functional changes. Lyude Paul (10): drm/atomic: Print debug message on atomic check failure drm/i915: Move DP modeset retry work into intel_dp

[PATCH v6 05/10] drm/dp_mst: Make drm_dp_mst_topology_state subclassable

2018-04-11 Thread Lyude Paul
. Signed-off-by: Lyude Paul <ly...@redhat.com> Cc: Manasi Navare <manasi.d.nav...@intel.com> Cc: Ville Syrjälä <ville.syrj...@linux.intel.com> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 +++- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c| 35 +++- .../amd

[PATCH v6 00/10] drm/i915: Implement proper fallback training for MST

2018-04-11 Thread Lyude Paul
Latest version of PW series 39642, hopefully this should also actually come up on intel-gfx and go through CI. No changes other than rebasing to the current drm-intel-next-queued Lyude Paul (10): drm/atomic: Print debug message on atomic check failure drm/i915: Move DP modeset retry work

[PATCH v8 05/10] drm/dp_mst: Make drm_dp_mst_topology_state subclassable

2018-04-11 Thread Lyude Paul
. Signed-off-by: Lyude Paul <ly...@redhat.com> Cc: Manasi Navare <manasi.d.nav...@intel.com> Cc: Ville Syrjälä <ville.syrj...@linux.intel.com> V7: - Fix CHECKPATCH errors --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 +++- .../amd/display/amdgpu_dm/amdgpu_dm_m

[PATCH v8 00/10] drm/i915: Implement proper fallback training for MST

2018-04-11 Thread Lyude Paul
Next version of https://patchwork.freedesktop.org/series/41576/ Only changes are removing duplicate SoBs that git send-email annoyingly added. Sorry about that :( Lyude Paul (10): drm/atomic: Print debug message on atomic check failure drm/i915: Move DP modeset retry work into intel_dp drm

[PATCH v5 00/10] Implement proper MST fallback retraining in i915

2018-04-02 Thread Lyude Paul
Latest version of https://patchwork.freedesktop.org/series/39642/ , hopefully patchwork understands this and doesn't break anything! Lots of changes. Lyude Paul (10): drm/atomic: Print debug message on atomic check failure drm/i915: Move DP modeset retry work into intel_dp drm/dp_mst: Fix

[PATCH v5 05/10] drm/dp_mst: Make drm_dp_mst_topology_state subclassable

2018-04-02 Thread Lyude Paul
. Signed-off-by: Lyude Paul <ly...@redhat.com> Cc: Manasi Navare <manasi.d.nav...@intel.com> Cc: Ville Syrjälä <ville.syrj...@linux.intel.com> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 +++- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c| 35 +++- .../amd

[PATCH v2 3/4] drm/amdgpu: Add amdgpu_atpx_get_dhandle()

2018-06-28 Thread Lyude Paul
adding some functions to retrieve said namespace so it can be searched later for ATIF. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 6 ++ 2 files changed, 12 insertions

[PATCH v2 4/4] drm/amdgpu: Dynamically probe for ATIF handle

2018-06-28 Thread Lyude Paul
to the proper handle to use for ATIF and using that instead of the device's handle. This fixes HPD detection while in runtime suspend for this ZBook! Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 80 +--- 1 file changed, 59

[PATCH v2 1/4] drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c

2018-06-28 Thread Lyude Paul
, the type definition for acpi_handle and all of the other acpi headers) doesn't need to be included within the amdgpu_drv struct itself. This follows the example set by amdgpu_atpx_handler.c. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 40

[PATCH v2 2/4] drm/amdgpu: s/disp_detetion_ports/disp_detection_ports/

2018-06-28 Thread Lyude Paul
Reviewed-by: Jim Qu Signed-off-by: Lyude Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index daa06e7c5bb7

[PATCH v2 0/4] Fix HPD detection in runtime suspend

2018-06-28 Thread Lyude Paul
Next version of https://patchwork.freedesktop.org/series/45371/ Notable changes: - Added explanation on why ATIF handle sometimes lives in a different namespace (thanks Alex!) Lyude Paul (4): drm/amdgpu: Make struct amdgpu_atif private to amdgpu_acpi.c drm/amdgpu: s/disp_detetion_ports

Re: [PATCH 2/2] drm/amd/display: Drop reusing drm connector for MST

2018-11-01 Thread Lyude Paul
+ drm_connector_unregister(connector); > + if (adev->mode_info.rfbdev) > + drm_fb_helper_remove_one_connector(>mode_info.rfbdev- > >helper, connector); > + drm_connector_unreference(connector); This should be drm_connector_put(), drm_connector_unreference

Re: [PATCH 1/2] drm/amd/display: Cleanup MST non-atomic code workaround

2018-11-01 Thread Lyude Paul
This patch is Reviewed-by: Lyude Paul On Tue, 2018-10-30 at 18:09 -0400, Jerry (Fangzhi) Zuo wrote: > [why] > It is not correct to touch aconnector within atomic_check. > > [How] > It was added as workaround before, and no longer needed. > > Signed-off-by

[PATCH] drm/amd/amdgpu/dm: Fix dm_dp_create_fake_mst_encoder()

2018-11-01 Thread Lyude Paul
how] Since this code isn't used anywhere and seems useless anyway, we can just drop it entirely. This appears to fix the issue on my HP ZBook with an AMD WX4150. Signed-off-by: Lyude Paul --- Hey! This is the patch that I was talking about, feel free to review it-we should make sure this goes in wit

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

2018-09-19 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 v2 0/6] Fix legacy DPMS changes with MST

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

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

2018-09-19 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 v2 5/6] drm/i915: Fix intel_dp_mst_best_encoder()

2018-09-19 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 v2 4/6] drm/i915: Skip vcpi allocation for MSTB ports that are gone

2018-09-19 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 v2 2/6] drm/nouveau: Unbreak nv50_mstc->best_encoder()

2018-09-19 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 v2 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()

2018-09-19 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. Changes since v1: - Use list_for_each_entry_safe in drm_dp_mst_connector_still_exists() - Julia Lawall Signed-off-by: Lyude Paul Cc:

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

2018-09-19 Thread Lyude Paul
drm_dp_mst_connector_atomic_check() > > CC: kbuild-...@01.org > In-Reply-To: <20180918230637.20700-2-ly...@redhat.com> > References: <20180918230637.20700-2-ly...@redhat.com> > TO: Lyude Paul > CC: dri-de...@lists.freedesktop.org, nouv...@lists.freedesktop.org, &

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

2018-09-21 Thread Lyude Paul
On Fri, 2018-09-21 at 11:27 +0200, Daniel Vetter wrote: > On Tue, Sep 18, 2018 at 07:06:19PM -0400, Lyude Paul wrote: > > Currently we set intel_connector->mst_port to NULL to signify that the > > MST port has been removed from the system so that we can prevent further >

[PATCH] drm/amdgpu: Suppress keypresses from ACPI_VIDEO events

2018-09-21 Thread Lyude Paul
to be propogated to userspace. This is the equivalent of someone pressing the display key on a laptop every time there's a hotplug event. So, check for ACPI_VIDEO_NOTIFY_PROBE events and suppress keypresses from them. Signed-off-by: Lyude Paul Cc: sta...@vger.kernel.org --- drivers/gpu/drm/amd

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

[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

[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

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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

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

[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

[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

[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

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

[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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

[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

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

[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

[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

[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

[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

  1   2   3   4   5   6   7   >