Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+8 -6
+4 -2
drivers/gpu/drm/i915/display/intel_display.c
··· 713 713 *y += state->view.color_plane[color_plane].y; 714 714 } 715 715 716 - u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv, 716 + u32 intel_plane_fb_max_stride(struct drm_device *drm, 717 717 u32 pixel_format, u64 modifier) 718 718 { 719 + struct intel_display *display = to_intel_display(drm); 720 + struct drm_i915_private *dev_priv = to_i915(drm); 719 721 struct intel_crtc *crtc; 720 722 struct intel_plane *plane; 721 723 722 - if (!HAS_DISPLAY(dev_priv)) 724 + if (!HAS_DISPLAY(display)) 723 725 return 0; 724 726 725 727 /*
+1 -1
drivers/gpu/drm/i915/display/intel_display.h
··· 421 421 int pixel_clock, int link_clock, 422 422 int bw_overhead, 423 423 struct intel_link_m_n *m_n); 424 - u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv, 424 + u32 intel_plane_fb_max_stride(struct drm_device *drm, 425 425 u32 pixel_format, u64 modifier); 426 426 enum drm_mode_status 427 427 intel_mode_valid_max_plane_size(struct drm_i915_private *dev_priv,
+2 -2
drivers/gpu/drm/i915/display/intel_fb.c
··· 1895 1895 */ 1896 1896 if (DISPLAY_VER(dev_priv) < 4 || intel_fb_is_ccs_modifier(modifier) || 1897 1897 intel_fb_modifier_uses_dpt(dev_priv, modifier)) 1898 - return intel_plane_fb_max_stride(dev_priv, pixel_format, modifier); 1898 + return intel_plane_fb_max_stride(&dev_priv->drm, pixel_format, modifier); 1899 1899 else if (DISPLAY_VER(dev_priv) >= 7) 1900 1900 return 256 * 1024; 1901 1901 else ··· 1909 1909 unsigned int tile_width; 1910 1910 1911 1911 if (is_surface_linear(fb, color_plane)) { 1912 - unsigned int max_stride = intel_plane_fb_max_stride(dev_priv, 1912 + unsigned int max_stride = intel_plane_fb_max_stride(&dev_priv->drm, 1913 1913 fb->format->format, 1914 1914 fb->modifier); 1915 1915
+1 -1
drivers/gpu/drm/i915/gem/i915_gem_create.c
··· 193 193 args->pitch = ALIGN(args->width * cpp, 64); 194 194 195 195 /* align stride to page size so that we can remap */ 196 - if (args->pitch > intel_plane_fb_max_stride(to_i915(dev), format, 196 + if (args->pitch > intel_plane_fb_max_stride(dev, format, 197 197 DRM_FORMAT_MOD_LINEAR)) 198 198 args->pitch = ALIGN(args->pitch, 4096); 199 199