]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/client: Make copies of modes
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 28 Feb 2025 21:14:50 +0000 (23:14 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Mar 2025 16:32:18 +0000 (18:32 +0200)
commit3039cc0c0653c6e15130a8719c3237329a954670
tree3f6bf4d86349ba6a022db448231f80715a692ed6
parent7640a1c20f144eb933d981102b60080c8114d1d5
drm/client: Make copies of modes

drm_client_firmware_config() is currently picking up the current
mode of the crtc via the legacy crtc->mode, which is not supposed
to be used by atomic drivers at all. We can't simply switch over
to the proper crtc->state->mode because we drop the crtc->mutex
(which protects crtc->state) before the mode gets used.

The most straightforward solution to extend the lifetime of
modes[] seem to be to make full copies of the modes.

And with this we can undo also commit 3eadd887dbac
("drm/client:Fully protect modes[] with dev->mode_config.mutex")
as the lifetime of modes[] no longer has anything to do with
that lock.

v2: Don't try to copy NULL modes
v3: Keep storing pointers and use drm_mode_{duplicate,destroy}()

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250228211454.8138-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/drm_client_modeset.c