[PATCH 12/20] drm/i915/fbc: Extract _intel_fbc_cfb_size()

Ville Syrjala ville.syrjala at linux.intel.com
Fri Jul 5 14:52:46 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Pull the lower level stuff out from intel_fbc_cfb_size() into
a separate function that doesn't depend on the plane_state.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 47b715e5d533..293e1a3b9a9d 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -218,13 +218,18 @@ static unsigned int intel_fbc_max_cfb_height(struct intel_display *display)
 		return 1536;
 }
 
+static unsigned int _intel_fbc_cfb_size(struct intel_display *display,
+					unsigned int height, unsigned int stride)
+{
+	return min(height, intel_fbc_max_cfb_height(display)) * stride;
+}
+
 static unsigned int intel_fbc_cfb_size(const struct intel_plane_state *plane_state)
 {
 	struct intel_display *display = to_intel_display(plane_state->uapi.plane->dev);
 	unsigned int height = drm_rect_height(&plane_state->uapi.src) >> 16;
 
-	return min(height, intel_fbc_max_cfb_height(display)) *
-		intel_fbc_cfb_stride(plane_state);
+	return _intel_fbc_cfb_size(display, height, intel_fbc_cfb_stride(plane_state));
 }
 
 static u16 intel_fbc_override_cfb_stride(const struct intel_plane_state *plane_state)
-- 
2.44.2



More information about the Intel-gfx mailing list