[09/13] drm/i915/skl: CS flips are not supported with execlists
diff mbox

Message ID 1423588576-11339-10-git-send-email-tvrtko.ursulin@linux.intel.com
State New, archived
Headers show

Commit Message

Tvrtko Ursulin Feb. 10, 2015, 5:16 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Therefore remove dead code.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 72 ++----------------------------------
 1 file changed, 4 insertions(+), 68 deletions(-)

Comments

Daniel Vetter Feb. 11, 2015, 7:40 a.m. UTC | #1
On Tue, Feb 10, 2015 at 05:16:12PM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Therefore remove dead code.

Commit message should state that skl requires execlist, otherwise it's not
really clear why this is dead code. I've added that.
-Daniel

> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 72 ++----------------------------------
>  1 file changed, 4 insertions(+), 68 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index df47031..38c2909 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9632,69 +9632,6 @@ static int intel_queue_mmio_flip(struct drm_device *dev,
>  	return 0;
>  }
>  
> -static int intel_gen9_queue_flip(struct drm_device *dev,
> -				 struct drm_crtc *crtc,
> -				 struct drm_framebuffer *fb,
> -				 struct drm_i915_gem_object *obj,
> -				 struct intel_engine_cs *ring,
> -				 uint32_t flags)
> -{
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> -	uint32_t plane = 0, stride;
> -	int ret;
> -
> -	switch(intel_crtc->pipe) {
> -	case PIPE_A:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_A;
> -		break;
> -	case PIPE_B:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_B;
> -		break;
> -	case PIPE_C:
> -		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_C;
> -		break;
> -	default:
> -		WARN_ONCE(1, "unknown plane in flip command\n");
> -		return -ENODEV;
> -	}
> -
> -	switch (obj->tiling_mode) {
> -	case I915_TILING_NONE:
> -		stride = fb->pitches[0] >> 6;
> -		break;
> -	case I915_TILING_X:
> -		stride = fb->pitches[0] >> 9;
> -		break;
> -	default:
> -		WARN_ONCE(1, "unknown tiling in flip command\n");
> -		return -ENODEV;
> -	}
> -
> -	ret = intel_ring_begin(ring, 10);
> -	if (ret)
> -		return ret;
> -
> -	intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
> -	intel_ring_emit(ring, DERRMR);
> -	intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE |
> -				DERRMR_PIPEB_PRI_FLIP_DONE |
> -				DERRMR_PIPEC_PRI_FLIP_DONE));
> -	intel_ring_emit(ring, MI_STORE_REGISTER_MEM_GEN8(1) |
> -			      MI_SRM_LRM_GLOBAL_GTT);
> -	intel_ring_emit(ring, DERRMR);
> -	intel_ring_emit(ring, ring->scratch.gtt_offset + 256);
> -	intel_ring_emit(ring, 0);
> -
> -	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane);
> -	intel_ring_emit(ring, stride << 6 | obj->tiling_mode);
> -	intel_ring_emit(ring, intel_crtc->unpin_work->gtt_offset);
> -
> -	intel_mark_page_flip_active(intel_crtc);
> -	__intel_ring_advance(ring);
> -
> -	return 0;
> -}
> -
>  static int intel_default_queue_flip(struct drm_device *dev,
>  				    struct drm_crtc *crtc,
>  				    struct drm_framebuffer *fb,
> @@ -12994,9 +12931,6 @@ static void intel_init_display(struct drm_device *dev)
>  			valleyview_modeset_global_resources;
>  	}
>  
> -	/* Default just returns -ENODEV to indicate unsupported */
> -	dev_priv->display.queue_flip = intel_default_queue_flip;
> -
>  	switch (INTEL_INFO(dev)->gen) {
>  	case 2:
>  		dev_priv->display.queue_flip = intel_gen2_queue_flip;
> @@ -13019,8 +12953,10 @@ static void intel_init_display(struct drm_device *dev)
>  		dev_priv->display.queue_flip = intel_gen7_queue_flip;
>  		break;
>  	case 9:
> -		dev_priv->display.queue_flip = intel_gen9_queue_flip;
> -		break;
> +		/* Drop through - unsupported since execlist only. */
> +	default:
> +		/* Default just returns -ENODEV to indicate unsupported */
> +		dev_priv->display.queue_flip = intel_default_queue_flip;
>  	}
>  
>  	intel_panel_init_backlight_funcs(dev);
> -- 
> 2.2.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin Feb. 11, 2015, 9:58 a.m. UTC | #2
On 02/11/2015 07:40 AM, Daniel Vetter wrote:
> On Tue, Feb 10, 2015 at 05:16:12PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Therefore remove dead code.
>
> Commit message should state that skl requires execlist, otherwise it's not
> really clear why this is dead code. I've added that.

