summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-01-08 15:54:15 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-01-12 14:52:37 +0200
commit9eb3db0f74f005441ce8ff4554a82e1cea91527f (patch)
tree2905a62e7b486a70d77552d3a142825e5067766e /libkms++
parentd8db8461d47ac76b4e6d661c72328624a589327b (diff)
DumbFB: fix dumb buffer alloc for omap NV12
Dividing the bitspp with xsub works better than dividing the width, as otherwise the buffer stride will get aligned easily quite a bit. This is somewhat OMAP specific fix/work-around, but then, it's not clear how NV12 buffer sizes should be calculated anyway.
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/dumbframebuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libkms++/dumbframebuffer.cpp b/libkms++/dumbframebuffer.cpp
index cc97dde..4fae49e 100644
--- a/libkms++/dumbframebuffer.cpp
+++ b/libkms++/dumbframebuffer.cpp
@@ -80,9 +80,9 @@ void DumbFramebuffer::Create()
/* create dumb buffer */
struct drm_mode_create_dumb creq = drm_mode_create_dumb();
- creq.width = width() / pi.xsub;
+ creq.width = width();
creq.height = height() / pi.ysub;
- creq.bpp = pi.bitspp;
+ creq.bpp = pi.bitspp / pi.xsub;
r = drmIoctl(card().fd(), DRM_IOCTL_MODE_CREATE_DUMB, &creq);
if (r)
throw invalid_argument(string("DRM_IOCTL_MODE_CREATE_DUMB failed") + strerror(errno));