summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-04-20 01:55:57 -0700
committerKeith Packard <keithp@keithp.com>2008-04-20 01:56:02 -0700
commit21dbba5a227e20dd64ce300cc78927e139a684dd (patch)
treea064bd66f7d4438f24603acffd02fb4db1cb11e0
parent1ad1bd5bd95db71500edfcea8b46421d7f3cdb15 (diff)
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.
-rw-r--r--shared-core/i915_irq.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index a9b67a9c..2aa0d455 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -279,16 +279,29 @@ static void i915_vblank_tasklet(struct drm_device *dev)
}
if (init_drawrect) {
- 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();
+ int width = sarea_priv->width;
+ int height = sarea_priv->height;
+ if (IS_I965G(dev)) {
+ BEGIN_LP_RING(4);
+
+ OUT_RING(GFX_OP_DRAWRECT_INFO_I965);
+ OUT_RING(0);
+ OUT_RING(((width - 1) & 0xffff) | ((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(((width - 1) & 0xffff) | ((height - 1) << 16));
+ OUT_RING(0);
+ OUT_RING(0);
+
+ ADVANCE_LP_RING();
+ }
sarea_priv->ctxOwner = DRM_KERNEL_CONTEXT;