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, xe}/stolen: convert stolen interface to struct drm_device

Make the stolen interface agnostic to i915/xe, and pass struct
drm_device instead.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/bbfc2aeaeee3156e92d49c73983be05b6feeede2.1758732183.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+25 -21
+5 -8
drivers/gpu/drm/i915/display/intel_fbc.c
··· 377 377 static void i8xx_fbc_program_cfb(struct intel_fbc *fbc) 378 378 { 379 379 struct intel_display *display = fbc->display; 380 - struct drm_i915_private *i915 = to_i915(display->drm); 381 380 382 381 drm_WARN_ON(display->drm, 383 - range_end_overflows_t(u64, i915_gem_stolen_area_address(i915), 382 + range_end_overflows_t(u64, i915_gem_stolen_area_address(display->drm), 384 383 i915_gem_stolen_node_offset(fbc->compressed_fb), 385 384 U32_MAX)); 386 385 drm_WARN_ON(display->drm, 387 - range_end_overflows_t(u64, i915_gem_stolen_area_address(i915), 386 + range_end_overflows_t(u64, i915_gem_stolen_area_address(display->drm), 388 387 i915_gem_stolen_node_offset(fbc->compressed_llb), 389 388 U32_MAX)); 390 389 intel_de_write(display, FBC_CFB_BASE, ··· 797 798 798 799 static u64 intel_fbc_stolen_end(struct intel_display *display) 799 800 { 800 - struct drm_i915_private *i915 = to_i915(display->drm); 801 801 u64 end; 802 802 803 803 /* The FBC hardware for BDW/SKL doesn't have access to the stolen ··· 805 807 * underruns, even if that range is not reserved by the BIOS. */ 806 808 if (display->platform.broadwell || 807 809 (DISPLAY_VER(display) == 9 && !display->platform.broxton)) 808 - end = i915_gem_stolen_area_size(i915) - 8 * 1024 * 1024; 810 + end = i915_gem_stolen_area_size(display->drm) - 8 * 1024 * 1024; 809 811 else 810 812 end = U64_MAX; 811 813 ··· 859 861 unsigned int size, int min_limit) 860 862 { 861 863 struct intel_display *display = fbc->display; 862 - struct drm_i915_private *i915 = to_i915(display->drm); 863 864 int ret; 864 865 865 866 drm_WARN_ON(display->drm, ··· 890 893 if (i915_gem_stolen_node_allocated(fbc->compressed_llb)) 891 894 i915_gem_stolen_remove_node(fbc->compressed_llb); 892 895 err: 893 - if (i915_gem_stolen_initialized(i915)) 896 + if (i915_gem_stolen_initialized(display->drm)) 894 897 drm_info_once(display->drm, 895 898 "not enough stolen space for compressed buffer (need %d more bytes), disabling. Hint: you may be able to increase stolen memory size in the BIOS to avoid this.\n", size); 896 899 return -ENOSPC; ··· 1432 1435 if (!fbc) 1433 1436 return 0; 1434 1437 1435 - if (!i915_gem_stolen_initialized(i915)) { 1438 + if (!i915_gem_stolen_initialized(display->drm)) { 1436 1439 plane_state->no_fbc_reason = "stolen memory not initialised"; 1437 1440 return 0; 1438 1441 }
+9 -3
drivers/gpu/drm/i915/gem/i915_gem_stolen.c
··· 1024 1024 return obj->ops == &i915_gem_object_stolen_ops; 1025 1025 } 1026 1026 1027 - bool i915_gem_stolen_initialized(const struct drm_i915_private *i915) 1027 + bool i915_gem_stolen_initialized(struct drm_device *drm) 1028 1028 { 1029 + struct drm_i915_private *i915 = to_i915(drm); 1030 + 1029 1031 return drm_mm_initialized(&i915->mm.stolen); 1030 1032 } 1031 1033 1032 - u64 i915_gem_stolen_area_address(const struct drm_i915_private *i915) 1034 + u64 i915_gem_stolen_area_address(struct drm_device *drm) 1033 1035 { 1036 + struct drm_i915_private *i915 = to_i915(drm); 1037 + 1034 1038 return i915->dsm.stolen.start; 1035 1039 } 1036 1040 1037 - u64 i915_gem_stolen_area_size(const struct drm_i915_private *i915) 1041 + u64 i915_gem_stolen_area_size(struct drm_device *drm) 1038 1042 { 1043 + struct drm_i915_private *i915 = to_i915(drm); 1044 + 1039 1045 return resource_size(&i915->dsm.stolen); 1040 1046 } 1041 1047
+3 -3
drivers/gpu/drm/i915/gem/i915_gem_stolen.h
··· 34 34 35 35 #define I915_GEM_STOLEN_BIAS SZ_128K 36 36 37 - bool i915_gem_stolen_initialized(const struct drm_i915_private *i915); 38 - u64 i915_gem_stolen_area_address(const struct drm_i915_private *i915); 39 - u64 i915_gem_stolen_area_size(const struct drm_i915_private *i915); 37 + bool i915_gem_stolen_initialized(struct drm_device *drm); 38 + u64 i915_gem_stolen_area_address(struct drm_device *drm); 39 + u64 i915_gem_stolen_area_size(struct drm_device *drm); 40 40 41 41 u64 i915_gem_stolen_node_address(const struct intel_stolen_node *node); 42 42
+3 -4
drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
··· 10 10 11 11 struct drm_device; 12 12 struct intel_stolen_node; 13 - struct xe_device; 14 13 15 14 int i915_gem_stolen_insert_node_in_range(struct intel_stolen_node *node, 16 15 u32 size, u32 align, ··· 19 20 20 21 void i915_gem_stolen_remove_node(struct intel_stolen_node *node); 21 22 22 - bool i915_gem_stolen_initialized(struct xe_device *xe); 23 + bool i915_gem_stolen_initialized(struct drm_device *drm); 23 24 24 25 bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node); 25 26 26 27 u32 i915_gem_stolen_node_offset(struct intel_stolen_node *node); 27 28 28 - u64 i915_gem_stolen_area_address(const struct xe_device *xe); 29 + u64 i915_gem_stolen_area_address(struct drm_device *drm); 29 30 30 - u64 i915_gem_stolen_area_size(const struct xe_device *xe); 31 + u64 i915_gem_stolen_area_size(struct drm_device *drm); 31 32 32 33 u64 i915_gem_stolen_node_address(struct intel_stolen_node *node); 33 34
+5 -3
drivers/gpu/drm/xe/display/xe_stolen.c
··· 56 56 node->bo = NULL; 57 57 } 58 58 59 - bool i915_gem_stolen_initialized(struct xe_device *xe) 59 + bool i915_gem_stolen_initialized(struct drm_device *drm) 60 60 { 61 + struct xe_device *xe = to_xe_device(drm); 62 + 61 63 return ttm_manager_type(&xe->ttm, XE_PL_STOLEN); 62 64 } 63 65 ··· 77 75 } 78 76 79 77 /* Used for < gen4. These are not supported by Xe */ 80 - u64 i915_gem_stolen_area_address(const struct xe_device *xe) 78 + u64 i915_gem_stolen_area_address(struct drm_device *drm) 81 79 { 82 80 WARN_ON(1); 83 81 ··· 85 83 } 86 84 87 85 /* Used for gen9 specific WA. Gen9 is not supported by Xe */ 88 - u64 i915_gem_stolen_area_size(const struct xe_device *xe) 86 + u64 i915_gem_stolen_area_size(struct drm_device *drm) 89 87 { 90 88 WARN_ON(1); 91 89