Lines Matching refs:bo
70 int NvImporter::ImportBuffer(buffer_handle_t handle, hwc_drm_bo_t *bo) { in ImportBuffer() argument
71 memset(bo, 0, sizeof(hwc_drm_bo_t)); in ImportBuffer()
75 *bo = buf->bo; in ImportBuffer()
84 buf->bo.priv = buf; in ImportBuffer()
93 drm_->fd(), handle, &buf->bo); in ImportBuffer()
100 ret = drmModeAddFB2(drm_->fd(), buf->bo.width, buf->bo.height, buf->bo.format, in ImportBuffer()
101 buf->bo.gem_handles, buf->bo.pitches, buf->bo.offsets, in ImportBuffer()
102 &buf->bo.fb_id, 0); in ImportBuffer()
105 ReleaseBufferImpl(&buf->bo); in ImportBuffer()
116 ReleaseBufferImpl(&buf->bo); in ImportBuffer()
120 *bo = buf->bo; in ImportBuffer()
124 int NvImporter::ReleaseBuffer(hwc_drm_bo_t * bo) { in ReleaseBuffer() argument
125 NvBuffer_t *buf = (NvBuffer_t *)bo->priv; in ReleaseBuffer()
127 ALOGE("Freeing bo %ld, buf is NULL!", bo->fb_id); in ReleaseBuffer()
133 ReleaseBufferImpl(bo); in ReleaseBuffer()
141 buf->importer->ReleaseBuffer(&buf->bo); in NvGrallocRelease()
144 void NvImporter::ReleaseBufferImpl(hwc_drm_bo_t *bo) { in ReleaseBufferImpl() argument
145 if (bo->fb_id) { in ReleaseBufferImpl()
146 int ret = drmModeRmFB(drm_->fd(), bo->fb_id); in ReleaseBufferImpl()
153 int num_gem_handles = sizeof(bo->gem_handles) / sizeof(bo->gem_handles[0]); in ReleaseBufferImpl()
155 if (!bo->gem_handles[i]) in ReleaseBufferImpl()
158 gem_close.handle = bo->gem_handles[i]; in ReleaseBufferImpl()
163 bo->gem_handles[i] = 0; in ReleaseBufferImpl()