From 7cefb6ab03f709fe72dbcee32a0995b62a2b2bd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Tue, 7 Apr 2026 18:50:48 +0300 Subject: [PATCH] drm/i915/vma: Add helpers to check GTT view type MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I915_GTT_VIEW_ROTATED is going away and being replaced by just I915_GTT_VIEW_REMAPPED, so we're going to need another way to determine if the view is rotated or not (since width/height will need to be swapped when operating on the destination coordinate space). Provide small helper functions to hide such implementation details from most of the code using GTT views. Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20260407155053.32156-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/i915_gtt_view_types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gtt_view_types.h b/drivers/gpu/drm/i915/i915_gtt_view_types.h index c084f67bc8807..9c4f38db32ffa 100644 --- a/drivers/gpu/drm/i915/i915_gtt_view_types.h +++ b/drivers/gpu/drm/i915/i915_gtt_view_types.h @@ -56,4 +56,19 @@ struct i915_gtt_view { }; }; +static inline bool i915_gtt_view_is_normal(const struct i915_gtt_view *view) +{ + return view->type == I915_GTT_VIEW_NORMAL; +} + +static inline bool i915_gtt_view_is_remapped(const struct i915_gtt_view *view) +{ + return view->type == I915_GTT_VIEW_REMAPPED; +} + +static inline bool i915_gtt_view_is_rotated(const struct i915_gtt_view *view) +{ + return view->type == I915_GTT_VIEW_ROTATED; +} + #endif /* __I915_GTT_VIEW_TYPES_H__ */ -- 2.47.3