aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson2010-12-19 07:01:15 -0600
committerChris Wilson2010-12-19 07:01:15 -0600
commit0184bb1c6d946bcaf198f7680b3405adca676790 (patch)
treeda522808dae925cb17ff7f84aba61f83aa5c7569
parent760c01a6af12c013bca0ad1f17c793ca813be4cc (diff)
downloadexternal-libgbm-0184bb1c6d946bcaf198f7680b3405adca676790.tar.gz
external-libgbm-0184bb1c6d946bcaf198f7680b3405adca676790.tar.xz
external-libgbm-0184bb1c6d946bcaf198f7680b3405adca676790.zip
intel: Export CONSTANT_BUFFER addressing mode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--include/drm/i915_drm.h13
-rw-r--r--intel/intel_bufmgr.c4
-rw-r--r--intel/intel_bufmgr.h2
-rw-r--r--intel/intel_bufmgr_gem.c6
-rw-r--r--intel/intel_bufmgr_priv.h4
5 files changed, 21 insertions, 8 deletions
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 19da2c04..98e15978 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -279,6 +279,8 @@ typedef struct drm_i915_irq_wait {
279#define I915_PARAM_HAS_BSD 10 279#define I915_PARAM_HAS_BSD 10
280#define I915_PARAM_HAS_BLT 11 280#define I915_PARAM_HAS_BLT 11
281#define I915_PARAM_HAS_RELAXED_FENCING 12 281#define I915_PARAM_HAS_RELAXED_FENCING 12
282#define I915_PARAM_HAS_COHERENT_RINGS 13
283#define I915_PARAM_HAS_EXEC_CONSTANTS 14
282 284
283typedef struct drm_i915_getparam { 285typedef struct drm_i915_getparam {
284 int param; 286 int param;
@@ -625,6 +627,17 @@ struct drm_i915_gem_execbuffer2 {
625#define I915_EXEC_RENDER (1<<0) 627#define I915_EXEC_RENDER (1<<0)
626#define I915_EXEC_BSD (2<<0) 628#define I915_EXEC_BSD (2<<0)
627#define I915_EXEC_BLT (3<<0) 629#define I915_EXEC_BLT (3<<0)
630
631/* Used for switching the constants addressing mode on gen4+ RENDER ring.
632 * Gen6+ only supports relative addressing to dynamic state (default) and
633 * absolute addressing.
634 *
635 * These flags are ignored for the BSD and BLT rings.
636 */
637#define I915_EXEC_CONSTANTS_MASK (3<<6)
638#define I915_EXEC_CONSTANTS_REL_GENERAL (0<<6) /* default */
639#define I915_EXEC_CONSTANTS_ABSOLUTE (1<<6)
640#define I915_EXEC_CONSTANTS_REL_SURFACE (2<<6) /* gen4/5 only */
628 __u64 flags; 641 __u64 flags;
629 __u64 rsvd1; 642 __u64 rsvd1;
630 __u64 rsvd2; 643 __u64 rsvd2;
diff --git a/intel/intel_bufmgr.c b/intel/intel_bufmgr.c
index f93a8707..b7c5c091 100644
--- a/intel/intel_bufmgr.c
+++ b/intel/intel_bufmgr.c
@@ -136,12 +136,12 @@ drm_intel_bo_exec(drm_intel_bo *bo, int used,
136int 136int
137drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, 137drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used,
138 drm_clip_rect_t *cliprects, int num_cliprects, int DR4, 138 drm_clip_rect_t *cliprects, int num_cliprects, int DR4,
139 int ring_flag) 139 unsigned int rings)
140{ 140{
141 if (bo->bufmgr->bo_mrb_exec) 141 if (bo->bufmgr->bo_mrb_exec)
142 return bo->bufmgr->bo_mrb_exec(bo, used, 142 return bo->bufmgr->bo_mrb_exec(bo, used,
143 cliprects, num_cliprects, DR4, 143 cliprects, num_cliprects, DR4,
144 ring_flag); 144 rings);
145 145
146 return -ENODEV; 146 return -ENODEV;
147} 147}
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index e1b4c454..daa18b4c 100644
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
@@ -114,7 +114,7 @@ int drm_intel_bo_exec(drm_intel_bo *bo, int used,
114 struct drm_clip_rect *cliprects, int num_cliprects, int DR4); 114 struct drm_clip_rect *cliprects, int num_cliprects, int DR4);
115int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used, 115int drm_intel_bo_mrb_exec(drm_intel_bo *bo, int used,
116 struct drm_clip_rect *cliprects, int num_cliprects, int DR4, 116 struct drm_clip_rect *cliprects, int num_cliprects, int DR4,
117 int ring_flag); 117 unsigned int flags);
118int drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count); 118int drm_intel_bufmgr_check_aperture_space(drm_intel_bo ** bo_array, int count);
119 119
120int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset, 120int drm_intel_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index c5bb5885..72c8731f 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -1555,13 +1555,13 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
1555static int 1555static int
1556drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used, 1556drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used,
1557 drm_clip_rect_t *cliprects, int num_cliprects, int DR4, 1557 drm_clip_rect_t *cliprects, int num_cliprects, int DR4,
1558 int ring_flag) 1558 unsigned int flags)
1559{ 1559{
1560 drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr; 1560 drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
1561 struct drm_i915_gem_execbuffer2 execbuf; 1561 struct drm_i915_gem_execbuffer2 execbuf;
1562 int ret, i; 1562 int ret, i;
1563 1563
1564 switch (ring_flag) { 1564 switch (flags & 0x7) {
1565 default: 1565 default:
1566 return -EINVAL; 1566 return -EINVAL;
1567 case I915_EXEC_BLT: 1567 case I915_EXEC_BLT:
@@ -1594,7 +1594,7 @@ drm_intel_gem_bo_mrb_exec2(drm_intel_bo *bo, int used,
1594 execbuf.num_cliprects = num_cliprects; 1594 execbuf.num_cliprects = num_cliprects;
1595 execbuf.DR1 = 0; 1595 execbuf.DR1 = 0;
1596 execbuf.DR4 = DR4; 1596 execbuf.DR4 = DR4;
1597 execbuf.flags = ring_flag; 1597 execbuf.flags = flags;
1598 execbuf.rsvd1 = 0; 1598 execbuf.rsvd1 = 0;
1599 execbuf.rsvd2 = 0; 1599 execbuf.rsvd2 = 0;
1600 1600
diff --git a/intel/intel_bufmgr_priv.h b/intel/intel_bufmgr_priv.h
index 87e91e7f..0b625200 100644
--- a/intel/intel_bufmgr_priv.h
+++ b/intel/intel_bufmgr_priv.h
@@ -177,8 +177,8 @@ struct _drm_intel_bufmgr {
177 * ring buffer 177 * ring buffer
178 */ 178 */
179 int (*bo_mrb_exec) (drm_intel_bo *bo, int used, 179 int (*bo_mrb_exec) (drm_intel_bo *bo, int used,
180 drm_clip_rect_t *cliprects, int num_cliprects, 180 drm_clip_rect_t *cliprects, int num_cliprects,
181 int DR4, int ring_flag); 181 int DR4, unsigned flags);
182 182
183 /** 183 /**
184 * Pin a buffer to the aperture and fix the offset until unpinned 184 * Pin a buffer to the aperture and fix the offset until unpinned