From: Keith Packard Date: Mon, 21 Apr 2008 06:27:24 +0000 (+1000) Subject: drm/i965: On I965, use correct 3DSTATE_DRAWING_RECTANGLE command in vblank X-Git-Tag: MMI-PSA29.97-13-9~35518^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a36b7dcc05bc4c4580f11cf78e95edfefa86b8a6;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/i965: On I965, use correct 3DSTATE_DRAWING_RECTANGLE command in vblank The batchbuffer submission paths were fixed to use the 965-specific command, but the vblank tasklet was not. When the older version is sent, the 965 will lock up. Signed-off-by: Dave Airlie --- diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c index 92653b38e64c..5a6f8309d8be 100644 --- a/drivers/char/drm/i915_irq.c +++ b/drivers/char/drm/i915_irq.c @@ -125,16 +125,26 @@ static void i915_vblank_tasklet(struct drm_device *dev) i915_kernel_lost_context(dev); - BEGIN_LP_RING(6); - - OUT_RING(GFX_OP_DRAWRECT_INFO); - OUT_RING(0); - OUT_RING(0); - OUT_RING(sarea_priv->width | sarea_priv->height << 16); - OUT_RING(sarea_priv->width | sarea_priv->height << 16); - OUT_RING(0); - - ADVANCE_LP_RING(); + if (IS_I965G(dev)) { + BEGIN_LP_RING(4); + + OUT_RING(GFX_OP_DRAWRECT_INFO_I965); + OUT_RING(0); + OUT_RING(((sarea_priv->width - 1) & 0xffff) | ((sarea_priv->height - 1) << 16)); + OUT_RING(0); + ADVANCE_LP_RING(); + } else { + BEGIN_LP_RING(6); + + OUT_RING(GFX_OP_DRAWRECT_INFO); + OUT_RING(0); + OUT_RING(0); + OUT_RING(sarea_priv->width | sarea_priv->height << 16); + OUT_RING(sarea_priv->width | sarea_priv->height << 16); + OUT_RING(0); + + ADVANCE_LP_RING(); + } sarea_priv->ctxOwner = DRM_KERNEL_CONTEXT;