|
@@ -204,19 +204,12 @@ static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr,
|
|
|
|
|
|
/* Broadwell Page Directory Pointer Descriptors */
|
|
/* Broadwell Page Directory Pointer Descriptors */
|
|
static int gen8_write_pdp(struct intel_engine_cs *ring, unsigned entry,
|
|
static int gen8_write_pdp(struct intel_engine_cs *ring, unsigned entry,
|
|
- uint64_t val, bool synchronous)
|
|
|
|
|
|
+ uint64_t val)
|
|
{
|
|
{
|
|
- struct drm_i915_private *dev_priv = ring->dev->dev_private;
|
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
BUG_ON(entry >= 4);
|
|
BUG_ON(entry >= 4);
|
|
|
|
|
|
- if (synchronous) {
|
|
|
|
- I915_WRITE(GEN8_RING_PDP_UDW(ring, entry), val >> 32);
|
|
|
|
- I915_WRITE(GEN8_RING_PDP_LDW(ring, entry), (u32)val);
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
ret = intel_ring_begin(ring, 6);
|
|
ret = intel_ring_begin(ring, 6);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
@@ -233,8 +226,7 @@ static int gen8_write_pdp(struct intel_engine_cs *ring, unsigned entry,
|
|
}
|
|
}
|
|
|
|
|
|
static int gen8_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
static int gen8_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
- struct intel_engine_cs *ring,
|
|
|
|
- bool synchronous)
|
|
|
|
|
|
+ struct intel_engine_cs *ring)
|
|
{
|
|
{
|
|
int i, ret;
|
|
int i, ret;
|
|
|
|
|
|
@@ -243,7 +235,7 @@ static int gen8_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
|
|
|
|
for (i = used_pd - 1; i >= 0; i--) {
|
|
for (i = used_pd - 1; i >= 0; i--) {
|
|
dma_addr_t addr = ppgtt->pd_dma_addr[i];
|
|
dma_addr_t addr = ppgtt->pd_dma_addr[i];
|
|
- ret = gen8_write_pdp(ring, i, addr, synchronous);
|
|
|
|
|
|
+ ret = gen8_write_pdp(ring, i, addr);
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
@@ -708,29 +700,10 @@ static uint32_t get_pd_offset(struct i915_hw_ppgtt *ppgtt)
|
|
}
|
|
}
|
|
|
|
|
|
static int hsw_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
static int hsw_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
- struct intel_engine_cs *ring,
|
|
|
|
- bool synchronous)
|
|
|
|
|
|
+ struct intel_engine_cs *ring)
|
|
{
|
|
{
|
|
- struct drm_device *dev = ppgtt->base.dev;
|
|
|
|
- struct drm_i915_private *dev_priv = dev->dev_private;
|
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- /* If we're in reset, we can assume the GPU is sufficiently idle to
|
|
|
|
- * manually frob these bits. Ideally we could use the ring functions,
|
|
|
|
- * except our error handling makes it quite difficult (can't use
|
|
|
|
- * intel_ring_begin, ring->flush, or intel_ring_advance)
|
|
|
|
- *
|
|
|
|
- * FIXME: We should try not to special case reset
|
|
|
|
- */
|
|
|
|
- if (synchronous ||
|
|
|
|
- i915_reset_in_progress(&dev_priv->gpu_error)) {
|
|
|
|
- WARN_ON(ppgtt != dev_priv->mm.aliasing_ppgtt);
|
|
|
|
- I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G);
|
|
|
|
- I915_WRITE(RING_PP_DIR_BASE(ring), get_pd_offset(ppgtt));
|
|
|
|
- POSTING_READ(RING_PP_DIR_BASE(ring));
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* NB: TLBs must be flushed and invalidated before a switch */
|
|
/* NB: TLBs must be flushed and invalidated before a switch */
|
|
ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
|
|
ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
|
|
if (ret)
|
|
if (ret)
|
|
@@ -752,29 +725,10 @@ static int hsw_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
}
|
|
}
|
|
|
|
|
|
static int gen7_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
static int gen7_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
- struct intel_engine_cs *ring,
|
|
|
|
- bool synchronous)
|
|
|
|
|
|
+ struct intel_engine_cs *ring)
|
|
{
|
|
{
|
|
- struct drm_device *dev = ppgtt->base.dev;
|
|
|
|
- struct drm_i915_private *dev_priv = dev->dev_private;
|
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- /* If we're in reset, we can assume the GPU is sufficiently idle to
|
|
|
|
- * manually frob these bits. Ideally we could use the ring functions,
|
|
|
|
- * except our error handling makes it quite difficult (can't use
|
|
|
|
- * intel_ring_begin, ring->flush, or intel_ring_advance)
|
|
|
|
- *
|
|
|
|
- * FIXME: We should try not to special case reset
|
|
|
|
- */
|
|
|
|
- if (synchronous ||
|
|
|
|
- i915_reset_in_progress(&dev_priv->gpu_error)) {
|
|
|
|
- WARN_ON(ppgtt != dev_priv->mm.aliasing_ppgtt);
|
|
|
|
- I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G);
|
|
|
|
- I915_WRITE(RING_PP_DIR_BASE(ring), get_pd_offset(ppgtt));
|
|
|
|
- POSTING_READ(RING_PP_DIR_BASE(ring));
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/* NB: TLBs must be flushed and invalidated before a switch */
|
|
/* NB: TLBs must be flushed and invalidated before a switch */
|
|
ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
|
|
ret = ring->flush(ring, I915_GEM_GPU_DOMAINS, I915_GEM_GPU_DOMAINS);
|
|
if (ret)
|
|
if (ret)
|
|
@@ -803,14 +757,11 @@ static int gen7_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
}
|
|
}
|
|
|
|
|
|
static int gen6_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
static int gen6_mm_switch(struct i915_hw_ppgtt *ppgtt,
|
|
- struct intel_engine_cs *ring,
|
|
|
|
- bool synchronous)
|
|
|
|
|
|
+ struct intel_engine_cs *ring)
|
|
{
|
|
{
|
|
struct drm_device *dev = ppgtt->base.dev;
|
|
struct drm_device *dev = ppgtt->base.dev;
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
|
|
|
|
- if (!synchronous)
|
|
|
|
- return 0;
|
|
|
|
|
|
|
|
I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G);
|
|
I915_WRITE(RING_PP_DIR_DCLV(ring), PP_DIR_DCLV_2G);
|
|
I915_WRITE(RING_PP_DIR_BASE(ring), get_pd_offset(ppgtt));
|
|
I915_WRITE(RING_PP_DIR_BASE(ring), get_pd_offset(ppgtt));
|
|
@@ -1189,7 +1140,7 @@ int i915_ppgtt_init_hw(struct drm_device *dev)
|
|
|
|
|
|
if (ppgtt) {
|
|
if (ppgtt) {
|
|
for_each_ring(ring, dev_priv, i) {
|
|
for_each_ring(ring, dev_priv, i) {
|
|
- ret = ppgtt->switch_mm(ppgtt, ring, true);
|
|
|
|
|
|
+ ret = ppgtt->switch_mm(ppgtt, ring);
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|