[Mesa-dev] [PATCH 19/30] intel/isl: Add a helper to convert tilings fro ISL to i915
Jason Ekstrand
jason at jlekstrand.net
Fri Jun 16 22:41:41 UTC 2017
---
src/intel/isl/isl.h | 3 +++
src/intel/isl/isl_drm.c | 23 +++++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index eb05b54..dc3eada 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -1513,6 +1513,9 @@ isl_tiling_is_std_y(enum isl_tiling tiling)
return (1u << tiling) & ISL_TILING_STD_Y_MASK;
}
+uint32_t
+isl_tiling_to_i915_tiling(enum isl_tiling tiling);
+
const struct isl_drm_modifier_info * ATTRIBUTE_CONST
isl_drm_modifier_get_info(uint64_t modofier);
diff --git a/src/intel/isl/isl_drm.c b/src/intel/isl/isl_drm.c
index 8fccc40..1dc3da2 100644
--- a/src/intel/isl/isl_drm.c
+++ b/src/intel/isl/isl_drm.c
@@ -25,10 +25,33 @@
#include <stdlib.h>
#include <drm_fourcc.h>
+#include <i915_drm.h>
#include "isl.h"
#include "common/gen_device_info.h"
+uint32_t
+isl_tiling_to_i915_tiling(enum isl_tiling tiling)
+{
+ switch (tiling) {
+ case ISL_TILING_LINEAR:
+ return I915_TILING_NONE;
+
+ case ISL_TILING_X:
+ return I915_TILING_X;
+
+ case ISL_TILING_Y0:
+ return I915_TILING_Y;
+
+ case ISL_TILING_W:
+ case ISL_TILING_Yf:
+ case ISL_TILING_Ys:
+ case ISL_TILING_HIZ:
+ case ISL_TILING_CCS:
+ return I915_TILING_NONE;
+ }
+}
+
struct isl_drm_modifier_info modifier_info[] = {
{
.modifier = DRM_FORMAT_MOD_NONE,
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list