From: Xiang, Haihao Date: Wed, 14 Nov 2012 04:46:39 +0000 (+0800) Subject: intel: Add support for VEBOX ring (v2) X-Git-Tag: 2.4.45~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=011999927f76a7e9ba8f047fae4b4e084da6c2c3;p=platform%2Fupstream%2Flibdrm.git intel: Add support for VEBOX ring (v2) v2: Fix the test for has_vebox Signed-off-by: Xiang, Haihao Signed-off-by: Ben Widawsky --- diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 7e9e9bd..aa983f3 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -303,6 +303,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_LLC 17 #define I915_PARAM_HAS_ALIASING_PPGTT 18 #define I915_PARAM_HAS_WAIT_TIMEOUT 19 +#define I915_PARAM_HAS_VEBOX 22 typedef struct drm_i915_getparam { int param; @@ -649,6 +650,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 d21547e..3c73068 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; @@ -2213,6 +2214,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; @@ -3126,6 +3131,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;