All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/amd/display: Keep eDP native timing after resume with video=
@ 2026-10-14 22:30 Hugo Sales
  2026-10-14 22:30 ` [PATCH 1/2] drm/amd/display: Fall back to the native mode, not the first, on eDP/LVDS Hugo Sales
  2026-10-14 22:30 ` [PATCH 2/2] drm/amd/display: Add KUnit tests for the eDP/LVDS native mode fallback Hugo Sales
  0 siblings, 2 replies; 6+ messages in thread
From: Hugo Sales @ 2026-10-14 22:30 UTC (permalink / raw)
  To: amd-gfx
  Cc: dri-devel, linux-kernel, harry.wentland, sunpeng.li, siqueira,
	alexander.deucher, Hugo Sales

On a 3840x2400 eDP panel booted with video=eDP-1:1920x1200@60, an HDMI
hotplug followed by suspend/resume brings the panel back with the
1920x1200 mode as its raw timing. The image ends up squeezed into the
top-left corner. Photos, hardware details and the test loop are in
https://gitlab.freedesktop.org/drm/amd/-/issues/5983

The hotplug makes fbdev emulation reprobe every connector with its
framebuffer size as the limit, so connector->modes loses the 3840x2400
mode. On resume, create_stream_for_sink() finds no preferred mode in the
list and scales onto the first mode instead. Patch 1 falls back to the
encoder's native_mode, which amdgpu_dm_get_native_mode() copies from the
preferred mode before the size limits apply. Patch 2 adds KUnit tests
for it

The fallback only applies to eDP and LVDS, where amdgpu turns scaling on
by itself. On other connectors the preferred mode can also be missing
because mode_valid rejected it, and then scaling onto the first valid
mode is right. Those connectors still hit this bug when userspace sets
the scaling mode property, which this series doesn't fix

A fuller amdgpu fix would always take the eDP and LVDS native timing
from the encoder, and search connector->modes only when the encoder has
none. I kept this to a fallback so it changes less, but I can respin it
that way if you'd prefer

On amd-staging-drm-next, with an HDMI hotplug and suspend/resume
(pm_test=platform) in a loop, 28 of 29 resumes came back with the wrong
timing without the patch, and the other showed it briefly. With it, 169
of 169 were fine. A backport to 7.2.8 went from 103 of 103 bad to 1363
of 1363 good. The new KUnit tests fail without the fix, and the
connector suite passes, apart from dm_test_fs_caps_hdmi_vsdb and
dm_test_fs_caps_pcon_whitelist, which already fail on this tree

The cause could also be fixed in DRM core, for every connector, by
making drm_client_modeset_probe() probe with the device's limits and
apply the framebuffer size only when fbdev picks its own mode. That
touches more shared code, since fbdev's other mode pickers would then
need size checks too

Hugo Sales (2):
  drm/amd/display: Fall back to the native mode, not the first, on
    eDP/LVDS
  drm/amd/display: Add KUnit tests for the eDP/LVDS native mode fallback

 .../display/amdgpu_dm/amdgpu_dm_connector.c   |  28 +++++
 .../tests/amdgpu_dm_connector_test.c          | 112 ++++++++++++++++++
 2 files changed, 140 insertions(+)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-15  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 22:30 [PATCH 0/2] drm/amd/display: Keep eDP native timing after resume with video= Hugo Sales
2026-10-14 22:30 ` [PATCH 1/2] drm/amd/display: Fall back to the native mode, not the first, on eDP/LVDS Hugo Sales
2026-10-14 22:39   ` sashiko-bot
2026-10-14 22:52     ` Hugo Sales
2026-10-14 22:30 ` [PATCH 2/2] drm/amd/display: Add KUnit tests for the eDP/LVDS native mode fallback Hugo Sales
2026-10-14 22:44   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.