diff mbox series

[v5,3/7] drm/i915/display: get old_plane_state to the check_plane routine

Message ID 20250128155418.305595-4-vinod.govindapillai@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/xe3: FBC Dirty rect feature support | expand

Commit Message

Govindapillai, Vinod Jan. 28, 2025, 3:54 p.m. UTC
We are adding support to track and store the plane damage clips
in to plane state as part of plane atomich check routine. This
damage areas could be utilized for FBC dirty rect in xe3. We
would need to use a drm_helper function which generates a merged
damage area from damage clips set from the userspace. But this
helper require old_plane_state being passed as a parameter to it.
Add old_plane_state parameter to the check_plane() and update
all the affected function calls.

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 drivers/gpu/drm/i915/display/i9xx_plane.c          | 1 +
 drivers/gpu/drm/i915/display/intel_atomic_plane.c  | 2 +-
 drivers/gpu/drm/i915/display/intel_cursor.c        | 2 ++
 drivers/gpu/drm/i915/display/intel_display_types.h | 1 +
 drivers/gpu/drm/i915/display/intel_sprite.c        | 2 ++
 drivers/gpu/drm/i915/display/skl_universal_plane.c | 1 +
 6 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c
index ed171fbf8720..840c76050355 100644
--- a/drivers/gpu/drm/i915/display/i9xx_plane.c
+++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
@@ -320,6 +320,7 @@  int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
 
 static int
 i9xx_plane_check(struct intel_crtc_state *crtc_state,
+		 const struct intel_plane_state *old_plane_state,
 		 struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index c558143f4f82..8da7ee13447c 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -616,7 +616,7 @@  int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
 	if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc)
 		return 0;
 
-	ret = plane->check_plane(new_crtc_state, new_plane_state);
+	ret = plane->check_plane(new_crtc_state, old_plane_state, new_plane_state);
 	if (ret)
 		return ret;
 
diff --git a/drivers/gpu/drm/i915/display/intel_cursor.c b/drivers/gpu/drm/i915/display/intel_cursor.c
index 48c3d212f690..0f2a9f29391f 100644
--- a/drivers/gpu/drm/i915/display/intel_cursor.c
+++ b/drivers/gpu/drm/i915/display/intel_cursor.c
@@ -231,6 +231,7 @@  static bool i845_cursor_size_ok(const struct intel_plane_state *plane_state)
 }
 
 static int i845_check_cursor(struct intel_crtc_state *crtc_state,
+			     const struct intel_plane_state *old_plane_state,
 			     struct intel_plane_state *plane_state)
 {
 	const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -470,6 +471,7 @@  static bool i9xx_cursor_size_ok(const struct intel_plane_state *plane_state)
 }
 
 static int i9xx_check_cursor(struct intel_crtc_state *crtc_state,
+			     const struct intel_plane_state *old_plane_state,
 			     struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index cb51b7936f93..bc65c4bd9dc0 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1493,6 +1493,7 @@  struct intel_plane {
 			    const struct intel_crtc_state *crtc_state);
 	bool (*get_hw_state)(struct intel_plane *plane, enum pipe *pipe);
 	int (*check_plane)(struct intel_crtc_state *crtc_state,
+			   const struct intel_plane_state *old_plane_state,
 			   struct intel_plane_state *plane_state);
 	int (*min_cdclk)(const struct intel_crtc_state *crtc_state,
 			 const struct intel_plane_state *plane_state);
diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
index 13996d7059ad..40729ff9338a 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.c
+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
@@ -1321,6 +1321,7 @@  g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
 
 static int
 g4x_sprite_check(struct intel_crtc_state *crtc_state,
+		 const struct intel_plane_state *old_plane_state,
 		 struct intel_plane_state *plane_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
@@ -1389,6 +1390,7 @@  int chv_plane_check_rotation(const struct intel_plane_state *plane_state)
 
 static int
 vlv_sprite_check(struct intel_crtc_state *crtc_state,
+		 const struct intel_plane_state *old_plane_state,
 		 struct intel_plane_state *plane_state)
 {
 	int ret;
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 301ad3a22c4c..8d09a1f8c3e1 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -2250,6 +2250,7 @@  static void check_protection(struct intel_plane_state *plane_state)
 }
 
 static int skl_plane_check(struct intel_crtc_state *crtc_state,
+			   const struct intel_plane_state *old_plane_state,
 			   struct intel_plane_state *plane_state)
 {
 	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);