summaryrefslogtreecommitdiff
path: root/rockchip.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2017-09-28 16:40:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-02 17:27:17 -0700
commita1892b2800a5847525d010d6245cbcc1776c1bea (patch)
tree1288f255cc047befd90f3c333d49a934aaf36772 /rockchip.c
parent60ee5833b16182702cafce54278721b635f3be89 (diff)
minigbm: standardize naming of buffer creation flags
We use the terms "flags" and "usage" interchangeably in this repo, since they essentally mean the same thing. However, let's be a little more consistent since it's kind of confusing, especially when buffer map flags come to play. Let's: - refer to everything in the drv_* layer as use_flags - refer to everything in the gbm/gralloc layers as usages BUG=chromium:764871 TEST=emerge-eve {arc-cros-gralloc, minigbm} Change-Id: If987d72369b895f38cde87e50ce1080f78f2a084 Reviewed-on: https://chromium-review.googlesource.com/691423 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 'rockchip.c')
-rw-r--r--rockchip.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/rockchip.c b/rockchip.c
index 860f3b9..58a60aa 100644
--- a/rockchip.c
+++ b/rockchip.c
@@ -78,7 +78,7 @@ static int rockchip_add_kms_item(struct driver *drv, const struct kms_item *item
{
int ret;
uint32_t i, j;
- uint64_t flags;
+ uint64_t use_flags;
struct combination *combo;
struct format_metadata metadata;
@@ -86,21 +86,22 @@ static int rockchip_add_kms_item(struct driver *drv, const struct kms_item *item
combo = &drv->combos.data[i];
if (combo->format == item->format) {
if (item->modifier == DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC) {
- flags = BO_USE_RENDERING | BO_USE_SCANOUT | BO_USE_TEXTURE;
+ use_flags = BO_USE_RENDERING | BO_USE_SCANOUT | BO_USE_TEXTURE;
metadata.modifier = item->modifier;
metadata.tiling = 0;
metadata.priority = 2;
for (j = 0; j < ARRAY_SIZE(texture_source_formats); j++) {
if (item->format == texture_source_formats[j])
- flags &= ~BO_USE_RENDERING;
+ use_flags &= ~BO_USE_RENDERING;
}
- ret = drv_add_combination(drv, item[i].format, &metadata, flags);
+ ret =
+ drv_add_combination(drv, item[i].format, &metadata, use_flags);
if (ret)
return ret;
} else {
- combo->usage |= item->usage;
+ combo->use_flags |= item->use_flags;
}
}
}
@@ -231,7 +232,7 @@ static int rockchip_bo_create_with_modifiers(struct bo *bo, uint32_t width, uint
}
static int rockchip_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint32_t format,
- uint64_t flags)
+ uint64_t use_flags)
{
uint64_t modifiers[] = { DRM_FORMAT_MOD_NONE };
return rockchip_bo_create_with_modifiers(bo, width, height, format, modifiers,
@@ -262,7 +263,7 @@ static void *rockchip_bo_map(struct bo *bo, struct map_info *data, size_t plane,
data->length = bo->total_size;
- if (bo->flags & BO_USE_RENDERSCRIPT) {
+ if (bo->use_flags & BO_USE_RENDERSCRIPT) {
priv = calloc(1, sizeof(*priv));
priv->cached_addr = calloc(1, bo->total_size);
priv->gem_addr = addr;
@@ -296,12 +297,12 @@ static int rockchip_bo_flush(struct bo *bo, struct map_info *data)
return 0;
}
-static uint32_t rockchip_resolve_format(uint32_t format, uint64_t usage)
+static uint32_t rockchip_resolve_format(uint32_t format, uint64_t use_flags)
{
switch (format) {
case DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED:
/* Camera subsystem requires NV12. */
- if (usage & (BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE))
+ if (use_flags & (BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE))
return DRM_FORMAT_NV12;
/*HACK: See b/28671744 */
return DRM_FORMAT_XBGR8888;