From patchwork Wed Nov 14 04:46:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 1737741 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 3EBC5DF264 for ; Wed, 14 Nov 2012 04:54:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 377859F5E6 for ; Tue, 13 Nov 2012 20:54:44 -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 2D6579F660 for ; Tue, 13 Nov 2012 20:54:07 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 13 Nov 2012 20:54:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.83,248,1352102400"; d="scan'208";a="248782323" Received: from xhh-hsw32.sh.intel.com ([10.239.36.99]) by fmsmga002.fm.intel.com with ESMTP; 13 Nov 2012 20:54:05 -0800 From: "Xiang, Haihao" To: intel-gfx@lists.freedesktop.org Date: Wed, 14 Nov 2012 12:46:39 +0800 Message-Id: <1352868399-6552-2-git-send-email-haihao.xiang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352868399-6552-1-git-send-email-haihao.xiang@intel.com> References: <1352868399-6552-1-git-send-email-haihao.xiang@intel.com> Subject: [Intel-gfx] [PATCH 2/2] intel: Add support for VEBOX ring (v2) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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 From: "Xiang, Haihao" v2: Fix the test for has_vebox Signed-off-by: Xiang, Haihao --- include/drm/i915_drm.h | 2 ++ intel/intel_bufmgr_gem.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 8b069ac..2341d2a 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -305,6 +305,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_WAIT_TIMEOUT 19 #define I915_PARAM_HAS_SEMAPHORES 20 #define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 +#define I915_PARAM_HAS_VEBOX 22 typedef struct drm_i915_getparam { int param; @@ -651,6 +652,7 @@ struct drm_i915_gem_execbuffer2 { #define I915_EXEC_RENDER (1<<0) #define I915_EXEC_BSD (2<<0) #define I915_EXEC_BLT (3<<0) +#define I915_EXEC_VEBOX (4<<0) /* Used for switching the constants addressing mode on gen4+ RENDER ring. * Gen6+ only supports relative addressing to dynamic state (default) and diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 512bc6f..758cc52 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -125,6 +125,7 @@ typedef struct _drm_intel_bufmgr_gem { unsigned int has_wait_timeout : 1; unsigned int bo_reuse : 1; unsigned int no_exec : 1; + unsigned int has_vebox : 1; bool fenced_relocs; FILE *aub_file; @@ -2210,6 +2211,10 @@ do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx, if (!bufmgr_gem->has_bsd) return -EINVAL; break; + case I915_EXEC_VEBOX: + if (!bufmgr_gem->has_vebox) + return -EINVAL; + break; case I915_EXEC_RENDER: case I915_EXEC_DEFAULT: break; @@ -3123,6 +3128,10 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size) } else bufmgr_gem->has_llc = *gp.value; + gp.param = I915_PARAM_HAS_VEBOX; + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp); + bufmgr_gem->has_vebox = (ret == 0) & (*gp.value > 0); + if (bufmgr_gem->gen < 4) { gp.param = I915_PARAM_NUM_FENCES_AVAIL; gp.value = &bufmgr_gem->available_fences;