aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRodrigo Vivi <rodrigo.vivi@gmail.com>2013-08-28 15:45:46 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-04 11:34:51 -0400
commit9435373ef8870e0a84b6fec0ad89b952bf3097fa (patch)
treeb3dc336376cce918843d011068107b2bd73a63c9 /drivers/gpu
parent3e33a8408117088c873ebc4b3ca0e1e440c0b697 (diff)
drm/i915: Report enabled slices on Haswell GT3
Batchbuffers constructed by userspace can conditionalise their URB allocations through the use of the MI_SET_PREDICATE command. This command can read the MI_PREDICATE_RESULT_2 register to see how many slices are enabled on GT3, and by virtue of the result, scale their memory allocations to fit enabled memory. Of course, this only works if the kernel sets the appropriate bit in the register first. v2: Better commit subject and message by Chris Wilson. Cc: Chris Wilson <chris@chris-wilson.co.uk> Credits-to: Yejun Guo <yejun.guo@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h5
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2cf9dabbfe5d..e52648927475 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1603,6 +1603,8 @@ struct drm_i915_file_private {
1603 ((dev)->pci_device & 0xFF00) == 0x0C00) 1603 ((dev)->pci_device & 0xFF00) == 0x0C00)
1604#define IS_ULT(dev) (IS_HASWELL(dev) && \ 1604#define IS_ULT(dev) (IS_HASWELL(dev) && \
1605 ((dev)->pci_device & 0xFF00) == 0x0A00) 1605 ((dev)->pci_device & 0xFF00) == 0x0A00)
1606#define IS_HSW_GT3(dev) (IS_HASWELL(dev) && \
1607 ((dev)->pci_device & 0x00F0) == 0x0020)
1606 1608
1607/* 1609/*
1608 * The genX designation typically refers to the render engine, so render 1610 * The genX designation typically refers to the render engine, so render
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d57368d5fc1d..2d4b72ab1229 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4331,6 +4331,11 @@ i915_gem_init_hw(struct drm_device *dev)
4331 if (dev_priv->ellc_size) 4331 if (dev_priv->ellc_size)
4332 I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf)); 4332 I915_WRITE(HSW_IDICR, I915_READ(HSW_IDICR) | IDIHASHMSK(0xf));
4333 4333
4334 if (IS_HSW_GT3(dev))
4335 I915_WRITE(MI_PREDICATE_RESULT_2, LOWER_SLICE_ENABLED);
4336 else
4337 I915_WRITE(MI_PREDICATE_RESULT_2, LOWER_SLICE_DISABLED);
4338
4334 if (HAS_PCH_NOP(dev)) { 4339 if (HAS_PCH_NOP(dev)) {
4335 u32 temp = I915_READ(GEN7_MSG_CTL); 4340 u32 temp = I915_READ(GEN7_MSG_CTL);
4336 temp &= ~(WAIT_FOR_PCH_FLR_ACK | WAIT_FOR_PCH_RESET_ACK); 4341 temp &= ~(WAIT_FOR_PCH_FLR_ACK | WAIT_FOR_PCH_RESET_ACK);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f626a16a14fa..c7f2da36f4a8 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -264,6 +264,11 @@
264#define MI_SEMAPHORE_SYNC_VVE (1<<16) /* VECS wait for VCS (VEVSYNC) */ 264#define MI_SEMAPHORE_SYNC_VVE (1<<16) /* VECS wait for VCS (VEVSYNC) */
265#define MI_SEMAPHORE_SYNC_RVE (2<<16) /* VECS wait for RCS (VERSYNC) */ 265#define MI_SEMAPHORE_SYNC_RVE (2<<16) /* VECS wait for RCS (VERSYNC) */
266#define MI_SEMAPHORE_SYNC_INVALID (3<<16) 266#define MI_SEMAPHORE_SYNC_INVALID (3<<16)
267
268#define MI_PREDICATE_RESULT_2 (0x2214)
269#define LOWER_SLICE_ENABLED (1<<0)
270#define LOWER_SLICE_DISABLED (0<<0)
271
267/* 272/*
268 * 3D instructions used by the kernel 273 * 3D instructions used by the kernel
269 */ 274 */