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/xe/stolen: convert compat stolen macros to inline functions

Improve type safety. Allows getting rid of a __maybe_unused annotation
too.

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

+34 -9
+1 -1
drivers/gpu/drm/i915/display/intel_fbc.c
··· 797 797 798 798 static u64 intel_fbc_stolen_end(struct intel_display *display) 799 799 { 800 - struct drm_i915_private __maybe_unused *i915 = to_i915(display->drm); 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
+33 -8
drivers/gpu/drm/xe/compat-i915-headers/gem/i915_gem_stolen.h
··· 62 62 node->bo = NULL; 63 63 } 64 64 65 - #define i915_gem_stolen_initialized(xe) (!!ttm_manager_type(&(xe)->ttm, XE_PL_STOLEN)) 66 - #define i915_gem_stolen_node_allocated(node) (!!((node)->bo)) 65 + static inline bool i915_gem_stolen_initialized(struct xe_device *xe) 66 + { 67 + return ttm_manager_type(&xe->ttm, XE_PL_STOLEN); 68 + } 69 + 70 + static inline bool i915_gem_stolen_node_allocated(const struct intel_stolen_node *node) 71 + { 72 + return node->bo; 73 + } 67 74 68 75 static inline u32 i915_gem_stolen_node_offset(struct intel_stolen_node *node) 69 76 { ··· 81 74 } 82 75 83 76 /* Used for < gen4. These are not supported by Xe */ 84 - #define i915_gem_stolen_area_address(xe) (!WARN_ON(1)) 85 - /* Used for gen9 specific WA. Gen9 is not supported by Xe */ 86 - #define i915_gem_stolen_area_size(xe) (!WARN_ON(1)) 77 + static inline u64 i915_gem_stolen_area_address(const struct xe_device *xe) 78 + { 79 + WARN_ON(1); 87 80 88 - #define i915_gem_stolen_node_address(xe, node) (xe_ttm_stolen_gpu_offset(xe) + \ 89 - i915_gem_stolen_node_offset(node)) 90 - #define i915_gem_stolen_node_size(node) ((u64)((node)->bo->ttm.base.size)) 81 + return 0; 82 + } 83 + 84 + /* Used for gen9 specific WA. Gen9 is not supported by Xe */ 85 + static inline u64 i915_gem_stolen_area_size(const struct xe_device *xe) 86 + { 87 + WARN_ON(1); 88 + 89 + return 0; 90 + } 91 + 92 + static inline u64 i915_gem_stolen_node_address(struct xe_device *xe, 93 + struct intel_stolen_node *node) 94 + { 95 + return xe_ttm_stolen_gpu_offset(xe) + i915_gem_stolen_node_offset(node); 96 + } 97 + 98 + static inline u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node) 99 + { 100 + return node->bo->ttm.base.size; 101 + } 91 102 92 103 #endif