From patchwork Tue Sep 22 03:10:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Peng X-Patchwork-Id: 49157 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8M3iI6a024754 for ; Tue, 22 Sep 2009 03:44:18 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D3549EF9E; Mon, 21 Sep 2009 20:44:18 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 199AF9EDED for ; Mon, 21 Sep 2009 20:44:15 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 21 Sep 2009 20:29:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.44,428,1249282800"; d="scan'208";a="450513628" Received: from ubuntu-pli1.bj.intel.com (HELO [172.16.180.116]) ([172.16.180.116]) by orsmga002.jf.intel.com with ESMTP; 21 Sep 2009 20:50:05 -0700 From: Li Peng To: intel-gfx Date: Tue, 22 Sep 2009 11:10:47 +0800 Message-Id: <1253589047.24464.3.camel@ubuntu-pli1.bj.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Subject: [Intel-gfx] [PATCH] drm/i915: Don't detach physical objects of cursor bo at cursor off X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org 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 --- 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);