]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915/overlay: Ensure that the reg_bo is in the GTT prior to writing.
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 12 Aug 2010 08:35:00 +0000 (09:35 +0100)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:04 +0000 (23:40 +0100)
commit 0ddc1289f3ffd779779ddd3922f26ae7d0a21604 upstream.

Just makes sure that writes are not being aliased by the CPU cache and
do make it out to main memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24977
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/i915/intel_overlay.c

index fe05ba27440ae2a502906e6c87d4d2530003e941..3d691c421ebcaf2a5f263170a373a460efcca52e 100644 (file)
@@ -1364,6 +1364,12 @@ void intel_setup_overlay(struct drm_device *dev)
                         goto out_free_bo;
                 }
                overlay->flip_addr = overlay->reg_bo->gtt_offset;
+
+               ret = i915_gem_object_set_to_gtt_domain(reg_bo, true);
+               if (ret) {
+                        DRM_ERROR("failed to move overlay register bo into the GTT\n");
+                        goto out_unpin_bo;
+                }
        } else {
                ret = i915_gem_attach_phys_object(dev, reg_bo,
                                I915_GEM_PHYS_OVERLAY_REGS);
@@ -1395,6 +1401,8 @@ void intel_setup_overlay(struct drm_device *dev)
        DRM_INFO("initialized overlay support\n");
        return;
 
+out_unpin_bo:
+       i915_gem_object_unpin(reg_bo);
 out_free_bo:
        drm_gem_object_unreference(reg_bo);
 out_free: