Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vc4: Switch to drm_atomic_get_new_crtc_state()

The vc4 atomic_check implementation uses the deprecated
drm_atomic_get_existing_crtc_state() helper.

This hook is called as part of the global atomic_check, thus before the
states are swapped. The existing state thus points to the new state, and
we can use drm_atomic_get_new_crtc_state() instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20250930-drm-no-more-existing-state-v5-32-eeb9e1287907@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+2 -4
+2 -4
drivers/gpu/drm/vc4/vc4_plane.c
··· 497 497 u32 v_subsample = fb->format->vsub; 498 498 int ret; 499 499 500 - crtc_state = drm_atomic_get_existing_crtc_state(state->state, 501 - state->crtc); 500 + crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); 502 501 if (!crtc_state) { 503 502 DRM_DEBUG_KMS("Invalid crtc state\n"); 504 503 return -EINVAL; ··· 874 875 unsigned int vscale_factor; 875 876 876 877 vc4_state = to_vc4_plane_state(state); 877 - crtc_state = drm_atomic_get_existing_crtc_state(state->state, 878 - state->crtc); 878 + crtc_state = drm_atomic_get_new_crtc_state(state->state, state->crtc); 879 879 vrefresh = drm_mode_vrefresh(&crtc_state->adjusted_mode); 880 880 881 881 /* The HVS is able to process 2 pixels/cycle when scaling the source,