etnaviv: detect v4 compression
authorJonathan Marek <jonathan@marek.ca>
Mon, 1 Jul 2019 23:31:46 +0000 (19:31 -0400)
committerJonathan Marek <jonathan@marek.ca>
Thu, 4 Jul 2019 18:05:18 +0000 (14:05 -0400)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/etnaviv/drm/etnaviv_drmif.h
src/etnaviv/drm/etnaviv_gpu.c
src/gallium/drivers/etnaviv/etnaviv_internal.h
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/etnaviv/etnaviv_screen.h

index 5a6bef8d12d1bce40fb462a9227bcea31bd23b0c..675c32fe05188d7086d186e5e607507ffb52786e 100644 (file)
@@ -56,6 +56,7 @@ enum etna_param_id {
        ETNA_GPU_FEATURES_4                = 0x7,
        ETNA_GPU_FEATURES_5                = 0x8,
        ETNA_GPU_FEATURES_6                = 0x9,
+       ETNA_GPU_FEATURES_7                = 0xa,
 
        ETNA_GPU_STREAM_COUNT              = 0x10,
        ETNA_GPU_REGISTER_MAX              = 0x11,
index f7efa0289f9fbde33d5493f7ee1a7972c0a0d64c..81d6f82167733df98e3a8ddca830275d6171d844 100644 (file)
@@ -112,6 +112,9 @@ int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param,
        case ETNA_GPU_FEATURES_6:
                *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_6);
                return 0;
+       case ETNA_GPU_FEATURES_7:
+               *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_7);
+               return 0;
        case ETNA_GPU_STREAM_COUNT:
                *value = get_param(dev, core, ETNA_GPU_STREAM_COUNT);
                return 0;
index c00101732e2c29c91e97c22e62d7678fee32c623..27b6c3b28e7b3a8cfe989d023451a438525a5c7d 100644 (file)
@@ -76,6 +76,8 @@ struct etna_specs {
    unsigned has_new_transcendentals : 1;
    /* has the new dp2/dpX_norm instructions, among others */
    unsigned has_halti2_instructions : 1;
+   /* has V4_COMPRESSION */
+   unsigned v4_compression : 1;
    /* supports single-buffer rendering with multiple pixel pipes */
    unsigned single_buffer : 1;
    /* has unified uniforms memory */
index ec6f30210016b8cc870665d36bfcf3c251a599e8..18c581fda204da2094a86bfb6ff37ba742cdbf9a 100644 (file)
@@ -613,6 +613,8 @@ etna_get_specs(struct etna_screen *screen)
       VIV_FEATURE(screen, chipMinorFeatures3, HAS_FAST_TRANSCENDENTALS);
    screen->specs.has_halti2_instructions =
       VIV_FEATURE(screen, chipMinorFeatures4, HALTI2);
+   screen->specs.v4_compression =
+      VIV_FEATURE(screen, chipMinorFeatures6, V4_COMPRESSION);
 
    if (screen->specs.halti >= 5) {
       /* GC7000 - this core must load shaders from memory. */
@@ -832,6 +834,12 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
    }
    screen->features[6] = val;
 
+   if (etna_gpu_get_param(screen->gpu, ETNA_GPU_FEATURES_7, &val)) {
+      DBG("could not get ETNA_GPU_FEATURES_7");
+      goto fail;
+   }
+   screen->features[7] = val;
+
    if (!etna_get_specs(screen))
       goto fail;
 
index 9757985526ecf6da3a09dee8f6d5e88e85512cf6..4e850d4b7ee7d339c412edaa0511f4672fc91443 100644 (file)
@@ -50,6 +50,7 @@ enum viv_features_word {
    viv_chipMinorFeatures3 = 4,
    viv_chipMinorFeatures4 = 5,
    viv_chipMinorFeatures5 = 6,
+   viv_chipMinorFeatures6 = 7,
    VIV_FEATURES_WORD_COUNT /* Must be last */
 };