From patchwork Mon Nov 12 17:32:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 1729551 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 1D2913FCDE for ; Mon, 12 Nov 2012 17:52:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00FB29F36E for ; Mon, 12 Nov 2012 09:52:32 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 627279F0F9 for ; Mon, 12 Nov 2012 09:34:11 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 12 Nov 2012 09:33:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,764,1344236400"; d="scan'208";a="240805732" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga002.jf.intel.com with SMTP; 12 Nov 2012 09:34:08 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 12 Nov 2012 19:34:08 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 21/22] HACK: drm/i915: Make non-blocking GPU synchronization optional Date: Mon, 12 Nov 2012 19:32:59 +0200 Message-Id: <1352741580-12141-22-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> References: <1352741580-12141-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Add a module parameter that allows one to easily change between blocking and non-blocking GPU synchronization with atomic page flips. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_stub.c | 5 +++++ drivers/gpu/drm/i915/intel_atomic.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index c236fd2..52d5750 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -46,16 +46,21 @@ EXPORT_SYMBOL(drm_vblank_offdelay); unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ EXPORT_SYMBOL(drm_timestamp_precision); +unsigned int drm_async_gpu = 0; /* 1 to enable async gpu wait */ +EXPORT_SYMBOL(drm_async_gpu); + MODULE_AUTHOR(CORE_AUTHOR); MODULE_DESCRIPTION(CORE_DESC); MODULE_LICENSE("GPL and additional rights"); MODULE_PARM_DESC(debug, "Enable debug output"); MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs]"); MODULE_PARM_DESC(timestamp_precision_usec, "Max. error on timestamps [usecs]"); +MODULE_PARM_DESC(async_gpu, "Async GPU wait"); module_param_named(debug, drm_debug, int, 0600); module_param_named(vblankoffdelay, drm_vblank_offdelay, int, 0600); module_param_named(timestamp_precision_usec, drm_timestamp_precision, int, 0600); +module_param_named(async_gpu, drm_async_gpu, int, 0600); struct idr drm_minors_idr; diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index bfa6da6..d3aa566 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -801,11 +801,13 @@ static void unpin_fbs(struct drm_device *dev, } } +extern unsigned int drm_async_gpu; + static int pin_fbs(struct drm_device *dev, struct intel_atomic_state *s) { int i, ret; - bool nonblock = s->flags & DRM_MODE_ATOMIC_NONBLOCK; + bool nonblock = drm_async_gpu && (s->flags & DRM_MODE_ATOMIC_NONBLOCK); for (i = 0; i < dev->mode_config.num_crtc; i++) { struct intel_crtc_state *st = &s->crtc[i]; @@ -2359,6 +2361,12 @@ static void atomic_pipe_commit(struct drm_device *dev, if (list_empty(&flips)) return; + if (!drm_async_gpu) { + struct intel_crtc *intel_crtc = to_intel_crtc(intel_get_crtc_for_pipe(dev, pipe)); + intel_atomic_schedule_flips(dev_priv, intel_crtc, &flips); + return; + } + spin_lock_irqsave(&dev_priv->flip.lock, flags); list_for_each_entry_safe(intel_flip, next, &flips, base.list) intel_atomic_postpone_flip(dev, intel_flip);