summaryrefslogtreecommitdiff
path: root/drv_priv.h
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 /drv_priv.h
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 'drv_priv.h')
-rw-r--r--drv_priv.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drv_priv.h b/drv_priv.h
index 8884ea7..df5c8e9 100644
--- a/drv_priv.h
+++ b/drv_priv.h
@@ -79,4 +79,15 @@ struct backend {
struct combinations combos;
};
+// clang-format off
+#define BO_USE_RENDER_MASK BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | \
+ BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | \
+ BO_USE_SW_WRITE_RARELY | BO_USE_TEXTURE
+
+#define BO_USE_TEXTURE_MASK BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN | \
+ BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY | BO_USE_TEXTURE
+
+#define LINEAR_METADATA (struct format_metadata) { 0, 1, DRM_FORMAT_MOD_NONE }
+// clang-format on
+
#endif