aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBen Widawsky <[email protected]>2017-03-13 18:20:02 -0700
committerBen Widawsky <[email protected]>2017-03-15 10:36:05 -0700
commit5c6e0d1c7dd63df00c83e16ce6ba878fe345513a (patch)
tree2011ef6fbe2fdf03de2f9c90f4ac532d95142ea3 /src/mesa/drivers
parent191ff914a2c77d7d982048ef21422a209e1e7e06 (diff)
i965: introduce modifier selection.
Nothing special here other than a brief introduction to modifier selection. Originally this was part of another patch but was split out from gbm: Introduce modifiers into surface/bo creation by request of Emil. Requested-by: Emil Velikov <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 5f9dea6f5a1..81cb0deabb3 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -41,6 +41,10 @@
#include "utils.h"
#include "xmlpool.h"
+#ifndef DRM_FORMAT_MOD_INVALID
+#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
+#endif
+
static const __DRIconfigOptionsExtension brw_config_options = {
.base = { __DRI_CONFIG_OPTIONS, 1 },
.xml =
@@ -505,6 +509,15 @@ intel_destroy_image(__DRIimage *image)
free(image);
}
+static uint64_t
+select_best_modifier(struct gen_device_info *devinfo,
+ const uint64_t *modifiers,
+ const unsigned count)
+{
+ /* Modifiers are not supported by this DRI driver */
+ return DRM_FORMAT_MOD_INVALID;
+}
+
static __DRIimage *
intel_create_image_common(__DRIscreen *dri_screen,
int width, int height, int format,
@@ -525,6 +538,12 @@ intel_create_image_common(__DRIscreen *dri_screen,
*/
assert(!(use && count));
+ uint64_t modifier = select_best_modifier(&screen->devinfo, modifiers, count);
+ assert(modifier == DRM_FORMAT_MOD_INVALID);
+
+ /* Historically, X-tiled was the default, and so lack of modifier means
+ * X-tiled.
+ */
tiling = I915_TILING_X;
if (use & __DRI_IMAGE_USE_CURSOR) {
if (width != 64 || height != 64)