etnaviv: drm: Make use of hwdb

If the kernel provides correct ID values query the hwdb.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28574>
This commit is contained in:
Christian Gmeiner
2024-04-01 14:12:26 +02:00
committed by Marge Bot
parent 2192e620bb
commit aaccc25a4d
2 changed files with 11 additions and 1 deletions
+8 -1
View File
@@ -27,6 +27,8 @@
#include "etnaviv_priv.h"
#include "etnaviv_drmif.h"
#include "hwdb/etna_hwdb.h"
#include "hw/common.xml.h"
/* Enum with indices for each of the feature words */
@@ -163,6 +165,7 @@ static uint64_t get_param(struct etna_device *dev, uint32_t core, uint32_t param
struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core)
{
struct etna_gpu *gpu;
bool core_info_okay = false;
gpu = calloc(1, sizeof(*gpu));
if (!gpu) {
@@ -185,9 +188,13 @@ struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core)
gpu->info.product_id = get_param(dev, core, ETNAVIV_PARAM_GPU_PRODUCT_ID);
gpu->info.customer_id = get_param(dev, core, ETNAVIV_PARAM_GPU_CUSTOMER_ID);
gpu->info.eco_id = get_param(dev, core, ETNAVIV_PARAM_GPU_ECO_ID);
core_info_okay = etna_query_feature_db(&gpu->info);
DEBUG_MSG(" Found entry in hwdb: %u\n", core_info_okay);
}
query_features_from_kernel(gpu);
if (!core_info_okay)
query_features_from_kernel(gpu);
return gpu;
fail:
+3
View File
@@ -45,6 +45,9 @@ libetnaviv_drm = static_library(
dep_valgrind,
idep_etna_common,
],
link_with : [
libetnaviv_hwdb
],
build_by_default : false,
)