Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec1f2815 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

libion: Support for old ION API

 * Kernel 3.0 doesn't have heap_mask or SYNC ioctl, so add a board flag
   so that proprietary code that uses the old kernel API directly still
   works.

Change-Id: I4227c79a5de46c60eeebd2e16ca88dd6d580916a
parent 91137e19
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,9 @@ ifneq ($(TARGET_BOARD_PLATFORM),omap3)
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
ifeq ($(BOARD_HAVE_OLD_ION_API),true)
LOCAL_CFLAGS += -DOLD_ION_API
endif
LOCAL_SRC_FILES := ion.c
LOCAL_MODULE := libion
LOCAL_MODULE_TAGS := optional
+6 −0
Original line number Diff line number Diff line
@@ -61,7 +61,9 @@ int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask,
        struct ion_allocation_data data = {
                .len = len,
                .align = align,
#ifndef OLD_ION_API
		.heap_mask = heap_mask,
#endif
                .flags = flags,
        };

@@ -149,8 +151,12 @@ int ion_import(int fd, int share_fd, struct ion_handle **handle)

int ion_sync_fd(int fd, int handle_fd)
{
#ifdef OLD_ION_API
    return 0;
#else
    struct ion_fd_data data = {
        .fd = handle_fd,
    };
    return ion_ioctl(fd, ION_IOC_SYNC, &data);
#endif
}