summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-07-14 15:02:56 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-07-23 12:23:31 +0100
commit9197ce090bfd428e80592e681452e8cde746d9a3 (patch)
tree2c6584d6d32536768955d2a9158acbfb79e77dc0
parentdfdbdf253c2893050551b88fecd6ec6cef6015d5 (diff)
downloadxf86-video-armada-9197ce090bfd428e80592e681452e8cde746d9a3.tar.gz
Allocate Xv BOs using 16-bpp allocations
Use 16-bpp BO allocations to allocate Xv display buffers, rather than 32-bpp and tweaking the height appropriately. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--src/armada_drm_xv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/armada_drm_xv.c b/src/armada_drm_xv.c
index 146bd26..1a41586 100644
--- a/src/armada_drm_xv.c
+++ b/src/armada_drm_xv.c
@@ -415,15 +415,20 @@ static int armada_drm_bufs_alloc(struct drm_xv *drmxv)
{
struct drm_armada_bufmgr *bufmgr = drmxv->bufmgr;
uint32_t width = drmxv->width;
- uint32_t height = drmxv->image_size / width / 4;
+ uint32_t height = drmxv->image_size / width / 2;
unsigned i;
for (i = 0; i < ARRAY_SIZE(drmxv->bufs); i++) {
struct drm_armada_bo *bo;
- bo = drm_armada_bo_dumb_create(bufmgr, width, height, 32);
+ bo = drm_armada_bo_dumb_create(bufmgr, width, height, 16);
+ if (!bo) {
+ armada_drm_bufs_free(drmxv);
+ return BadAlloc;
+ }
+
drmxv->bufs[i].bo = bo;
- if (!bo || drm_armada_bo_map(bo) ||
+ if (drm_armada_bo_map(bo) ||
!armada_drm_create_fbid(drmxv, bo, &drmxv->bufs[i].fb_id)) {
armada_drm_bufs_free(drmxv);
return BadAlloc;