• Joonas Lahtinen's avatar
    drm/i915: Compare GGTT view structs instead of types · 9abc4648
    Joonas Lahtinen authored
    To allow for views where the view type is not defined by the view type only,
    like it is in stereo or rotated 90 degree view, change the semantic to require
    the whole view structure for comparison when we match a GGTT view.
    
    This allows including parameters like offset to be included in the view which
    is useful for eg. partial views.
    
    v3:
    - Rely on ggtt_view type being 0 for non-GGTT vma's, which equals to
      I915_GGTT_VIEW_NORMAL. (Daniel Vetter)
    - Do not use potentially slower comparison when we only want to know if
      something is or is not a normal view.
    - Rebase on top of rotated view patches. Add rotated view singleton.
    - If one view is missing in comparison they're equal only if both are missing.
    
    v4:
    - Use comparison helper in obj_to_ggtt_view too. (Tvrtko Ursulin)
    - Do WARN_ON if one view is NULL. (Tvrtko Ursulin)
    
    Cc: Daniel Vetter <daniel@ffwll.ch>
    Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    9abc4648
i915_gem_gtt.h 14 KB