uint64_t mod;
size_t num_planes;
uint32_t resolved_format;
+ uint32_t bytes_per_pixel;
struct bo *bo;
struct cros_gralloc_handle *hnd;
bo = drv_bo_create(drv_, descriptor->width, descriptor->height, resolved_format,
descriptor->use_flags);
if (!bo) {
- cros_gralloc_error("Failed to create bo.");
+ drv_log("Failed to create bo.\n");
return -ENOMEM;
}
*/
if (drv_num_buffers_per_bo(bo) != 1) {
drv_bo_destroy(bo);
- cros_gralloc_error("Can only support one buffer per bo.");
+ drv_log("Can only support one buffer per bo.\n");
return -EINVAL;
}
hnd->format = drv_bo_get_format(bo);
hnd->use_flags[0] = static_cast<uint32_t>(descriptor->use_flags >> 32);
hnd->use_flags[1] = static_cast<uint32_t>(descriptor->use_flags);
- hnd->pixel_stride = drv_bo_get_stride_in_pixels(bo);
+ bytes_per_pixel = drv_bytes_per_pixel_from_format(hnd->format, 0);
+ hnd->pixel_stride = DIV_ROUND_UP(hnd->strides[0], bytes_per_pixel);
hnd->magic = cros_gralloc_magic;
hnd->droid_format = descriptor->droid_format;
hnd->usage = descriptor->producer_usage;
auto hnd = cros_gralloc_convert_handle(handle);
if (!hnd) {
- cros_gralloc_error("Invalid handle.");
+ drv_log("Invalid handle.\n");
return -EINVAL;
}
}
if (drmPrimeFDToHandle(drv_get_fd(drv_), hnd->fds[0], &id)) {
- cros_gralloc_error("drmPrimeFDToHandle failed.");
+ drv_log("drmPrimeFDToHandle failed.\n");
return -errno;
}
auto hnd = cros_gralloc_convert_handle(handle);
if (!hnd) {
- cros_gralloc_error("Invalid handle.");
+ drv_log("Invalid handle.\n");
return -EINVAL;
}
auto buffer = get_buffer(hnd);
if (!buffer) {
- cros_gralloc_error("Invalid Reference.");
+ drv_log("Invalid Reference.\n");
return -EINVAL;
}
std::lock_guard<std::mutex> lock(mutex_);
auto hnd = cros_gralloc_convert_handle(handle);
if (!hnd) {
- cros_gralloc_error("Invalid handle.");
+ drv_log("Invalid handle.\n");
return -EINVAL;
}
auto buffer = get_buffer(hnd);
if (!buffer) {
- cros_gralloc_error("Invalid Reference.");
+ drv_log("Invalid Reference.\n");
return -EINVAL;
}
auto hnd = cros_gralloc_convert_handle(handle);
if (!hnd) {
- cros_gralloc_error("Invalid handle.");
+ drv_log("Invalid handle.\n");
return -EINVAL;
}
auto buffer = get_buffer(hnd);
if (!buffer) {
- cros_gralloc_error("Invalid Reference.");
+ drv_log("Invalid Reference.\n");
return -EINVAL;
}
auto hnd = cros_gralloc_convert_handle(handle);
if (!hnd) {
- cros_gralloc_error("Invalid handle.");
+ drv_log("Invalid handle.\n");
return -EINVAL;
}
auto buffer = get_buffer(hnd);
if (!buffer) {
- cros_gralloc_error("Invalid Reference.");
+ drv_log("Invalid Reference.\n");
return -EINVAL;
}