intel/common: Use isl for decoder surface formats
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 27 Feb 2018 04:31:22 +0000 (20:31 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 5 Mar 2018 17:51:04 +0000 (09:51 -0800)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/intel/common/gen_decoder.c
src/intel/common/meson.build
src/intel/meson.build

index 87a81b4b05a87d589a6f9cae0916d5508a796c63..7ca71c0d9fc86decd3420ab2aaf91c73224e7585 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "gen_decoder.h"
 
+#include "isl/isl.h"
 #include "genxml/genX_xml.h"
 
 #define XML_BUFFER_SIZE 4096
@@ -954,6 +955,13 @@ iter_decode_field(struct gen_field_iterator *iter)
       int length = strlen(iter->value);
       snprintf(iter->value + length, sizeof(iter->value) - length,
                " (%s)", enum_name);
+   } else if (strcmp(iter->name, "Surface Format") == 0) {
+      if (isl_format_is_valid((enum isl_format)v.qw)) {
+         const char *fmt_name = isl_format_get_name((enum isl_format)v.qw);
+         int length = strlen(iter->value);
+         snprintf(iter->value + length, sizeof(iter->value) - length,
+                  " (%s)", fmt_name);
+      }
    }
 }
 
index d35d5e8f78e0ed2d770689791a2680ca3c3791f6..5e0394a5b86ce19e6cf283faea3e8cc3ecda2afd 100644 (file)
@@ -38,5 +38,6 @@ libintel_common = static_library(
   files_libintel_common,
   include_directories : [inc_common, inc_intel],
   c_args : [c_vis_args, no_override_init_args],
+  link_with : [libisl],
   dependencies : [dep_expat, dep_libdrm, dep_thread],
 )
index 28a2d793509a0951b61d51fbd72dd9de88d6d28f..ccaf16a76f93573e83242d5a317052e258ce23a0 100644 (file)
@@ -23,8 +23,8 @@ inc_intel = include_directories('.')
 subdir('blorp')
 subdir('dev')
 subdir('genxml')
-subdir('common')
 subdir('isl')
+subdir('common')
 subdir('compiler')
 subdir('tools')
 if with_intel_vk