From 9367509c6c4d8e83cdb62b53dca701f2592cecfa Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Tue, 31 Dec 2013 18:51:04 +0100 Subject: gralloc: Correct stride for maguro Signed-off-by: Paul Kocialkowski --- modules/gralloc/Android.mk | 4 ++++ modules/gralloc/gralloc.cpp | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk index bfc401b..c585b33 100644 --- a/modules/gralloc/Android.mk +++ b/modules/gralloc/Android.mk @@ -34,4 +34,8 @@ ifeq ($(BOARD_HTC_3D_SUPPORT),true) LOCAL_CFLAGS += -DHTC_3D_SUPPORT endif +ifeq ($(TARGET_DEVICE),maguro) + LOCAL_CFLAGS += -DTARGET_DEVICE_MAGURO +endif + include $(BUILD_SHARED_LIBRARY) diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp index 796948d..730c040 100644 --- a/modules/gralloc/gralloc.cpp +++ b/modules/gralloc/gralloc.cpp @@ -237,6 +237,15 @@ static int gralloc_alloc(alloc_device_t* dev, int err; if (usage & GRALLOC_USAGE_HW_FB) { err = gralloc_alloc_framebuffer(dev, size, usage, pHandle); + +#ifdef TARGET_DEVICE_MAGURO + // PVR requires stride to be a multiple of 32 + // omap kernel drivers set line_length accordingly + // so we need to correct the stride here + // in case framebuffer width is not a multiple of 32 + stride += (31); + stride &= ~(31); +#endif } else { err = gralloc_alloc_buffer(dev, size, usage, pHandle); } -- cgit v1.1