Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to explicitely set if heap_id_mask or heap_mask should be used. #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ endif
ifeq ($(MR_QCOM_OVERLAY_USE_VSYNC),true)
common_C_FLAGS += -DMR_QCOM_OVERLAY_USE_VSYNC
endif
ifneq ($(MR_QCOM_OVERLAY_HEAP_ID_MASK),)
common_C_FLAGS += -DMR_QCOM_OVERLAY_HEAP_ID_MASK=$(MR_QCOM_OVERLAY_HEAP_ID_MASK)
endif
endif


Expand Down
19 changes: 15 additions & 4 deletions lib/framebuffer_qcom_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,22 @@ static int alloc_ion_mem(struct fb_qcom_overlay_data *data, unsigned int size)
ionAllocData.len = size;
ionAllocData.align = sysconf(_SC_PAGESIZE);

// are you kidding me -.-
#if (PLATFORM_SDK_VERSION >= 21)
ionAllocData.heap_id_mask =
// Ability to explicitely set if heap_id_mask or heap_mask should be used.
#ifdef MR_QCOM_OVERLAY_HEAP_ID_MASK
#if MR_QCOM_OVERLAY_HEAP_ID_MASK == 1
ionAllocData.heap_id_mask =
#elif MR_QCOM_OVERLAY_HEAP_ID_MASK == 2
ionAllocData.heap_mask =
#else
#error Please set MR_QCOM_OVERLAY_HEAP_ID_MASK to either 1 or 2, see source for details.
#endif
#else
ionAllocData.heap_mask =
// are you kidding me -.-
#if (PLATFORM_SDK_VERSION >= 21)
ionAllocData.heap_id_mask =
#else
ionAllocData.heap_mask =
#endif
#endif
ION_HEAP(ION_IOMMU_HEAP_ID) |
ION_HEAP(21); // ION_SYSTEM_CONTIG_HEAP_ID
Expand Down