It does the obvious. bdw => 80 hsw => 75 ivb => 70 ... g4x => 45 --- src/intel/common/gen_device_info.c | 11 +++++++++++ src/intel/common/gen_device_info.h | 3 +++ 2 files changed, 14 insertions(+)
diff --git a/src/intel/common/gen_device_info.c b/src/intel/common/gen_device_info.c index 209b293e510..611ef3db2a9 100644 --- a/src/intel/common/gen_device_info.c +++ b/src/intel/common/gen_device_info.c @@ -604,3 +604,14 @@ gen_get_device_name(int devid) return NULL; } } + +int +gen_get_version_10x(const struct gen_device_info *devinfo) +{ + int v = 10 * devinfo->gen; + + if (devinfo->is_haswell || devinfo->is_g4x) + v += 5; + + return v; +} diff --git a/src/intel/common/gen_device_info.h b/src/intel/common/gen_device_info.h index 80676d0e003..190c9bff3be 100644 --- a/src/intel/common/gen_device_info.h +++ b/src/intel/common/gen_device_info.h @@ -27,6 +27,8 @@ #include <stdbool.h> +#include "util/macros.h" + /** * Intel hardware information and quirks */ @@ -176,5 +178,6 @@ struct gen_device_info bool gen_get_device_info(int devid, struct gen_device_info *devinfo); const char *gen_get_device_name(int devid); +int gen_get_version_10x(const struct gen_device_info *devinfo) ATTRIBUTE_PURE; #endif /* GEN_DEVICE_INFO_H */ -- 2.12.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev