external/gbm_gralloc
Revisão | 468f7f4fe1eb0e319ce001b1ff6b4d5ef7bd178d (tree) |
---|---|
Hora | 2017-09-12 00:11:25 |
Autor | Rob Herring <robh@kern...> |
Commiter | Rob Herring |
kill off gralloc_gbm_get_pid
Caching getpid() calls seems pointless, so remove the added
complexity and just use getpid() directly when needed.
Signed-off-by: Rob Herring <robh@kernel.org>
@@ -54,8 +54,6 @@ struct gralloc_gbm_bo_t { | ||
54 | 54 | int locked_for; |
55 | 55 | }; |
56 | 56 | |
57 | -static int32_t gralloc_gbm_pid = 0; | |
58 | - | |
59 | 57 | static uint32_t get_gbm_format(int format) |
60 | 58 | { |
61 | 59 | uint32_t fmt; |
@@ -299,17 +297,6 @@ struct gbm_device *gbm_dev_create(void) | ||
299 | 297 | } |
300 | 298 | |
301 | 299 | /* |
302 | - * Return the pid of the process. | |
303 | - */ | |
304 | -static int gralloc_gbm_get_pid(void) | |
305 | -{ | |
306 | - if (unlikely(!gralloc_gbm_pid)) | |
307 | - android_atomic_write((int32_t) getpid(), &gralloc_gbm_pid); | |
308 | - | |
309 | - return gralloc_gbm_pid; | |
310 | -} | |
311 | - | |
312 | -/* | |
313 | 300 | * Register a buffer handle. |
314 | 301 | */ |
315 | 302 | int gralloc_gbm_handle_register(buffer_handle_t _handle, struct gbm_device *gbm) |
@@ -324,7 +311,7 @@ int gralloc_gbm_handle_register(buffer_handle_t _handle, struct gbm_device *gbm) | ||
324 | 311 | if (!bo) |
325 | 312 | return -EINVAL; |
326 | 313 | |
327 | - handle->data_owner = gralloc_gbm_get_pid(); | |
314 | + handle->data_owner = getpid(); | |
328 | 315 | handle->data = bo; |
329 | 316 | |
330 | 317 | return 0; |
@@ -393,7 +380,7 @@ struct gralloc_gbm_handle_t *gralloc_gbm_bo_create(struct gbm_device *gbm, | ||
393 | 380 | return NULL; |
394 | 381 | } |
395 | 382 | |
396 | - handle->data_owner = gralloc_gbm_get_pid(); | |
383 | + handle->data_owner = getpid(); | |
397 | 384 | handle->data = bo; |
398 | 385 | |
399 | 386 | return handle; |