Ah yes, don't know how I forgot to put that in. Sorry and thanks for 
fixing it up.

Regards,

Tvrtko

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index df47031..38c2909 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9632,69 +9632,6 @@  static int intel_queue_mmio_flip(struct drm_device *dev,
 	return 0;
 }
 
-static int intel_gen9_queue_flip(struct drm_device *dev,
-				 struct drm_crtc *crtc,
-				 struct drm_framebuffer *fb,
-				 struct drm_i915_gem_object *obj,
-				 struct intel_engine_cs *ring,
-				 uint32_t flags)
-{
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	uint32_t plane = 0, stride;
-	int ret;
-
-	switch(intel_crtc->pipe) {
-	case PIPE_A:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_A;
-		break;
-	case PIPE_B:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_B;
-		break;
-	case PIPE_C:
-		plane = MI_DISPLAY_FLIP_SKL_PLANE_1_C;
-		break;
-	default:
-		WARN_ONCE(1, "unknown plane in flip command\n");
-		return -ENODEV;
-	}
-
-	switch (obj->tiling_mode) {
-	case I915_TILING_NONE:
-		stride = fb->pitches[0] >> 6;
-		break;
-	case I915_TILING_X:
-		stride = fb->pitches[0] >> 9;
-		break;
-	default:
-		WARN_ONCE(1, "unknown tiling in flip command\n");
-		return -ENODEV;
-	}
-
-	ret = intel_ring_begin(ring, 10);
-	if (ret)
-		return ret;
-
-	intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
-	intel_ring_emit(ring, DERRMR);
-	intel_ring_emit(ring, ~(DERRMR_PIPEA_PRI_FLIP_DONE |
-				DERRMR_PIPEB_PRI_FLIP_DONE |
-				DERRMR_PIPEC_PRI_FLIP_DONE));
-	intel_ring_emit(ring, MI_STORE_REGISTER_MEM_GEN8(1) |
-			      MI_SRM_LRM_GLOBAL_GTT);
-	intel_ring_emit(ring, DERRMR);
-	intel_ring_emit(ring, ring->scratch.gtt_offset + 256);
-	intel_ring_emit(ring, 0);
-
-	intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane);
-	intel_ring_emit(ring, stride << 6 | obj->tiling_mode);
-	intel_ring_emit(ring, intel_crtc->unpin_work->gtt_offset);
-
-	intel_mark_page_flip_active(intel_crtc);
-	__intel_ring_advance(ring);
-
-	return 0;
-}
-
 static int intel_default_queue_flip(struct drm_device *dev,
 				    struct drm_crtc *crtc,
 				    struct drm_framebuffer *fb,
@@ -12994,9 +12931,6 @@  static void intel_init_display(struct drm_device *dev)
 			valleyview_modeset_global_resources;
 	}
 
-	/* Default just returns -ENODEV to indicate unsupported */
-	dev_priv->display.queue_flip = intel_default_queue_flip;
-
 	switch (INTEL_INFO(dev)->gen) {
 	case 2:
 		dev_priv->display.queue_flip = intel_gen2_queue_flip;
@@ -13019,8 +12953,10 @@  static void intel_init_display(struct drm_device *dev)
 		dev_priv->display.queue_flip = intel_gen7_queue_flip;
 		break;
 	case 9:
-		dev_priv->display.queue_flip = intel_gen9_queue_flip;
-		break;
+		/* Drop through - unsupported since execlist only. */
+	default:
+		/* Default just returns -ENODEV to indicate unsupported */
+		dev_priv->display.queue_flip = intel_default_queue_flip;
 	}
 
 	intel_panel_init_backlight_funcs(dev);