summaryrefslogtreecommitdiff
path: root/gbm.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2016-11-21 10:46:38 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-11-28 23:59:30 -0800
commitf3b22da397567eaa9d7cd59b50f43eea92b9be61 (patch)
treef335dddd3b8528808796ef559e54955a04b1bf51 /gbm.c
parentc746dca555369056a6a74924bba576e904f0b38d (diff)
minigbm: Switch to <drm_fourcc.h>
We were duplicating formats. The original rationale behind this was DRV_FORMAT_* would be a superset of Android and DRM formats. However, there are only 2 HAL flexible formats not defined by DRM, and we can deal with these easily. The DRM format namespace is large enough to handle any additions we may need. BUG=NONE TEST=Ran graphics_Gbm, arc-cros-gralloc still builds Change-Id: Ie173eee6ac6926947a3b98c3ae809e38a0ea8014 Reviewed-on: https://chromium-review.googlesource.com/405790 Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'gbm.c')
-rw-r--r--gbm.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gbm.c b/gbm.c
index 613d00e..4030c3e 100644
--- a/gbm.c
+++ b/gbm.c
@@ -34,17 +34,15 @@ PUBLIC int
gbm_device_is_format_supported(struct gbm_device *gbm,
uint32_t format, uint32_t usage)
{
- uint32_t drv_format;
uint64_t drv_usage;
if (usage & GBM_BO_USE_CURSOR &&
usage & GBM_BO_USE_RENDERING)
return 0;
- drv_format = gbm_convert_format(format);
drv_usage = gbm_convert_flags(usage);
- return drv_is_format_supported(gbm->drv, drv_format, drv_usage);
+ return drv_is_format_supported(gbm->drv, format, drv_usage);
}
PUBLIC struct gbm_device *gbm_create_device(int fd)
@@ -127,8 +125,7 @@ PUBLIC struct gbm_bo *gbm_bo_create(struct gbm_device *gbm, uint32_t width,
if (!bo)
return NULL;
- bo->bo = drv_bo_create(gbm->drv, width, height,
- gbm_convert_format(format),
+ bo->bo = drv_bo_create(gbm->drv, width, height, format,
gbm_convert_flags(flags));
if (!bo->bo) {
@@ -169,7 +166,7 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type,
gbm_format = fd_data->format;
drv_data.width = fd_data->width;
drv_data.height = fd_data->height;
- drv_data.format = gbm_convert_format(fd_data->format);
+ drv_data.format = fd_data->format;
drv_data.fds[0] = fd_data->fd;
drv_data.strides[0] = fd_data->stride;
drv_data.sizes[0] = fd_data->height * fd_data->stride;
@@ -178,7 +175,7 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type,
gbm_format = fd_planar_data->format;
drv_data.width = fd_planar_data->width;
drv_data.height = fd_planar_data->height;
- drv_data.format = gbm_convert_format(fd_planar_data->format);
+ drv_data.format = fd_planar_data->format;
num_planes = drv_num_planes_from_format(drv_data.format);
assert(num_planes);