Skip to content

drm/amdgpu: Fix incorrect encoder API usages

Lyude Paul amd-gfx dri-devel lkml stable 1 version Applied

Status from this message: Applied. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6drm/amdgpu/dm/mst: Don't create MST topology managers for eDP portsdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+4 -02 replies
2/6drm/amdgpu/dm/mst: Remove unnecessary NULL checkdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+2 -41 reply
3/6drm/amdgpu/dm/mst: Use ->atomic_best_encoderdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+5 -53 replies
4/6drm/amdgpu/dm/mst: Make MST encoders per-CRTC and fix encoder usagedrivers/gpu/drm/amd/amdgpu/amdgpu_mode.h drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +2 more+25 -140 replies
5/6drm/amdgpu/dm/mst: Report possible_crtcs incorrectly, for nowdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+11 -04 replies
6/6drm/encoder: WARN() when adding/removing encoders after device registrationdrivers/gpu/drm/drm_encoder.c+24 -70 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchAlex DeucherHarry Wentland
1/6R-b
2/6R-b
3/6A-b R-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] drm/amdgpu: Fix incorrect encoder API usages

Noticed this while trying to respin my MST suspend/resume patch series. It's not technically possible (at least until someone moves amdgpu away from the deprecated drm_device->driver->{load,unload} hooks) for amdgpu to properly register all of it's encoders before registering with userspace. However, amdgpu also apparently adds and removes encoders along with MST connectors - which is a much bigger issue as userspace applications definitely do not expect this type of behavior.

So, let's fix it and add some WARNs() so new drivers don't accidentally make this mistake in the future.

Lyude Paul (6):
drm/amdgpu/dm/mst: Don't create MST topology managers for eDP ports drm/amdgpu/dm/mst: Remove unnecessary NULL check drm/amdgpu/dm/mst: Use ->atomic_best_encoder drm/amdgpu/dm/mst: Make MST encoders per-CRTC and fix encoder usage drm/amdgpu/dm/mst: Report possible_crtcs incorrectly, for now drm/encoder: WARN() when adding/removing encoders after device
registration

 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h      |  3 ++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 ++++++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h |  1 -
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   | 46 ++++++++++---------
 .../display/amdgpu_dm/amdgpu_dm_mst_types.h   |  3 ++
 drivers/gpu/drm/drm_encoder.c                 | 31 ++++++++++---
 6 files changed, 70 insertions(+), 29 deletions(-)
Signature · 1 line
2.21.0