summaryrefslogtreecommitdiff
path: root/src/i965_video.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2009-08-11 16:06:36 +0200
committerEric Anholt <eric@anholt.net>2009-10-05 13:07:42 -0700
commit5ce944994d57176d0ddf6f6d7c7779fdfcf39cb8 (patch)
treeb1b7b21df87168a0d343f1354870a49776f3114c /src/i965_video.c
parent232418d72ee967a81e39481b9f2ee379cb685458 (diff)
Xv: kill hw double buffering logic
The idea for the hw double buffering support is to program two fixed buffers and then only switch buffers in the OCMD register. But the driver as-is always programs the new buffer address (in both register sets when double buffered). Therefore we gain nothing by using this hw capability. Scrap the software support for it. When double buffered, we now allocate just a buffer of size 2*size and switch between the two parts purely in software. To make reviewing this easier, I'll shortly explain the differences of how double-buffering (i.e. tear-free video) is achieved before and after this change: - When double buffer, allocate a buffer twice the size (unchanged). - Depending upon the currently shown buffer-half, copy the new frame into the other buffer-half. In the old code this is done by using the right set of buffer offsets, either *Buf0Offset or *Buf1Offset. The new code simply programs the offset for the right buffer-half into the single set of offsets. The end-result is unchanged. Now the big difference in hw-programming: Old: Programm new buffer offset into both sets of _hw_ buffer offset registers. Depending upon the current _sw_ buffer, select the _hw_ buffer and program this into the OCMD register. This just complicates matters unnecessarly. New: Just always use the hw buffer 0. And then it's again the same story in both old and new code: - Execute an overlay flip (MI_OVERLAY_FLIP) to read in the contents of the hw registers into the shadow hw registers (which are actually being used by the overlay, not the ones we write stuff into). This is synchronized with the respective crtc vblank by the hw. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/i965_video.c')
-rw-r--r--src/i965_video.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/i965_video.c b/src/i965_video.c
index 810b761b..423d48c9 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -997,12 +997,12 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
ErrorF ("INST_PM 0x%08x\n", INREG(INST_PM));
#endif
- src_surf_base[0] = pPriv->YBuf0offset;
- src_surf_base[1] = pPriv->YBuf0offset;
- src_surf_base[2] = pPriv->VBuf0offset;
- src_surf_base[3] = pPriv->VBuf0offset;
- src_surf_base[4] = pPriv->UBuf0offset;
- src_surf_base[5] = pPriv->UBuf0offset;
+ src_surf_base[0] = pPriv->YBufOffset;
+ src_surf_base[1] = pPriv->YBufOffset;
+ src_surf_base[2] = pPriv->VBufOffset;
+ src_surf_base[3] = pPriv->VBufOffset;
+ src_surf_base[4] = pPriv->UBufOffset;
+ src_surf_base[5] = pPriv->UBufOffset;
#if 0
ErrorF ("base 0 0x%x base 1 0x%x base 2 0x%x\n",
src_surf_base[0], src_surf_base[1], src_surf_base[2]);