summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 380f02c)
raw | patch | inline | side by side (parent: 380f02c)
author | Rob Clark <rob@ti.com> | |
Sat, 16 Jun 2012 02:49:55 +0000 (02:49 +0000) | ||
committer | Nikhil Devshatwar <a0132237@ti.com> | |
Wed, 15 May 2013 12:55:54 +0000 (18:25 +0530) |
src/omap_dri2.c | patch | blob | history | |
src/omap_exa.c | patch | blob | history | |
src/omap_exa.h | patch | blob | history |
diff --git a/src/omap_dri2.c b/src/omap_dri2.c
index f7ef4f8c4d9dc52523d32a43a176ba75f9858a39..7911e08344f72da3db78e9b1ce72061bcc21f632 100644 (file)
--- a/src/omap_dri2.c
+++ b/src/omap_dri2.c
OMAPDRI2BufferPtr buf;
PixmapPtr pPixmap;
int bpp, extraCount = 0, ew = width, eh = height;
+ unsigned usage_hint = 0;
DEBUG_MSG("pDraw=%p, attachment=%d, format=%08x",
pDraw, attachment, format);
- switch(format) {
- case fourcc_code('I','4','2','0'):
- case fourcc_code('Y','V','1','2'):
- extraCount++;
- ew /= 2;
+#define MULTI_PLANAR 0
+ if (MULTI_PLANAR) {
+ switch(format) {
+ case fourcc_code('I','4','2','0'):
+ case fourcc_code('Y','V','1','2'):
+ extraCount++;
+ ew /= 2;
/* fallthru */
- case fourcc_code('N','V','1','2'):
- extraCount++;
- eh /= 2;
- bpp = 8;
- break;
- case fourcc_code('U','Y','V','Y'):
- case fourcc_code('Y','U','Y','2'):
- bpp = 16;
- break;
- default:
- return NULL;
+ case fourcc_code('N','V','1','2'):
+ extraCount++;
+ eh /= 2;
+ bpp = 8;
+ break;
+ case fourcc_code('U','Y','V','Y'):
+ case fourcc_code('Y','U','Y','2'):
+ bpp = 16;
+ break;
+ default:
+ return NULL;
+ }
+ } else {
+ switch(format) {
+ case fourcc_code('I','4','2','0'):
+ case fourcc_code('Y','V','1','2'):
+ case fourcc_code('N','V','1','2'):
+ bpp = 8;
+ usage_hint = OMAP_CREATE_PIXMAP_420;
+ break;
+ case fourcc_code('U','Y','V','Y'):
+ case fourcc_code('Y','U','Y','2'):
+ bpp = 16;
+ break;
+ default:
+ return NULL;
+ }
}
/* main buffer, luma buffer in case of multi-planar.. */
- pPixmap = pScreen->CreatePixmap(pScreen, width, height, bpp, 0);
+ pPixmap = pScreen->CreatePixmap(pScreen, width, height, bpp, usage_hint);
buf = createbuf(pDraw, pPixmap, attachment, format);
diff --git a/src/omap_exa.c b/src/omap_exa.c
index 33844be6bbd0e5d3832258bc8d383bf27b95eeec..79648794c07ae3dd3029bf91f7a62f7bd1513cd8 100644 (file)
--- a/src/omap_exa.c
+++ b/src/omap_exa.c
pPixmap->devKind = OMAPCalculateStride(width, bitsPerPixel);
}
+ /* if this is a planar 420 YUV format, then the bpp field only
+ * represents the Y plane.. increase the height to account for
+ * the U and V..
+ */
+ if (pPixmap->usage_hint & OMAP_CREATE_PIXMAP_420)
+ height += (height + 1) / 2;
+
size = pPixmap->devKind * height;
if ((!priv->bo) || (omap_bo_size(priv->bo) != size)) {
diff --git a/src/omap_exa.h b/src/omap_exa.h
index 94ac9cc7e6922553b631dc21c8e4cc2973606a33..fba979deaaa64d99e6139fd67b350407f0ca3c58 100644 (file)
--- a/src/omap_exa.h
+++ b/src/omap_exa.h
#define OMAP_CREATE_PIXMAP_SCANOUT 0x80000000
#define OMAP_CREATE_PIXMAP_TILED 0x40000000
+#define OMAP_CREATE_PIXMAP_420 0x20000000
void * OMAPCreatePixmap (ScreenPtr pScreen, int width, int height,