summaryrefslogtreecommitdiff
path: root/nouveau.c
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@google.com>2017-05-15 09:34:22 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-23 23:59:12 -0700
commit8ac0c9a9550bd1fa57e49613fae45df9001f74fc (patch)
tree6ca0f0ccdcddc6ddc2bdf31a7bcaf307005477ac /nouveau.c
parentde558ae8a22cbd6c0b25691b56c6fd4884ec3ac5 (diff)
minigbm: remove BO_USE_RENDERING from certain formats
We can't use GR88, R8, YV12, NV12, UYVY, YUYV buffers as render targets, so let's remove the BO_USE_RENDERING flag from these formats. However, we can sample from these formats (though this feature still needs to be enabled in our drivers), so the BO_USE_TEXTURE flag remains set. Also, change our interpretation of the GRALLOC_USAGE_HW_COMPOSER flag such that it implies BO_USE_SCANOUT | BO_USE_TEXTURE. This is because the OpenGL fallback textures from the buffer if can't be scanned-out, not renders to it. BUG=none TEST=run Youtube app on Kevin Change-Id: I9ea8452279e110bc1a9579f162abe1c72192eb40 Reviewed-on: https://chromium-review.googlesource.com/506812 Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Diffstat (limited to 'nouveau.c')
-rw-r--r--nouveau.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nouveau.c b/nouveau.c
index aa832c2..7cdab3a 100644
--- a/nouveau.c
+++ b/nouveau.c
@@ -8,11 +8,17 @@
#include "helpers.h"
#include "util.h"
-static const uint32_t supported_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
+static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
static int nouveau_init(struct driver *drv)
{
- return drv_add_linear_combinations(drv, supported_formats, ARRAY_SIZE(supported_formats));
+ int ret;
+ ret = drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
+ &LINEAR_METADATA, BO_USE_RENDER_MASK);
+ if (ret)
+ return ret;
+
+ return drv_modify_linear_combinations(drv);
}
struct backend backend_nouveau = {