From patchwork Tue Oct 12 08:13:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 247151 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 o9C8E3wo029768 for ; Tue, 12 Oct 2010 08:14:23 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 131049EFEC for ; Tue, 12 Oct 2010 01:14:03 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 88E5C9E9E9 for ; Tue, 12 Oct 2010 01:13:21 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 Oct 2010 01:13:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.57,319,1283756400"; d="scan'208";a="666543106" Received: from snb-beast.sh.intel.com (HELO localhost.localdomain) ([10.239.36.73]) by orsmga001.jf.intel.com with ESMTP; 12 Oct 2010 01:13:21 -0700 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org Date: Tue, 12 Oct 2010 16:13:52 +0800 Message-Id: <1286871232-1560-2-git-send-email-zhenyuw@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1286871232-1560-1-git-send-email-zhenyuw@linux.intel.com> References: <1286871232-1560-1-git-send-email-zhenyuw@linux.intel.com> Subject: [Intel-gfx] [PATCH] intel: new blitter ring support from Sandybridge 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]); Tue, 12 Oct 2010 08:14:23 +0000 (UTC) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 7594413..694fb24 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -276,6 +276,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_PAGEFLIPPING 8 #define I915_PARAM_HAS_EXECBUF2 9 #define I915_PARAM_HAS_BSD 10 +#define I915_PARAM_HAS_BLIT_SPLIT 11 typedef struct drm_i915_getparam { int param; @@ -619,6 +620,7 @@ struct drm_i915_gem_execbuffer2 { __u64 cliprects_ptr; #define I915_EXEC_RENDER (1<<0) #define I915_EXEC_BSD (1<<1) +#define I915_EXEC_BLIT (1<<2) __u64 flags; __u64 rsvd1; __u64 rsvd2; diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 60174e1..57229e9 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -1545,7 +1545,8 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, struct drm_i915_gem_execbuffer2 execbuf; int ret, i; - if ((ring_flag != I915_EXEC_RENDER) && (ring_flag != I915_EXEC_BSD)) + if ((ring_flag != I915_EXEC_RENDER) && (ring_flag != I915_EXEC_BSD) && + (ring_flag != I915_EXEC_BLIT)) return -EINVAL; pthread_mutex_lock(&bufmgr_gem->lock); @@ -2054,7 +2055,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) struct drm_i915_gem_get_aperture aperture; drm_i915_getparam_t gp; int ret; - int exec2 = 0, has_bsd = 0; + int exec2 = 0, has_bsd = 0, blit_split = 0; bufmgr_gem = calloc(1, sizeof(*bufmgr_gem)); if (bufmgr_gem == NULL) @@ -2110,6 +2111,11 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) if (!ret) has_bsd = 1; + gp.param = I915_PARAM_HAS_BLIT_SPLIT; + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (!ret) + blit_split = *gp.value; + if (bufmgr_gem->gen < 4) { gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &bufmgr_gem->available_fences; @@ -2165,7 +2171,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) /* Use the new one if available */ if (exec2) { bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec2; - if (has_bsd) + if (has_bsd || blit_split) bufmgr_gem->bufmgr.bo_mrb_exec = drm_intel_gem_bo_mrb_exec2; } else bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec;