From: Ville Syrjälä Date: Mon, 16 Sep 2024 16:24:10 +0000 (+0300) Subject: drm/i915: Clean up intel_wm_need_update() X-Git-Tag: v6.13-rc1~122^2~19^2~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69aebe7a61ce49895e0352a1d5b5534e07094a46;p=thirdparty%2Fkernel%2Flinux.git drm/i915: Clean up intel_wm_need_update() intel_wm_need_update() is a mess when it comes to variable names and constness. The checks also keep alternating randomly between 'old != cur' vs. 'cur != old'. Clean it all up. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20240916162413.8555-5-ville.syrjala@linux.intel.com Reviewed-by: Vinod Govindapillai --- diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index cf6e9c6bb5fe8..49b5b2c4f2f21 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -393,22 +393,22 @@ void intel_plane_set_invisible(struct intel_crtc_state *crtc_state, } /* FIXME nuke when all wm code is atomic */ -static bool intel_wm_need_update(const struct intel_plane_state *cur, - struct intel_plane_state *new) +static bool intel_wm_need_update(const struct intel_plane_state *old_plane_state, + const struct intel_plane_state *new_plane_state) { /* Update watermarks on tiling or size changes. */ - if (new->uapi.visible != cur->uapi.visible) + if (old_plane_state->uapi.visible != new_plane_state->uapi.visible) return true; - if (!cur->hw.fb || !new->hw.fb) + if (!old_plane_state->hw.fb || !new_plane_state->hw.fb) return false; - if (cur->hw.fb->modifier != new->hw.fb->modifier || - cur->hw.rotation != new->hw.rotation || - drm_rect_width(&new->uapi.src) != drm_rect_width(&cur->uapi.src) || - drm_rect_height(&new->uapi.src) != drm_rect_height(&cur->uapi.src) || - drm_rect_width(&new->uapi.dst) != drm_rect_width(&cur->uapi.dst) || - drm_rect_height(&new->uapi.dst) != drm_rect_height(&cur->uapi.dst)) + if (old_plane_state->hw.fb->modifier != new_plane_state->hw.fb->modifier || + old_plane_state->hw.rotation != new_plane_state->hw.rotation || + drm_rect_width(&old_plane_state->uapi.src) != drm_rect_width(&new_plane_state->uapi.src) || + drm_rect_height(&old_plane_state->uapi.src) != drm_rect_height(&new_plane_state->uapi.src) || + drm_rect_width(&old_plane_state->uapi.dst) != drm_rect_width(&new_plane_state->uapi.dst) || + drm_rect_height(&old_plane_state->uapi.dst) != drm_rect_height(&new_plane_state->uapi.dst)) return true; return false;