[Mesa-dev] [PATCH 20/32] i965: Support all known modifiers
Ben Widawsky
ben at bwidawsk.net
Tue Jan 3 02:37:11 UTC 2017
This patch adds support for handling X tiled modifier. This isn't
particularly useful but it makes our code complete.
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Acked-by: Daniel Stone <daniels at collabora.com>
---
src/mesa/drivers/dri/i965/intel_screen.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 394816eb57..ba968bee17 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -546,12 +546,18 @@ create_image_with_modifier(struct intel_screen *screen,
__DRIimage *image, uint64_t modifier,
int width, int height, int cpp)
{
- uint32_t tiling;
+ uint32_t requested_tiling = 0, tiling = 0;
unsigned long pitch;
switch (modifier) {
case I915_FORMAT_MOD_Y_TILED:
- tiling = I915_TILING_Y;
+ requested_tiling = tiling = I915_TILING_Y;
+ break;
+ case I915_FORMAT_MOD_X_TILED:
+ requested_tiling = tiling = I915_TILING_X;
+ break;
+ default:
+ unreachable("Unknown modifier");
}
/* For now, all modifiers require some tiling */
@@ -564,7 +570,7 @@ create_image_with_modifier(struct intel_screen *screen,
if (image->bo == NULL)
return false;
- if (tiling != I915_TILING_Y) {
+ if (tiling != requested_tiling) {
drm_intel_bo_unreference(image->bo);
return false;
}
--
2.11.0
More information about the mesa-dev
mailing list