Skip to content

Commit ce7f172

Browse files
committed
drm/i915: Fix i915_ggtt_view_equal to handle rotation correctly
The rotated view depends upon the rotation paramters, but thus far we didn't bother checking for those. This seems to have been an issue ever since this was introduce in commit fe14d5f Author: Tvrtko Ursulin <[email protected]> Date: Wed Dec 10 17:27:58 2014 +0000 drm/i915: Infrastructure for supporting different GGTT views per object But userspace is allowed to reuse framebuffer backing storage with different framebuffers with different pixel formats/stride/whatever. And e.g. SNA indeed does this. Hence we must check for all the paramters to match, not just that it's rotated. v2: intel_plane_obj_offset also needs to construct the full view, to avoid fallout since they don't fully match. Cc: Tvrtko Ursulin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Tvrtko Ursulin <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent a6d0918 commit ce7f172

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/gpu/drm/i915/i915_gem_gtt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ i915_ggtt_view_equal(const struct i915_ggtt_view *a,
553553

554554
if (a->type != b->type)
555555
return false;
556-
if (a->type == I915_GGTT_VIEW_PARTIAL)
556+
if (a->type != I915_GGTT_VIEW_NORMAL)
557557
return !memcmp(&a->params, &b->params, sizeof(a->params));
558558
return true;
559559
}

drivers/gpu/drm/i915/intel_display.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -2914,16 +2914,16 @@ u32 intel_plane_obj_offset(struct intel_plane *intel_plane,
29142914
struct drm_i915_gem_object *obj,
29152915
unsigned int plane)
29162916
{
2917-
const struct i915_ggtt_view *view = &i915_ggtt_view_normal;
2917+
struct i915_ggtt_view view;
29182918
struct i915_vma *vma;
29192919
u64 offset;
29202920

2921-
if (intel_rotation_90_or_270(intel_plane->base.state->rotation))
2922-
view = &i915_ggtt_view_rotated;
2921+
intel_fill_fb_ggtt_view(&view, intel_plane->base.fb,
2922+
intel_plane->base.state);
29232923

2924-
vma = i915_gem_obj_to_ggtt_view(obj, view);
2924+
vma = i915_gem_obj_to_ggtt_view(obj, &view);
29252925
if (WARN(!vma, "ggtt vma for display object not found! (view=%u)\n",
2926-
view->type))
2926+
view.type))
29272927
return -1;
29282928

29292929
offset = vma->node.start;

0 commit comments

Comments
 (0)