1From dfe8ef9123936d2c1d5da34f63f661849171d5ef Mon Sep 17 00:00:00 2001
2From: Gary Bisson <gary.bisson@boundarydevices.com>
3Date: Sun, 3 Oct 2021 16:39:29 -0700
4Subject: [PATCH] Fix ion.h header inclusion to be standard
5
6NXP "solution" was to manually copy the header to include/linux.
7Let's point the Makefile to the proper (mainline) location instead:
8https://elixir.bootlin.com/linux/v4.17/source/drivers/staging/android/uapi/ion.h
9
10Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
11Signed-off-by: Chris Dimich <chris.dimich@boundarydevices.com>
12---
13 Makefile_G1G2                                             | 4 ++--
14 Makefile_H1                                               | 4 ++--
15 decoder_sw/software/linux/dwl/dwl_linux.c                 | 2 +-
16 h1_encoder/software/linux_reference/ewl/ewl_x280_common.c | 2 +-
17 4 files changed, 6 insertions(+), 6 deletions(-)
18
19diff --git a/Makefile_G1G2 b/Makefile_G1G2
20index 8f83391..25884fa 100755
21--- a/Makefile_G1G2
22+++ b/Makefile_G1G2
23@@ -10,8 +10,8 @@ INCLUDE_HEADERS = -I./decoder_sw -I$(SOURCE_ROOT)/source/inc -I$(SOURCE_ROOT)/so
24
25 INCLUDE_HEADERS += -I$(SOURCE_ROOT)/linux/memalloc
26 #INCLUDE_HEADERS += -I$(SOURCE_ROOT)/linux/ldriver
27-#INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
28-INCLUDE_HEADERS += -I$(SDKTARGETSYSROOT)/usr/include/imx
29+INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
30+INCLUDE_HEADERS += -I$(LINUX_KERNEL_ROOT)/drivers/staging/android/uapi
31
32 CFLAGS += -DDEC_MODULE_PATH=\"/dev/mxc_hantro\" -DUSE_FAKE_RFC_TABLE -DFIFO_DATATYPE=void* -DNDEBUG -DDOWN_SCALER \
33            -DUSE_EXTERNAL_BUFFER -DUSE_FAST_EC -DUSE_VP9_EC -DGET_FREE_BUFFER_NON_BLOCK \
34diff --git a/Makefile_H1 b/Makefile_H1
35index 0979571..479940a 100755
36--- a/Makefile_H1
37+++ b/Makefile_H1
38@@ -17,8 +17,8 @@ ENV = -DENC_MODULE_PATH=\\\"/dev/mxc_hantro_h1\\\"
39 #ENV += -DSDRAM_LM_BASE=0x00000000
40 ENV += -DEWL_NO_HW_TIMEOUT
41 ENV += -DUSE_ION
42-#ENV += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
43-ENV += -I$(SDKTARGETSYSROOT)/usr/include/imx
44+ENV += -I$(LINUX_KERNEL_ROOT)/include/uapi -I$(LINUX_KERNEL_ROOT)/include
45+ENV += -I$(LINUX_KERNEL_ROOT)/drivers/staging/android/uapi
46
47 ifeq ($(CFG_SECURE_DATA_PATH), y)
48 ENV += -DCFG_SECURE_DATA_PATH
49diff --git a/decoder_sw/software/linux/dwl/dwl_linux.c b/decoder_sw/software/linux/dwl/dwl_linux.c
50index 7d5e33b..c0e5727 100755
51--- a/decoder_sw/software/linux/dwl/dwl_linux.c
52+++ b/decoder_sw/software/linux/dwl/dwl_linux.c
53@@ -50,7 +50,7 @@
54 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
55 #include <linux/dma-heap.h>
56 #else
57-#include <linux/ion.h>
58+#include <ion.h>
59 #endif
60 #ifdef ANDROID
61 #include <linux/mxc_ion.h>
62diff --git a/h1_encoder/software/linux_reference/ewl/ewl_x280_common.c b/h1_encoder/software/linux_reference/ewl/ewl_x280_common.c
63index 312e4cc..70630c3 100755
64--- a/h1_encoder/software/linux_reference/ewl/ewl_x280_common.c
65+++ b/h1_encoder/software/linux_reference/ewl/ewl_x280_common.c
66@@ -52,7 +52,7 @@
67 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
68 #include <linux/dma-heap.h>
69 #else
70-#include <linux/ion.h>
71+#include <ion.h>
72 #endif
73 #include <linux/dma-buf.h>
74 #include <linux/version.h>
75--
762.31.1
77
78