aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stultz2018-04-02 22:37:33 -0500
committerRobert Foss2018-04-03 03:19:21 -0500
commit35affe89d5f617a972b1cfee00c51cbe9e7c64a2 (patch)
treeaca642a9a3089454cafdb1dd377b3e900959651a
parent8ec043ecead3aacc017464d5eb133618909f723d (diff)
downloadexternal-libdrm-35affe89d5f617a972b1cfee00c51cbe9e7c64a2.tar.gz
external-libdrm-35affe89d5f617a972b1cfee00c51cbe9e7c64a2.tar.xz
external-libdrm-35affe89d5f617a972b1cfee00c51cbe9e7c64a2.zip
libdrm: gralloc_handle.h: Fix build issue with Android
In trying to integrate the new gralloc_handle.h with the drm_hwcomposer, I started seeing the following compilation errors: In file included from external/drm_hwcomposer/platformdrmgeneric.cpp:28: external/libdrm/android/gralloc_handle.h:108:9: error: cannot initialize return object of type 'native_handle_t *' (aka 'native_handle *') with an lvalue of type 'struct gralloc_handle_t *' return handle; ^~~~~~ 1 error generated. This seems to be due to the gralloc_handle_create() definition needs to return a native_handle_t * type, rather then a gralloc_handle_t *, which is what the code actually returns. After talking w/ Rob Herring, having the code return the native handle should be the proper fix, so that is what this patch changes. Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Stefan Schake <stschake@gmail.com> Cc: Robert Foss <robert.foss@collabora.com> Cc: Sean Paul <seanpaul@google.com> Cc: Rob Herring <robh@kernel.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Reviewed-by: Robert Foss <robert.foss@collabora.com>
-rw-r--r--android/gralloc_handle.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h
index 9cb5a5d7..bcf753da 100644
--- a/android/gralloc_handle.h
+++ b/android/gralloc_handle.h
@@ -105,7 +105,7 @@ static inline native_handle_t *gralloc_handle_create(int32_t width,
105 handle->usage = usage; 105 handle->usage = usage;
106 handle->prime_fd = -1; 106 handle->prime_fd = -1;
107 107
108 return handle; 108 return nhandle;
109} 109}
110 110
111#endif 111#endif