Home | History | Annotate | Download | only in drm_gralloc

Lines Matching full:handle

152  * Validate a buffer handle and return the associated bo.
157 struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle);
159 if (!handle)
162 /* the buffer handle is passed to a new process */
163 ALOGE("data_owner=%d gralloc_pid=%d data=%p\n", handle->data_owner, gralloc_drm_get_pid(), handle->data);
164 if (unlikely(handle->data_owner != gralloc_drm_pid)) {
171 ALOGE("handle: name=%d pfd=%d\n", handle->name,
172 handle->prime_fd);
174 if (handle->name || handle->prime_fd >= 0)
175 bo = drm->drv->alloc(drm->drv, handle);
176 else /* an invalid handle */
181 bo->handle = handle;
185 handle->data_owner = gralloc_drm_get_pid();
186 handle->data = bo;
189 return handle->data;
193 * Register a buffer handle.
195 int gralloc_drm_handle_register(buffer_handle_t handle, struct gralloc_drm_t *drm)
197 return (validate_handle(handle, drm)) ? 0 : -EINVAL;
201 * Unregister a buffer handle. It is no-op for handles created locally.
203 int gralloc_drm_handle_unregister(buffer_handle_t handle)
207 bo = validate_handle(handle, NULL);
218 * Create a buffer handle.
223 struct gralloc_drm_handle_t *handle;
225 handle = new gralloc_drm_handle_t;
226 if (!handle)
229 handle->base.version = sizeof(handle->base);
230 handle->base.numInts = GRALLOC_DRM_HANDLE_NUM_INTS;
231 handle->base.numFds = GRALLOC_DRM_HANDLE_NUM_FDS;
233 handle->magic = GRALLOC_DRM_HANDLE_MAGIC;
234 handle->width = width;
235 handle->height = height;
236 handle->format = format;
237 handle->usage = usage;
238 handle->prime_fd = -1;
240 return handle;
250 struct gralloc_drm_handle_t *handle;
252 handle = create_bo_handle(width, height, format, usage);
253 if (!handle)
256 bo = drm->drv->alloc(drm->drv, handle);
258 delete handle;
264 bo->handle = handle;
268 handle->data_owner = gralloc_drm_get_pid();
269 handle->data = bo;
279 struct gralloc_drm_handle_t *handle = bo->handle;
288 handle->data_owner = 0;
289 handle->data = 0;
292 delete handle;
306 * Return the bo of a registered handle.
308 struct gralloc_drm_bo_t *gralloc_drm_bo_from_handle(buffer_handle_t handle)
310 return validate_handle(handle, NULL);
314 * Get the buffer handle and stride of a bo.
319 *stride = bo->handle->stride;
320 return &bo->handle->base;
324 * Query YUV component offsets for a buffer handle
329 struct gralloc_drm_handle_t *handle = gralloc_drm_handle(_handle);
330 struct gralloc_drm_bo_t *bo = handle->data;
333 /* if handle exists and driver implements resolve_format */
334 if (handle && drm->drv->resolve_format)
346 if ((bo->handle->usage & usage) != usage) {
349 if (!(bo->handle->usage & GRALLOC_USAGE_HW_FB)
350 && !(bo->handle->usage & GRALLOC_USAGE_HW_TEXTURE)) {
352 ,bo->handle->usage,usage);