aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c2
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h15
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index ff471454968d..51b7a2171cae 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -113,7 +113,7 @@ static int get_context_size(struct drm_device *dev)
113 case 7: 113 case 7:
114 reg = I915_READ(GEN7_CXT_SIZE); 114 reg = I915_READ(GEN7_CXT_SIZE);
115 if (IS_HASWELL(dev)) 115 if (IS_HASWELL(dev))
116 ret = HSW_CXT_TOTAL_SIZE(reg) * 64; 116 ret = HSW_CXT_TOTAL_SIZE;
117 else 117 else
118 ret = GEN7_CXT_TOTAL_SIZE(reg) * 64; 118 ret = GEN7_CXT_TOTAL_SIZE(reg) * 64;
119 break; 119 break;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index e1df06d1917f..f2326fc60ac9 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1718,14 +1718,13 @@
1718 GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \ 1718 GEN7_CXT_EXTENDED_SIZE(ctx_reg) + \
1719 GEN7_CXT_GT1_SIZE(ctx_reg) + \ 1719 GEN7_CXT_GT1_SIZE(ctx_reg) + \
1720 GEN7_CXT_VFSTATE_SIZE(ctx_reg)) 1720 GEN7_CXT_VFSTATE_SIZE(ctx_reg))
1721#define HSW_CXT_POWER_SIZE(ctx_reg) ((ctx_reg >> 26) & 0x3f) 1721/* Haswell does have the CXT_SIZE register however it does not appear to be
1722#define HSW_CXT_RING_SIZE(ctx_reg) ((ctx_reg >> 23) & 0x7) 1722 * valid. Now, docs explain in dwords what is in the context object. The full
1723#define HSW_CXT_RENDER_SIZE(ctx_reg) ((ctx_reg >> 15) & 0xff) 1723 * size is 70720 bytes, however, the power context and execlist context will
1724#define HSW_CXT_TOTAL_SIZE(ctx_reg) (HSW_CXT_POWER_SIZE(ctx_reg) + \ 1724 * never be saved (power context is stored elsewhere, and execlists don't work
1725 HSW_CXT_RING_SIZE(ctx_reg) + \ 1725 * on HSW) - so the final size is 66944 bytes, which rounds to 17 pages.
1726 HSW_CXT_RENDER_SIZE(ctx_reg) + \ 1726 */
1727 GEN7_CXT_VFSTATE_SIZE(ctx_reg)) 1727#define HSW_CXT_TOTAL_SIZE (17 * PAGE_SIZE)
1728
1729 1728
1730/* 1729/*
1731 * Overlay regs 1730 * Overlay regs