From 9197ce090bfd428e80592e681452e8cde746d9a3 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 14 Jul 2014 15:02:56 +0100 Subject: 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 --- src/armada_drm_xv.c | 11 ++++++++--- 1 file 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; -- cgit v1.2.3