mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-12 01:20:14 +00:00
drm/i915: Decouple i915_gem_dumb_create() from the display a bit
Pass the device argument as drm_device to intel_plane_fb_max_stride() to decouple i915_gem_dumb_create() vs. the display code a bit. xe currently doesn't even call this, but it probably should... v2: s/dev/drm/ (Jani) Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250206185533.32306-3-ville.syrjala@linux.intel.com
This commit is contained in:
parent
3eb1b39820
commit
2bb9476795
@ -713,13 +713,15 @@ void intel_add_fb_offsets(int *x, int *y,
|
||||
*y += state->view.color_plane[color_plane].y;
|
||||
}
|
||||
|
||||
u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
|
||||
u32 intel_plane_fb_max_stride(struct drm_device *drm,
|
||||
u32 pixel_format, u64 modifier)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(drm);
|
||||
struct drm_i915_private *dev_priv = to_i915(drm);
|
||||
struct intel_crtc *crtc;
|
||||
struct intel_plane *plane;
|
||||
|
||||
if (!HAS_DISPLAY(dev_priv))
|
||||
if (!HAS_DISPLAY(display))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
||||
@ -421,7 +421,7 @@ void intel_link_compute_m_n(u16 bpp, int nlanes,
|
||||
int pixel_clock, int link_clock,
|
||||
int bw_overhead,
|
||||
struct intel_link_m_n *m_n);
|
||||
u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
|
||||
u32 intel_plane_fb_max_stride(struct drm_device *drm,
|
||||
u32 pixel_format, u64 modifier);
|
||||
enum drm_mode_status
|
||||
intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,
|
||||
|
||||
@ -1895,7 +1895,7 @@ u32 intel_fb_max_stride(struct drm_i915_private *dev_priv,
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) < 4 || intel_fb_is_ccs_modifier(modifier) ||
|
||||
intel_fb_modifier_uses_dpt(dev_priv, modifier))
|
||||
return intel_plane_fb_max_stride(dev_priv, pixel_format, modifier);
|
||||
return intel_plane_fb_max_stride(&dev_priv->drm, pixel_format, modifier);
|
||||
else if (DISPLAY_VER(dev_priv) >= 7)
|
||||
return 256 * 1024;
|
||||
else
|
||||
@ -1909,7 +1909,7 @@ intel_fb_stride_alignment(const struct drm_framebuffer *fb, int color_plane)
|
||||
unsigned int tile_width;
|
||||
|
||||
if (is_surface_linear(fb, color_plane)) {
|
||||
unsigned int max_stride = intel_plane_fb_max_stride(dev_priv,
|
||||
unsigned int max_stride = intel_plane_fb_max_stride(&dev_priv->drm,
|
||||
fb->format->format,
|
||||
fb->modifier);
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ i915_gem_dumb_create(struct drm_file *file,
|
||||
args->pitch = ALIGN(args->width * cpp, 64);
|
||||
|
||||
/* align stride to page size so that we can remap */
|
||||
if (args->pitch > intel_plane_fb_max_stride(to_i915(dev), format,
|
||||
if (args->pitch > intel_plane_fb_max_stride(dev, format,
|
||||
DRM_FORMAT_MOD_LINEAR))
|
||||
args->pitch = ALIGN(args->pitch, 4096);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user