[Intel-gfx] [PATCH] drm/i915: Don't detach physical objects of cursor bo at cursor off

Li Peng peng.li at linux.intel.com
Tue Sep 22 05:10:47 CEST 2009


The cache line flush in i915_gem_detach_phys_object() is big overhead
if userspace app keep updating cursor bo and turn it on and off.
We can keep using the physical objects attached at first time and
don't detach them at cursor turning off. It will reduce the overhead.

Signed-off-by: Li Peng <peng.li at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 748ed50..8e90ce2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2744,7 +2744,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
 
 	if (intel_crtc->cursor_bo) {
 		if (dev_priv->cursor_needs_physical) {
-			if (intel_crtc->cursor_bo != bo)
+			if (intel_crtc->cursor_bo != bo && handle)
 				i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
 		} else
 			i915_gem_object_unpin(intel_crtc->cursor_bo);
-- 
1.6.1.3






More information about the Intel-gfx mailing list