Add MR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT

If set will change MDP_FB_FORMAT to the custom Pixel Format specified in BoardConfig.mk
This commit is contained in:
KINGbabasula
2014-08-19 10:26:33 +02:00
parent 9744984f8f
commit 4dbeecb7af
2 changed files with 7 additions and 0 deletions

View File

@@ -171,6 +171,9 @@ ifneq ($(MR_QCOM_OVERLAY_HEADER),)
else
$(error MR_USE_QCOM_OVERLAY is true but MR_QCOM_OVERLAY_HEADER was not specified!)
endif
ifneq ($(MR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT),)
LOCAL_CFLAGS += -DMR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT=$(MR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT)
endif
endif
ifeq ($(MR_CONTINUOUS_FB_UPDATE),true)

View File

@@ -130,11 +130,15 @@ static int allocate_overlay(struct fb_qcom_overlay_data *data, int fd, int width
overlay.src.width = ALIGN(width, 32);
overlay.src.height = height;
#ifdef MR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT
overlay.src.format = MR_QCOM_OVERLAY_CUSTOM_PIXEL_FORMAT;
#else
/* We can't set format here because their IDs are different on aosp and CM kernels.
* There is literally just one line different between their headers, and it breaks it.
* MDP_FB_FORMAT works because it translates to MDP_IMGTYPE2_START, which is the same
* on both. It means it will take the format from the framebuffer. */
overlay.src.format = MDP_FB_FORMAT;
#endif
overlay.src_rect.w = width;
overlay.src_rect.h = height;