Lines Matching refs:bo

90 void InitGbmBo(struct gbm_bo *bo, const struct drm_mode_create_dumb *dumb)
93 DISPLAY_CHK_RETURN_NOT_VALUE((bo == nullptr), DISPLAY_LOGE("bo is null"));
94 bo->stride = dumb->pitch;
95 bo->size = dumb->size;
96 bo->handle = dumb->handle;
121 struct gbm_bo *bo;
126 bo = (struct gbm_bo *)calloc(1, sizeof(struct gbm_bo));
127 DISPLAY_CHK_RETURN((bo == nullptr), nullptr, DISPLAY_LOGE("gbm bo create fialed no memery"));
128 (void)memset_s(bo, sizeof(struct gbm_bo), 0, sizeof(struct gbm_bo));
129 bo->width = width;
130 bo->height = height;
131 bo->gbm = gbm;
132 bo->format = format;
143 InitGbmBo(bo, &dumb);
146 bo->width, bo->height, bo->stride, bo->size);
147 return bo;
163 uint32_t HdiGbmBoGetStride(struct gbm_bo *bo)
165 DISPLAY_CHK_RETURN((bo == nullptr), 0, DISPLAY_LOGE("the bo is null"));
166 return bo->stride;
169 uint32_t HdiGbmBoGetWidth(struct gbm_bo *bo)
171 DISPLAY_CHK_RETURN((bo == nullptr), 0, DISPLAY_LOGE("the bo is null"));
172 return bo->width;
175 uint32_t HdiGbmBoGetHeight(struct gbm_bo *bo)
177 DISPLAY_CHK_RETURN((bo == nullptr), 0, DISPLAY_LOGE("the bo is null"));
178 return bo->height;
181 uint32_t HdiGbmBoGetSize(struct gbm_bo *bo)
183 DISPLAY_CHK_RETURN((bo == nullptr), 0, DISPLAY_LOGE("the bo is null"));
184 return bo->size;
187 void HdiGbmBoDestroy(struct gbm_bo *bo)
190 DISPLAY_CHK_RETURN_NOT_VALUE((bo == nullptr), DISPLAY_LOGE("the bo is null"));
192 dumb.handle = bo->handle;
193 ret = drmIoctl(bo->gbm->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &dumb);
195 free(bo);
198 int HdiGbmBoGetFd(struct gbm_bo *bo)
201 int ret = drmPrimeHandleToFD(bo->gbm->fd, bo->handle, DRM_CLOEXEC | DRM_RDWR, &fd);