diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2009-08-11 16:06:45 +0200 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-10-05 13:08:42 -0700 |
commit | bb04e184fdc55325a362ebf291e16a7c112a5f1d (patch) | |
tree | 5592c2c9c13eac8563cd48322e9321c2fe3fa9cb /src/i830_video.h | |
parent | 60462eb5b5c1931beecc1ed2d32f91090f64174c (diff) |
Xv: rework overlay buffer management
The basic idea is to only pin the buffer into the gtt when
the overlay hw is actually using it. This results in a few changes:
- Unify data copied/buffer handling with textured video. Now offsets
are always buffer relative and we just use drm_bo_map to access a
buffer.
- Implement double buffering using two bo's. This is necessary because
we can't pin the same buffer to the gtt and map it as normal memory.
- Kill XV_DOUBLE_BUFFER. With the above changes, overlay video is always
doubel buffered.
There is still the XvMC passthrough case, which makes the code slightly
ugly. Unfortunately we can't get at the bo behind this buffer.
Changes since the last review-round:
- Don't overallocate by a factor of 2.
- Prevent possible use-after-free issue.
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/i830_video.h')
-rw-r--r-- | src/i830_video.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/i830_video.h b/src/i830_video.h index 9093d5d5..cdccd162 100644 --- a/src/i830_video.h +++ b/src/i830_video.h @@ -32,14 +32,11 @@ typedef struct { uint32_t UBufOffset; uint32_t VBufOffset; - unsigned char currentBuf; - int brightness; int contrast; int saturation; xf86CrtcPtr current_crtc; xf86CrtcPtr desired_crtc; - int doubleBuffer; RegionRec clip; uint32_t colorKey; @@ -54,7 +51,10 @@ typedef struct { uint32_t videoStatus; Time offTime; Time freeTime; - drm_intel_bo *buf; /** YUV data buffer */ + /** YUV data buffers */ + drm_intel_bo *buf; /* current buffer to draw into */ + drm_intel_bo *oldBuf; /* old buffer, may be in use by the overlay hw */ + Bool oldBuf_pinned; /* only actually pinned when in use by the overlay hw */ Bool overlayOK; int oneLineMode; |