drm/i915: Pass drm_format_info into plane->max_stride()

Pass the format info into plane->max_stride() from the
caller instead of doing yet another drm_format_info()
lookup on the spot.

drm_format_info() is both rather expensive, and technically
incorrect since it doesn't return the correct format info
for compressed formats (though that doesn't actually matter
for the current .max_stride() implementations since they
are just interested in the cpp value).

Most callers already have the format info available. The
only exception is intel_dumb_fb_max_stride() where we shall
use the actually correct drm_get_format_info() variant.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251107181126.5743-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Ville Syrjälä
2025-11-07 20:11:19 +02:00
parent 854efdc7ef
commit 95357b68b6
9 changed files with 47 additions and 47 deletions

View File

@@ -548,7 +548,8 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
}
u32 intel_plane_fb_max_stride(struct intel_display *display,
u32 pixel_format, u64 modifier)
const struct drm_format_info *info,
u64 modifier)
{
struct intel_crtc *crtc;
struct intel_plane *plane;
@@ -564,7 +565,7 @@ u32 intel_plane_fb_max_stride(struct intel_display *display,
plane = to_intel_plane(crtc->base.primary);
return plane->max_stride(plane, pixel_format, modifier,
return plane->max_stride(plane, info, modifier,
DRM_MODE_ROTATE_0);
}
@@ -576,7 +577,9 @@ u32 intel_dumb_fb_max_stride(struct drm_device *drm,
if (!HAS_DISPLAY(display))
return 0;
return intel_plane_fb_max_stride(display, pixel_format, modifier);
return intel_plane_fb_max_stride(display,
drm_get_format_info(drm, pixel_format, modifier),
modifier);
}
void intel_set_plane_visible(struct intel_crtc_state *crtc_state,