Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-gbm_gralloc: Commit

external/gbm_gralloc


Commit MetaInfo

Revision22d8ed6e3de7537fd960c44207dfa347edafbcd5 (tree)
Zeit2019-01-14 14:13:50
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Let gbm_free() return a value

So that gralloc_gbm_handle_unregister() could return correct value
required by gralloctest.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>

Ändern Zusammenfassung

Diff

--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -238,15 +238,16 @@ static struct gbm_bo *gbm_alloc(struct gbm_device *gbm,
238238 return bo;
239239 }
240240
241-void gbm_free(buffer_handle_t handle)
241+int gbm_free(buffer_handle_t handle)
242242 {
243243 struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle);
244244
245245 if (!bo)
246- return;
246+ return -EINVAL;
247247
248248 gbm_bo_handle_map.erase(handle);
249249 gbm_bo_destroy(bo);
250+ return 0;
250251 }
251252
252253 /*
@@ -355,9 +356,7 @@ int gralloc_gbm_handle_register(buffer_handle_t _handle, struct gbm_device *gbm)
355356 */
356357 int gralloc_gbm_handle_unregister(buffer_handle_t handle)
357358 {
358- gbm_free(handle);
359-
360- return 0;
359+ return gbm_free(handle);
361360 }
362361
363362 /*
--- a/gralloc_gbm_priv.h
+++ b/gralloc_gbm_priv.h
@@ -37,7 +37,7 @@ int gralloc_gbm_handle_unregister(buffer_handle_t handle);
3737
3838 buffer_handle_t gralloc_gbm_bo_create(struct gbm_device *gbm,
3939 int width, int height, int format, int usage, int *stride);
40-void gbm_free(buffer_handle_t handle);
40+int gbm_free(buffer_handle_t handle);
4141
4242 struct gbm_bo *gralloc_gbm_bo_from_handle(buffer_handle_t handle);
4343 buffer_handle_t gralloc_gbm_bo_get_handle(struct gbm_bo *bo);
Show on old repository browser