Merge from kdrive: use RECT_PRIM to avoid tearing in xvideo.

This commit is contained in:
Eric Anholt 2006-02-10 09:00:02 +00:00
parent efc3fab7f4
commit a8cec1b656
2 changed files with 33 additions and 24 deletions

View File

@ -1,3 +1,10 @@
2006-02-09 Keith Packard <keithp@keithp.com>
reviewed by: Eric Anholt <anholt@FreeBSD.org>
* ati_video.c: (RadeonDisplayVideo):
Replace TRI_FAN with RECT_LIST to eliminate tearing
2005-08-07 Keith Packard <keithp@keithp.com>
* ati_video.c: (RadeonDisplayVideo):

View File

@ -440,52 +440,54 @@ RadeonDisplayVideo(KdScreenInfo *screen, ATIPortPrivPtr pPortPriv)
pPortPriv->src_h / pPortPriv->dst_h;
srcw = pPortPriv->src_w * (dstw / pPortPriv->dst_w);
srch = pPortPriv->src_h * (dsth / pPortPriv->dst_h);
vtx[0].x.f = dstX;
vtx[0].y.f = dstY;
vtx[0].s0.f = srcX;
vtx[0].t0.f = srcY;
vtx[1].x.f = dstX;
/*
* rectangle:
*
* +---------2
* | |
* | |
* 0---------1
*/
vtx[0].x.f = dstX;
vtx[0].y.f = dstY + dsth;
vtx[0].s0.f = srcX;
vtx[0].t0.f = srcY + srch;
vtx[1].x.f = dstX + dstw;
vtx[1].y.f = dstY + dsth;
vtx[1].s0.f = srcX;
vtx[1].s0.f = srcX + srcw;
vtx[1].t0.f = srcY + srch;
vtx[2].x.f = dstX + dstw;
vtx[2].y.f = dstY + dsth;
vtx[2].y.f = dstY;
vtx[2].s0.f = srcX + srcw;
vtx[2].t0.f = srcY + srch;
vtx[3].x.f = dstX + dstw;
vtx[3].y.f = dstY;
vtx[3].s0.f = srcX + srcw;
vtx[3].t0.f = srcY;
vtx[2].t0.f = srcY;
if (atic->is_r100) {
BEGIN_DMA(4 * VTX_DWORD_COUNT + 3);
BEGIN_DMA(3 * VTX_DWORD_COUNT + 3);
OUT_RING(DMA_PACKET3(RADEON_CP_PACKET3_3D_DRAW_IMMD,
4 * VTX_DWORD_COUNT + 2));
3 * VTX_DWORD_COUNT + 2));
OUT_RING(RADEON_CP_VC_FRMT_XY |
RADEON_CP_VC_FRMT_ST0);
OUT_RING(RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN |
OUT_RING(RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST |
RADEON_CP_VC_CNTL_PRIM_WALK_RING |
RADEON_CP_VC_CNTL_MAOS_ENABLE |
RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE |
(4 << RADEON_CP_VC_CNTL_NUM_SHIFT));
(3 << RADEON_CP_VC_CNTL_NUM_SHIFT));
} else {
BEGIN_DMA(4 * VTX_DWORD_COUNT + 2);
BEGIN_DMA(3 * VTX_DWORD_COUNT + 2);
OUT_RING(DMA_PACKET3(R200_CP_PACKET3_3D_DRAW_IMMD_2,
4 * VTX_DWORD_COUNT + 1));
OUT_RING(RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN |
3 * VTX_DWORD_COUNT + 1));
OUT_RING(RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST |
RADEON_CP_VC_CNTL_PRIM_WALK_RING |
(4 << RADEON_CP_VC_CNTL_NUM_SHIFT));
(3 << RADEON_CP_VC_CNTL_NUM_SHIFT));
}
VTX_OUT(vtx[0]);
VTX_OUT(vtx[1]);
VTX_OUT(vtx[2]);
VTX_OUT(vtx[3]);
END_DMA();
pBox++;