Commit 4d722029 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915/fbc: Extract _intel_fbc_cfb_size()

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240705145254.3355-13-ville.syrjala@linux.intel.comReviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
parent f89d7664
......@@ -217,13 +217,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment