intel: Remove devinfo_to_gen() helper function
authorAnuj Phogat <anuj.phogat@gmail.com>
Wed, 14 Apr 2021 04:50:42 +0000 (21:50 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 20 Apr 2021 20:06:34 +0000 (20:06 +0000)
This changes behavior.  Now Baytrail will be decoded with the
gen7.xml instead of the gen75.xml. Haswell is the only graphics
hardware generation 75 and Baytrail is closer to Ivybridge
in most ways. (Kenneth Graunke)

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>

src/intel/common/intel_decoder.c

index 7e31065..bead0f5 100644 (file)
@@ -507,16 +507,6 @@ character_data(void *data, const XML_Char *s, int len)
 {
 }
 
-static int
-devinfo_to_gen(const struct intel_device_info *devinfo, bool x10)
-{
-   if (devinfo->is_baytrail || devinfo->is_haswell) {
-      return devinfo->ver * 10 + 5;
-   }
-
-   return x10 ? devinfo->ver * 10 : devinfo->ver;
-}
-
 static uint32_t zlib_inflate(const void *compressed_data,
                              uint32_t compressed_len,
                              void **out_ptr)
@@ -602,7 +592,7 @@ intel_spec_load(const struct intel_device_info *devinfo)
    uint8_t *text_data = NULL;
    uint32_t text_offset = 0, text_length = 0;
    ASSERTED uint32_t total_length;
-   uint32_t gen_10 = devinfo_to_gen(devinfo, true);
+   uint32_t gen_10 = devinfo->verx10;
 
    for (int i = 0; i < ARRAY_SIZE(genxml_files_table); i++) {
       if (genxml_files_table[i].gen_10 == gen_10) {
@@ -742,7 +732,7 @@ intel_spec_load_from_path(const struct intel_device_info *devinfo,
    char *filename = malloc(filename_len);
 
    ASSERTED size_t len = snprintf(filename, filename_len, "%s/gen%i.xml",
-                  path, devinfo_to_gen(devinfo, false));
+                  path, devinfo->ver);
    assert(len < filename_len);
 
    struct intel_spec *spec = intel_spec_load_filename(filename);