diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-02 03:30:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-05 23:37:37 -0400 |
commit | e7b526bb852cdd67b24e174da6850222f8da41b1 (patch) | |
tree | d0a1c95cfc2b6a8f8f4c705355a7b70994468cc3 | |
parent | 78b36558b7061430fe16ce49f83f1bc3a0b7d4b8 (diff) |
drm/i915: Move non-phys cursors into the GTT
Cursors need to be in the GTT domain when being accessed by the GPU.
Previously this was a fortuitous byproduct of userspace using pwrite()
to upload the image data into the cursor. The redundant clflush was
removed in commit 9b8c4a and so the image was no longer being flushed
out of the caches into main memory. One could also devise a scenario
where the cursor was rendered by the GPU, prior to being attached as the
cursor, resulting in similar corruption due to the missing MI_FLUSH.
Fixes:
Bug 28335 - Cursor corruption caused by commit 9b8c4a0b21
https://bugs.freedesktop.org/show_bug.cgi?id=28335
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Andy Isaacson <adi@hexapodia.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 88a1ab7c05ce..04e1bb499ff8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3973,6 +3973,13 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
3973 | DRM_ERROR("failed to pin cursor bo\n"); | 3973 | DRM_ERROR("failed to pin cursor bo\n"); |
3974 | goto fail_locked; | 3974 | goto fail_locked; |
3975 | } | 3975 | } |
3976 | |||
3977 | ret = i915_gem_object_set_to_gtt_domain(bo, 0); | ||
3978 | if (ret) { | ||
3979 | DRM_ERROR("failed to move cursor bo into the GTT\n"); | ||
3980 | goto fail_unpin; | ||
3981 | } | ||
3982 | |||
3976 | addr = obj_priv->gtt_offset; | 3983 | addr = obj_priv->gtt_offset; |
3977 | } else { | 3984 | } else { |
3978 | ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1); | 3985 | ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1); |
@@ -4016,6 +4023,8 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
4016 | intel_crtc->cursor_bo = bo; | 4023 | intel_crtc->cursor_bo = bo; |
4017 | 4024 | ||
4018 | return 0; | 4025 | return 0; |
4026 | fail_unpin: | ||
4027 | i915_gem_object_unpin(bo); | ||
4019 | fail_locked: | 4028 | fail_locked: |
4020 | mutex_unlock(&dev->struct_mutex); | 4029 | mutex_unlock(&dev->struct_mutex); |
4021 | fail: | 4030 | fail: |