diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-02 03:41:44 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-02 17:35:07 -0400 |
commit | 382fe70fddf54114802c935264f1d5baf8d3d174 (patch) | |
tree | f751b1d8019843711358244714e0eff7a3422c4e /drivers | |
parent | 0d7168bcf45fa5b6307726091ea77fd4ab16d1ab (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>
Tested-by: Arkadiusz MiĆkiewicz <arekm@maven.pl>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-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 b40155fe5122..a8d65b7cb72a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3978,6 +3978,13 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
3978 | DRM_ERROR("failed to pin cursor bo\n"); | 3978 | DRM_ERROR("failed to pin cursor bo\n"); |
3979 | goto fail_locked; | 3979 | goto fail_locked; |
3980 | } | 3980 | } |
3981 | |||
3982 | ret = i915_gem_object_set_to_gtt_domain(bo, 0); | ||
3983 | if (ret) { | ||
3984 | DRM_ERROR("failed to move cursor bo into the GTT\n"); | ||
3985 | goto fail_unpin; | ||
3986 | } | ||
3987 | |||
3981 | addr = obj_priv->gtt_offset; | 3988 | addr = obj_priv->gtt_offset; |
3982 | } else { | 3989 | } else { |
3983 | ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1); | 3990 | ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1); |
@@ -4021,6 +4028,8 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, | |||
4021 | intel_crtc->cursor_bo = bo; | 4028 | intel_crtc->cursor_bo = bo; |
4022 | 4029 | ||
4023 | return 0; | 4030 | return 0; |
4031 | fail_unpin: | ||
4032 | i915_gem_object_unpin(bo); | ||
4024 | fail_locked: | 4033 | fail_locked: |
4025 | mutex_unlock(&dev->struct_mutex); | 4034 | mutex_unlock(&dev->struct_mutex); |
4026 | fail: | 4035 | fail: |