linux: version release v4.1.4
[ion] support get ion total size [fb_ili9341]fb_ili9341 bring up Change-Id: I41cf49172640923ebc64947cbc9a23cad3d05a46
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ -I../../../../../usr/include/
|
||||
CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g
|
||||
|
||||
TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test
|
||||
TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test iongetsize_test
|
||||
|
||||
all: $(TEST_GEN_FILES)
|
||||
|
||||
@ -18,3 +18,4 @@ include ../../lib.mk
|
||||
$(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c
|
||||
$(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c
|
||||
$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c ipcsocket.c
|
||||
$(OUTPUT)/iongetsize_test: iongetsize_test.c
|
||||
@ -0,0 +1,38 @@
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "ion_cvitek.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret, ionfd;
|
||||
|
||||
struct ion_custom_data custom;
|
||||
struct cvitek_heap_info head_info;
|
||||
|
||||
ionfd = open("/dev/ion", O_RDWR);
|
||||
if (ionfd < 0) {
|
||||
fprintf(stderr, "<%s>: Failed to open ion client:\n",
|
||||
__func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&custom, 0, sizeof(custom));
|
||||
custom.cmd = ION_IOC_CVITEK_GET_HEAP_INFO;
|
||||
custom.arg = &head_info;
|
||||
head_info.id = 0;
|
||||
ret = ioctl(ionfd, ION_IOC_CUSTOM, &custom);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "<%s>: Failed: ION_IOC_CUSTOM\n",
|
||||
__func__);
|
||||
goto exit;
|
||||
}
|
||||
fprintf(stderr, "head_id=%d, total_size=0x%lx, avail_size=0x%lx\n",
|
||||
head_info.id, head_info.total_size, head_info.avail_size);
|
||||
|
||||
exit:
|
||||
if (ionfd)
|
||||
close(ionfd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user