etnaviv: fill all minor GPU features from the kernel

The kernel exposes more minor GPU feature registers. Fill them
all into our internal feature struct.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9255>
This commit is contained in:
Lucas Stach 2021-01-20 12:58:53 +01:00 committed by Marge Bot
parent ab942aaed0
commit 8c153bb091
4 changed files with 45 additions and 0 deletions

View File

@ -59,6 +59,10 @@ enum etna_param_id {
ETNA_GPU_FEATURES_6 = 0x9,
ETNA_GPU_FEATURES_7 = 0xa,
ETNA_GPU_FEATURES_8 = 0xb,
ETNA_GPU_FEATURES_9 = 0xc,
ETNA_GPU_FEATURES_10 = 0xd,
ETNA_GPU_FEATURES_11 = 0xe,
ETNA_GPU_FEATURES_12 = 0xf,
ETNA_GPU_STREAM_COUNT = 0x10,
ETNA_GPU_REGISTER_MAX = 0x11,

View File

@ -118,6 +118,18 @@ int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param,
case ETNA_GPU_FEATURES_8:
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_8);
return 0;
case ETNA_GPU_FEATURES_9:
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_9);
return 0;
case ETNA_GPU_FEATURES_10:
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_10);
return 0;
case ETNA_GPU_FEATURES_11:
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_11);
return 0;
case ETNA_GPU_FEATURES_12:
*value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_12);
return 0;
case ETNA_GPU_STREAM_COUNT:
*value = get_param(dev, core, ETNA_GPU_STREAM_COUNT);
return 0;

View File

@ -1063,6 +1063,30 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
}
screen->features[8] = val;
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_9, &val)) {
DBG("could not get ETNA_GPU_FEATURES_9");
goto fail;
}
screen->features[9] = val;
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_10, &val)) {
DBG("could not get ETNA_GPU_FEATURES_10");
goto fail;
}
screen->features[10] = val;
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_11, &val)) {
DBG("could not get ETNA_GPU_FEATURES_11");
goto fail;
}
screen->features[11] = val;
if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_12, &val)) {
DBG("could not get ETNA_GPU_FEATURES_12");
goto fail;
}
screen->features[12] = val;
if (!etna_get_specs(screen))
goto fail;

View File

@ -53,6 +53,11 @@ enum viv_features_word {
viv_chipMinorFeatures5 = 6,
viv_chipMinorFeatures6 = 7,
viv_chipMinorFeatures7 = 8,
viv_chipMinorFeatures8 = 9,
viv_chipMinorFeatures9 = 10,
viv_chipMinorFeatures10 = 11,
viv_chipMinorFeatures11 = 12,
viv_chipMinorFeatures12 = 13,
VIV_FEATURES_WORD_COUNT /* Must be last */
};