From 8d7a0ccd4f674659eb781def2cfdc3a6e5a219ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 11 Jun 2007 17:33:07 -0700 Subject: [PATCH] Clean up some nits in i915_video.c setup. - The screen dimensions were used for the clipping despite drawing being done to any pixmap, not necessarily the screen. - One piece of state setup was not documented anywhere, and isn't used in other 3d hardware paths that also work. - A 3DSTATE_MODES_1 command (830-class only) was issued even though it no longer exists. --- src/i915_video.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/i915_video.c b/src/i915_video.c index e837097d..e4e0f1a4 100644 --- a/src/i915_video.c +++ b/src/i915_video.c @@ -83,7 +83,7 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, pI830->last_3d = LAST_3D_VIDEO; - BEGIN_LP_RING(24); + BEGIN_LP_RING(20); /* flush map & render cache */ OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE); @@ -94,16 +94,11 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, OUT_RING(DRAW_DITHER_OFS_X(pPixmap->drawable.x & 3) | DRAW_DITHER_OFS_Y(pPixmap->drawable.y & 3)); OUT_RING(0x00000000); /* ymin, xmin */ - OUT_RING((pScrn->virtualX - 1) | - (pScrn->virtualY - 1) << 16); /* ymax, xmax */ + OUT_RING((pPixmap->drawable.width - 1) | + (pPixmap->drawable.height - 1) << 16); /* ymax, xmax */ OUT_RING(0x00000000); /* yorigin, xorigin */ OUT_RING(MI_NOOP); - OUT_RING(0x7c000003); /* unknown command */ - OUT_RING(0x7d070000); - OUT_RING(0x00000000); - OUT_RING(0x68000002); - OUT_RING(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) | I1_LOAD_S(4) | I1_LOAD_S(5) | I1_LOAD_S(6) | 3); s2 = S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D);