[Intel-gfx] [PATCH 09/22] Xv: kill hw double buffering logic

Daniel Vetter daniel at ffwll.ch
Thu Jul 2 15:03:38 CEST 2009


On Thu, Jul 02, 2009 at 02:15:42PM +0200, Daniel Vetter wrote:
> 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 these 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.

If you want, I could add this to the changelog.

-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: 079 365 57 48



More information about the Intel-gfx mailing list