Lines Matching refs:handle
160 struct gralloc_handle_t *handle = gralloc_handle(_handle); in gbm_import() local
167 int format = get_gbm_format(handle->format); in gbm_import()
168 if (handle->prime_fd < 0) in gbm_import()
172 data.width = handle->width; in gbm_import()
173 data.height = handle->height; in gbm_import()
176 if (handle->format == HAL_PIXEL_FORMAT_YV12) { in gbm_import()
178 data.height += handle->height / 2; in gbm_import()
183 data.fds[0] = handle->prime_fd; in gbm_import()
184 data.strides[0] = handle->stride; in gbm_import()
185 data.modifier = handle->modifier; in gbm_import()
188 data.fd = handle->prime_fd; in gbm_import()
189 data.stride = handle->stride; in gbm_import()
200 struct gralloc_handle_t *handle = gralloc_handle(_handle); in gbm_alloc() local
201 int format = get_gbm_format(handle->format); in gbm_alloc()
202 int usage = get_pipe_bind(handle->usage); in gbm_alloc()
205 width = handle->width; in gbm_alloc()
206 height = handle->height; in gbm_alloc()
208 if (handle->width < 64) in gbm_alloc()
210 if (handle->height < 64) in gbm_alloc()
218 if (handle->format == HAL_PIXEL_FORMAT_YV12) { in gbm_alloc()
220 height += handle->height / 2; in gbm_alloc()
224 handle->width, handle->height, handle->format, usage); in gbm_alloc()
228 handle->width, handle->height, handle->format, usage); in gbm_alloc()
232 handle->prime_fd = gbm_bo_get_fd(bo); in gbm_alloc()
233 handle->stride = gbm_bo_get_stride(bo); in gbm_alloc()
235 handle->modifier = gbm_bo_get_modifier(bo); in gbm_alloc()
241 void gbm_free(buffer_handle_t handle) in gbm_free() argument
243 struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle); in gbm_free()
248 gbm_bo_handle_map.erase(handle); in gbm_free()
255 struct gbm_bo *gralloc_gbm_bo_from_handle(buffer_handle_t handle) in gralloc_gbm_bo_from_handle() argument
257 return gbm_bo_handle_map[handle]; in gralloc_gbm_bo_from_handle()
260 static int gbm_map(buffer_handle_t handle, int x, int y, int w, int h, in gbm_map() argument
265 struct gralloc_gbm_handle_t *gbm_handle = gralloc_handle(handle); in gbm_map()
266 struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle); in gbm_map()
356 int gralloc_gbm_handle_unregister(buffer_handle_t handle) in gralloc_gbm_handle_unregister() argument
358 gbm_free(handle); in gralloc_gbm_handle_unregister()
370 native_handle_t *handle; in gralloc_gbm_bo_create() local
372 handle = gralloc_handle_create(width, height, format, usage); in gralloc_gbm_bo_create()
373 if (!handle) in gralloc_gbm_bo_create()
376 bo = gbm_alloc(gbm, handle); in gralloc_gbm_bo_create()
378 native_handle_delete(handle); in gralloc_gbm_bo_create()
382 gbm_bo_handle_map.emplace(handle, bo); in gralloc_gbm_bo_create()
385 struct gralloc_handle_t *ghandle = gralloc_handle(handle); in gralloc_gbm_bo_create()
388 return handle; in gralloc_gbm_bo_create()
394 int gralloc_gbm_bo_lock(buffer_handle_t handle, in gralloc_gbm_bo_lock() argument
398 struct gralloc_handle_t *gbm_handle = gralloc_handle(handle); in gralloc_gbm_bo_lock()
399 struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle); in gralloc_gbm_bo_lock()
444 int err = gbm_map(handle, x, y, w, h, write, addr); in gralloc_gbm_bo_lock()
461 int gralloc_gbm_bo_unlock(buffer_handle_t handle) in gralloc_gbm_bo_unlock() argument
463 struct gbm_bo *bo = gralloc_gbm_bo_from_handle(handle); in gralloc_gbm_bo_unlock()
488 int gralloc_gbm_bo_lock_ycbcr(buffer_handle_t handle, in gralloc_gbm_bo_lock_ycbcr() argument
492 struct gralloc_handle_t *hnd = gralloc_handle(handle); in gralloc_gbm_bo_lock_ycbcr()
497 ALOGD("handle %p, hnd %p, usage 0x%x", handle, hnd, usage); in gralloc_gbm_bo_lock_ycbcr()
499 err = gralloc_gbm_bo_lock(handle, usage, x, y, w, h, &addr); in gralloc_gbm_bo_lock_ycbcr()