From patchwork Wed Dec 8 16:24:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 390992 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB8GPKwa015194 for ; Wed, 8 Dec 2010 16:25:41 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 597F59EE9F for ; Wed, 8 Dec 2010 08:25:20 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 148119E970 for ; Wed, 8 Dec 2010 08:24:56 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 08 Dec 2010 08:24:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,316,1288594800"; d="scan'208";a="865943102" Received: from unknown (HELO cantiga.alporthouse.com) ([10.255.16.52]) by fmsmga001.fm.intel.com with ESMTP; 08 Dec 2010 08:24:45 -0800 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Dec 2010 16:24:35 +0000 Message-Id: <1291825475-22106-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <20100921202607.2b46ffca@gmail.com> References: <20100921202607.2b46ffca@gmail.com> Cc: Paolo Ornati Subject: [Intel-gfx] [PATCH] drm/i915: Use PM QoS to prevent C-state memory starvation of the GPU X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Dec 2010 16:25:41 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d9b54a2..4675f6d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -35,6 +35,7 @@ #include "intel_ringbuffer.h" #include #include +#include #include /* General customization: @@ -659,6 +660,7 @@ typedef struct drm_i915_private { int lvds_downclock; struct work_struct idle_work; struct timer_list idle_timer; + struct pm_qos_request_list pm_qos; bool busy; u16 orig_clock; int child_dev_num; diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e213529..128020a 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -4765,6 +4765,8 @@ static void intel_gpu_idle_timer(unsigned long arg) return; } + pm_qos_remove_request(&dev_priv->pm_qos); + dev_priv->busy = false; queue_work(dev_priv->wq, &dev_priv->idle_work); } @@ -4940,6 +4942,12 @@ void intel_mark_busy(struct drm_device *dev, struct drm_i915_gem_object *obj) fw_blc_self &= ~FW_BLC_SELF_EN; I915_WRITE(FW_BLC_SELF, fw_blc_self | FW_BLC_SELF_EN_MASK); } + + /* Install a handle to prevent C-state starvation of the GPU */ + pm_qos_add_request(&dev_priv->pm_qos, + PM_QOS_CPU_DMA_LATENCY, + 20); + dev_priv->busy = true; } else mod_timer(&dev_priv->idle_timer, jiffies +