From 5411a9c5e97a6f3f18393f0bc18ca62ce1630b81 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 26 Aug 2014 12:01:19 +0100 Subject: Fix viv_map_user_memory() for 4.6.9 iMX GCABI The 4.6.9 iMX GCABI has a .physical member added to the MapUserMemory structure, which must be initialised to ~0 to map by virtual address. Introduce a new conditional "GCABI_MAPUSERMEMORY_HAS_PHYSICAL" to indicate the presence of this member and arrange to initialise it appropriately in viv_map_user_memory(). Signed-off-by: Russell King --- src/etnaviv/viv.c | 3 +++ src/include_imx6_v4_6_9/gc_abi.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/etnaviv/viv.c b/src/etnaviv/viv.c index b14341e..7a9e544 100644 --- a/src/etnaviv/viv.c +++ b/src/etnaviv/viv.c @@ -585,6 +585,9 @@ int viv_map_user_memory(struct viv_conn *conn, void *memory, size_t size, viv_us .u = { .MapUserMemory = { .memory = PTR_TO_VIV(memory), +#ifdef GCABI_MAPUSERMEMORY_HAS_PHYSICAL + .physical = ~0UL, +#endif .size = size } } diff --git a/src/include_imx6_v4_6_9/gc_abi.h b/src/include_imx6_v4_6_9/gc_abi.h index 3d220da..78dba92 100644 --- a/src/include_imx6_v4_6_9/gc_abi.h +++ b/src/include_imx6_v4_6_9/gc_abi.h @@ -43,6 +43,9 @@ #define GCABI_UINT64_POINTERS #define GCABI_UINT64_IOCTL_DATA +// Interface has a .physical member in MapUserMemory +#define GCABI_MAPUSERMEMORY_HAS_PHYSICAL + /* IOCTL structure for userspace driver*/ typedef struct { -- cgit