drm/i915/gem: use intel_gtt_view_is_*() helpers more

Prefer using the intel_gtt_view_is_*() helpers instead of comparing the
view type directly.

Reviewed-by: Maarten Lankhorst <dev@lankhorst.se>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/1b7f309d0c5c5891caa2ec84c04ce8a4438f1207.1790780340.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Jani Nikula 2026-09-30 18:00:02 +03:00
parent 0586e5f135
commit 1a4aab52c6
3 changed files with 3 additions and 3 deletions

View File

@ -462,7 +462,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
*/
vma = ERR_PTR(-ENOSPC);
if ((flags & PIN_MAPPABLE) == 0 &&
(!view || view->type == I915_GTT_VIEW_NORMAL))
(!view || intel_gtt_view_is_normal(view)))
vma = i915_gem_object_ggtt_pin_ww(obj, ww, view, 0, alignment,
flags | PIN_MAPPABLE |
PIN_NONBLOCK);

View File

@ -396,7 +396,7 @@ static vm_fault_t vm_fault_gtt(struct vm_fault *vmf)
unsigned int flags;
flags = PIN_MAPPABLE | PIN_NOSEARCH;
if (view.type == I915_GTT_VIEW_NORMAL)
if (intel_gtt_view_is_normal(&view))
flags |= PIN_NONBLOCK; /* avoid warnings for pinned */
/*

View File

@ -913,7 +913,7 @@ i915_gem_object_ggtt_pin_ww(struct drm_i915_gem_object *obj,
GEM_WARN_ON(!ww);
if (flags & PIN_MAPPABLE &&
(!view || view->type == I915_GTT_VIEW_NORMAL)) {
(!view || intel_gtt_view_is_normal(view))) {
/*
* If the required space is larger than the available
* aperture, we will not able to find a slot for the