external/gbm_gralloc
Revision | 22d8ed6e3de7537fd960c44207dfa347edafbcd5 (tree) |
---|---|
Zeit | 2019-01-14 14:13:50 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
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>
@@ -238,15 +238,16 @@ static struct gbm_bo *gbm_alloc(struct gbm_device *gbm, | ||
238 | 238 | return bo; |
239 | 239 | } |
240 | 240 | |
241 | -void gbm_free(buffer_handle_t handle) | |
241 | +int gbm_free(buffer_handle_t handle) | |
242 | 242 | { |
243 | 243 | struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle); |
244 | 244 | |
245 | 245 | if (!bo) |
246 | - return; | |
246 | + return -EINVAL; | |
247 | 247 | |
248 | 248 | gbm_bo_handle_map.erase(handle); |
249 | 249 | gbm_bo_destroy(bo); |
250 | + return 0; | |
250 | 251 | } |
251 | 252 | |
252 | 253 | /* |
@@ -355,9 +356,7 @@ int gralloc_gbm_handle_register(buffer_handle_t _handle, struct gbm_device *gbm) | ||
355 | 356 | */ |
356 | 357 | int gralloc_gbm_handle_unregister(buffer_handle_t handle) |
357 | 358 | { |
358 | - gbm_free(handle); | |
359 | - | |
360 | - return 0; | |
359 | + return gbm_free(handle); | |
361 | 360 | } |
362 | 361 | |
363 | 362 | /* |
@@ -37,7 +37,7 @@ int gralloc_gbm_handle_unregister(buffer_handle_t handle); | ||
37 | 37 | |
38 | 38 | buffer_handle_t gralloc_gbm_bo_create(struct gbm_device *gbm, |
39 | 39 | 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); | |
41 | 41 | |
42 | 42 | struct gbm_bo *gralloc_gbm_bo_from_handle(buffer_handle_t handle); |
43 | 43 | buffer_handle_t gralloc_gbm_bo_get_handle(struct gbm_bo *bo); |