Commit 01e15756 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Don't pass crtc_state to foo_plane_ctl() & co.



The *_plane_ctl() functions only consider the state of the
plane (the state of the crtc is handled by the corresponding
*_plane_ctl_crtc()), and thus they don't need the crtc_state
at all. Don't pass it in.

Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250717171353.23090-7-ville.syrjala@linux.intel.com
parent a9298b3b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -155,8 +155,7 @@ static bool i9xx_plane_has_windowing(struct intel_plane *plane)
			i9xx_plane == PLANE_C;
}

static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
static u32 i9xx_plane_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -355,7 +354,7 @@ i9xx_plane_check(struct intel_crtc_state *crtc_state,
	if (ret)
		return ret;

	plane_state->ctl = i9xx_plane_ctl(crtc_state, plane_state);
	plane_state->ctl = i9xx_plane_ctl(plane_state);

	return 0;
}
+4 −6
Original line number Diff line number Diff line
@@ -205,8 +205,7 @@ static u32 i845_cursor_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return cntl;
}

static u32 i845_cursor_ctl(const struct intel_crtc_state *crtc_state,
			   const struct intel_plane_state *plane_state)
static u32 i845_cursor_ctl(const struct intel_plane_state *plane_state)
{
	return CURSOR_ENABLE |
		CURSOR_FORMAT_ARGB |
@@ -266,7 +265,7 @@ static int i845_check_cursor(struct intel_crtc_state *crtc_state,
		return -EINVAL;
	}

	plane_state->ctl = i845_cursor_ctl(crtc_state, plane_state);
	plane_state->ctl = i845_cursor_ctl(plane_state);

	return 0;
}
@@ -398,8 +397,7 @@ static u32 i9xx_cursor_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return cntl;
}

static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
			   const struct intel_plane_state *plane_state)
static u32 i9xx_cursor_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	u32 cntl = 0;
@@ -526,7 +524,7 @@ static int i9xx_check_cursor(struct intel_crtc_state *crtc_state,
		return -EINVAL;
	}

	plane_state->ctl = i9xx_cursor_ctl(crtc_state, plane_state);
	plane_state->ctl = i9xx_cursor_ctl(plane_state);

	return 0;
}
+6 −9
Original line number Diff line number Diff line
@@ -264,8 +264,7 @@ static u32 vlv_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return sprctl;
}

static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
static u32 vlv_sprite_ctl(const struct intel_plane_state *plane_state)
{
	const struct drm_framebuffer *fb = plane_state->hw.fb;
	unsigned int rotation = plane_state->hw.rotation;
@@ -660,8 +659,7 @@ static bool ivb_need_sprite_gamma(const struct intel_plane_state *plane_state)
		(display->platform.ivybridge || display->platform.haswell);
}

static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
static u32 ivb_sprite_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1010,8 +1008,7 @@ static u32 g4x_sprite_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return dvscntr;
}

static u32 g4x_sprite_ctl(const struct intel_crtc_state *crtc_state,
			  const struct intel_plane_state *plane_state)
static u32 g4x_sprite_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1378,9 +1375,9 @@ g4x_sprite_check(struct intel_crtc_state *crtc_state,
		return ret;

	if (DISPLAY_VER(display) >= 7)
		plane_state->ctl = ivb_sprite_ctl(crtc_state, plane_state);
		plane_state->ctl = ivb_sprite_ctl(plane_state);
	else
		plane_state->ctl = g4x_sprite_ctl(crtc_state, plane_state);
		plane_state->ctl = g4x_sprite_ctl(plane_state);

	return 0;
}
@@ -1430,7 +1427,7 @@ vlv_sprite_check(struct intel_crtc_state *crtc_state,
	if (ret)
		return ret;

	plane_state->ctl = vlv_sprite_ctl(crtc_state, plane_state);
	plane_state->ctl = vlv_sprite_ctl(plane_state);

	return 0;
}
+4 −7
Original line number Diff line number Diff line
@@ -1166,8 +1166,7 @@ static u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return plane_ctl;
}

static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
			 const struct intel_plane_state *plane_state)
static u32 skl_plane_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1225,8 +1224,7 @@ static u32 glk_plane_color_ctl_crtc(const struct intel_crtc_state *crtc_state)
	return plane_color_ctl;
}

static u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
			       const struct intel_plane_state *plane_state)
static u32 glk_plane_color_ctl(const struct intel_plane_state *plane_state)
{
	struct intel_display *display = to_intel_display(plane_state);
	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -2355,11 +2353,10 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
		plane_state->damage = DRM_RECT_INIT(0, 0, 0, 0);
	}

	plane_state->ctl = skl_plane_ctl(crtc_state, plane_state);
	plane_state->ctl = skl_plane_ctl(plane_state);

	if (DISPLAY_VER(display) >= 10)
		plane_state->color_ctl = glk_plane_color_ctl(crtc_state,
							     plane_state);
		plane_state->color_ctl = glk_plane_color_ctl(plane_state);

	if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier) &&
	    icl_is_hdr_plane(display, plane->id))