diff --git a/src/etnaviv/common/etna_core_info.h b/src/etnaviv/common/etna_core_info.h index 0c21082195b..a4e1a7690b2 100644 --- a/src/etnaviv/common/etna_core_info.h +++ b/src/etnaviv/common/etna_core_info.h @@ -103,6 +103,8 @@ struct etna_core_info { uint32_t eco_id; uint32_t customer_id; + int8_t halti; /* HALTI (gross architecture) level. -1 for pre-HALTI. */ + enum etna_core_type type; union { diff --git a/src/etnaviv/drm/etnaviv_gpu.c b/src/etnaviv/drm/etnaviv_gpu.c index 71238ef34a5..a3bf6574df8 100644 --- a/src/etnaviv/drm/etnaviv_gpu.c +++ b/src/etnaviv/drm/etnaviv_gpu.c @@ -203,6 +203,28 @@ static uint64_t get_param(struct etna_device *dev, uint32_t core, uint32_t param return req.value; } +static void determine_halti(struct etna_gpu *gpu) +{ + struct etna_core_info *info = &gpu->info; + + /* Figure out gross GPU architecture. See rnndb/common.xml for a specific + * description of the differences. */ + if (etna_core_has_feature(info, ETNA_FEATURE_HALTI5)) + info->halti = 5; /* New GC7000/GC8x00 */ + else if (etna_core_has_feature(info, ETNA_FEATURE_HALTI4)) + info->halti = 4; /* Old GC7000/GC7400 */ + else if (etna_core_has_feature(info, ETNA_FEATURE_HALTI3)) + info->halti = 3; /* None? */ + else if (etna_core_has_feature(info, ETNA_FEATURE_HALTI2)) + info->halti = 2; /* GC2500/GC3000/GC5000/GC6400 */ + else if (etna_core_has_feature(info, ETNA_FEATURE_HALTI1)) + info->halti = 1; /* GC900/GC4000/GC7000UL */ + else if (etna_core_has_feature(info, ETNA_FEATURE_HALTI0)) + info->halti = 0; /* GC880/GC2000/GC7000TM */ + else + info->halti = -1; /* GC7000nanolite / pre-GC2000 except GC880 */ +} + struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core) { struct etna_gpu *gpu; @@ -239,6 +261,8 @@ struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core) query_limits_from_kernel(gpu); } + determine_halti(gpu); + return gpu; fail: if (gpu) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index a9fff2b095f..39ff42e5573 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -881,22 +881,7 @@ etna_get_specs(struct etna_screen *screen) screen->specs.nn_core_version = 6; } - /* Figure out gross GPU architecture. See rnndb/common.xml for a specific - * description of the differences. */ - if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI5)) - screen->specs.halti = 5; /* New GC7000/GC8x00 */ - else if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI4)) - screen->specs.halti = 4; /* Old GC7000/GC7400 */ - else if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI3)) - screen->specs.halti = 3; /* None? */ - else if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI2)) - screen->specs.halti = 2; /* GC2500/GC3000/GC5000/GC6400 */ - else if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI1)) - screen->specs.halti = 1; /* GC900/GC4000/GC7000UL */ - else if (VIV_FEATURE(screen, ETNA_FEATURE_HALTI0)) - screen->specs.halti = 0; /* GC880/GC2000/GC7000TM */ - else - screen->specs.halti = -1; /* GC7000nanolite / pre-GC2000 except GC880 */ + screen->specs.halti = info->halti; if (screen->specs.halti >= 0) DBG("etnaviv: GPU arch: HALTI%d", screen->specs.halti); else