History

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

Chris Wilson committed 16 years ago

Commit e7b526b1 parent 78b36551 file · +9 −0Browse files

Unified · Split

drivers/gpu/drm/i915/intel_display.c+9−0
@@ -3973,6 +3973,13 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, · 3972 unmodified lines
39733973 DRM_ERROR("failed to pin cursor bo\n");
39743974 goto fail_locked;
39753975 }
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+
39763983 addr = obj_priv->gtt_offset;
39773984 } else {
39783985 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, · 37 unmodified lines
40164023 intel_crtc->cursor_bo = bo;
40174024
40184025 return 0;
4026+fail_unpin:
4027+ i915_gem_object_unpin(bo);
40194028 fail_locked:
40204029 mutex_unlock(&dev->struct_mutex);
40214030 fail:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t