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

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/fb: make intel_fb_bo.c less dependent on display

intel_fb_bo.c is i915 core specific code, and should use struct
drm_i915_private instead of struct intel_display.

Switch one DISPLAY_VER() to GRAPHICS_VER(). The check is for < 4, where
they're effectively the same thing.

Reviewed-by: Suraj Kandpal@intel.com>
Link: https://patch.msgid.link/13087bd24bd5af5265ca6af67f086b93e26e311f.1773238670.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+6 -8
+6 -8
drivers/gpu/drm/i915/display/intel_fb_bo.c
··· 9 9 #include "gem/i915_gem_object.h" 10 10 11 11 #include "i915_drv.h" 12 - #include "intel_display_core.h" 13 - #include "intel_display_types.h" 14 12 #include "intel_fb.h" 15 13 #include "intel_fb_bo.h" 16 14 ··· 21 23 struct drm_mode_fb_cmd2 *mode_cmd) 22 24 { 23 25 struct drm_i915_gem_object *obj = to_intel_bo(_obj); 24 - struct intel_display *display = to_intel_display(obj->base.dev); 26 + struct drm_i915_private *i915 = to_i915(obj->base.dev); 25 27 unsigned int tiling, stride; 26 28 27 29 i915_gem_object_lock(obj, NULL); ··· 36 38 */ 37 39 if (tiling != I915_TILING_NONE && 38 40 tiling != intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) { 39 - drm_dbg_kms(display->drm, 41 + drm_dbg_kms(&i915->drm, 40 42 "tiling_mode doesn't match fb modifier\n"); 41 43 return -EINVAL; 42 44 } ··· 44 46 if (tiling == I915_TILING_X) { 45 47 mode_cmd->modifier[0] = I915_FORMAT_MOD_X_TILED; 46 48 } else if (tiling == I915_TILING_Y) { 47 - drm_dbg_kms(display->drm, 49 + drm_dbg_kms(&i915->drm, 48 50 "No Y tiling for legacy addfb\n"); 49 51 return -EINVAL; 50 52 } ··· 54 56 * gen2/3 display engine uses the fence if present, 55 57 * so the tiling mode must match the fb modifier exactly. 56 58 */ 57 - if (DISPLAY_VER(display) < 4 && 59 + if (GRAPHICS_VER(i915) < 4 && 58 60 tiling != intel_fb_modifier_to_tiling(mode_cmd->modifier[0])) { 59 - drm_dbg_kms(display->drm, 61 + drm_dbg_kms(&i915->drm, 60 62 "tiling_mode must match fb modifier exactly on gen2/3\n"); 61 63 return -EINVAL; 62 64 } ··· 66 68 * the fb pitch and fence stride match. 67 69 */ 68 70 if (tiling != I915_TILING_NONE && mode_cmd->pitches[0] != stride) { 69 - drm_dbg_kms(display->drm, 71 + drm_dbg_kms(&i915->drm, 70 72 "pitch (%d) must match tiling stride (%d)\n", 71 73 mode_cmd->pitches[0], stride); 72 74 return -EINVAL;