| @@ -72,6 +72,14 @@ int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value) · 71 unmodified lines |
| 72 | *value = gpu->identity.minor_features3; | 72 | *value = gpu->identity.minor_features3; |
| 73 | break; | 73 | break; |
| 74 | | 74 | |
| | 75 | case ETNAVIV_PARAM_GPU_FEATURES_5: |
| | 76 | *value = gpu->identity.minor_features4; |
| | 77 | break; |
| | 78 | |
| | 79 | case ETNAVIV_PARAM_GPU_FEATURES_6: |
| | 80 | *value = gpu->identity.minor_features5; |
| | 81 | break; |
| | 82 | |
| 75 | case ETNAVIV_PARAM_GPU_STREAM_COUNT: | 83 | case ETNAVIV_PARAM_GPU_STREAM_COUNT: |
| 76 | *value = gpu->identity.stream_count; | 84 | *value = gpu->identity.stream_count; |
| 77 | break; | 85 | break; |
| @@ -112,6 +120,10 @@ int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value) · 34 unmodified lines |
| 112 | *value = gpu->identity.num_constants; | 120 | *value = gpu->identity.num_constants; |
| 113 | break; | 121 | break; |
| 114 | | 122 | |
| | 123 | case ETNAVIV_PARAM_GPU_NUM_VARYINGS: |
| | 124 | *value = gpu->identity.varyings_count; |
| | 125 | break; |
| | 126 | |
| 115 | default: | 127 | default: |
| 116 | DBG("%s: invalid param: %u", dev_name(gpu->dev), param); | 128 | DBG("%s: invalid param: %u", dev_name(gpu->dev), param); |
| 117 | return -EINVAL; | 129 | return -EINVAL; |
| @@ -131,10 +143,13 @@ static void etnaviv_hw_specs(struct etnaviv_gpu *gpu) · 13 unmodified lines |
| 131 | { | 143 | { |
| 132 | if (gpu->identity.minor_features0 & | 144 | if (gpu->identity.minor_features0 & |
| 133 | chipMinorFeatures0_MORE_MINOR_FEATURES) { | 145 | chipMinorFeatures0_MORE_MINOR_FEATURES) { |
| 134 | u32 specs[2]; | 146 | u32 specs[4]; |
| | 147 | unsigned int streams; |
| 135 | | 148 | |
| 136 | specs[0] = gpu_read(gpu, VIVS_HI_CHIP_SPECS); | 149 | specs[0] = gpu_read(gpu, VIVS_HI_CHIP_SPECS); |
| 137 | specs[1] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_2); | 150 | specs[1] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_2); |
| | 151 | specs[2] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_3); |
| | 152 | specs[3] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_4); |
| 138 | | 153 | |
| 139 | gpu->identity.stream_count = etnaviv_field(specs[0], | 154 | gpu->identity.stream_count = etnaviv_field(specs[0], |
| 140 | VIVS_HI_CHIP_SPECS_STREAM_COUNT); | 155 | VIVS_HI_CHIP_SPECS_STREAM_COUNT); |
| @@ -158,6 +173,15 @@ static void etnaviv_hw_specs(struct etnaviv_gpu *gpu) · 17 unmodified lines |
| 158 | VIVS_HI_CHIP_SPECS_2_INSTRUCTION_COUNT); | 173 | VIVS_HI_CHIP_SPECS_2_INSTRUCTION_COUNT); |
| 159 | gpu->identity.num_constants = etnaviv_field(specs[1], | 174 | gpu->identity.num_constants = etnaviv_field(specs[1], |
| 160 | VIVS_HI_CHIP_SPECS_2_NUM_CONSTANTS); | 175 | VIVS_HI_CHIP_SPECS_2_NUM_CONSTANTS); |
| | 176 | |
| | 177 | gpu->identity.varyings_count = etnaviv_field(specs[2], |
| | 178 | VIVS_HI_CHIP_SPECS_3_VARYINGS_COUNT); |
| | 179 | |
| | 180 | /* This overrides the value from older register if non-zero */ |
| | 181 | streams = etnaviv_field(specs[3], |
| | 182 | VIVS_HI_CHIP_SPECS_4_STREAM_COUNT); |
| | 183 | if (streams) |
| | 184 | gpu->identity.stream_count = streams; |
| 161 | } | 185 | } |
| 162 | | 186 | |
| 163 | /* Fill in the stream count if not specified */ | 187 | /* Fill in the stream count if not specified */ |
| @@ -239,6 +263,30 @@ static void etnaviv_hw_specs(struct etnaviv_gpu *gpu) · 75 unmodified lines |
| 239 | | 263 | |
| 240 | if (gpu->identity.num_constants == 0) | 264 | if (gpu->identity.num_constants == 0) |
| 241 | gpu->identity.num_constants = 168; | 265 | gpu->identity.num_constants = 168; |
| | 266 | |
| | 267 | if (gpu->identity.varyings_count == 0) { |
| | 268 | if (gpu->identity.minor_features1 & chipMinorFeatures1_HALTI0) |
| | 269 | gpu->identity.varyings_count = 12; |
| | 270 | else |
| | 271 | gpu->identity.varyings_count = 8; |
| | 272 | } |
| | 273 | |
| | 274 | /* |
| | 275 | * For some cores, two varyings are consumed for position, so the |
| | 276 | * maximum varying count needs to be reduced by one. |
| | 277 | */ |
| | 278 | if (etnaviv_is_model_rev(gpu, GC5000, 0x5434) || |
| | 279 | etnaviv_is_model_rev(gpu, GC4000, 0x5222) || |
| | 280 | etnaviv_is_model_rev(gpu, GC4000, 0x5245) || |
| | 281 | etnaviv_is_model_rev(gpu, GC4000, 0x5208) || |
| | 282 | etnaviv_is_model_rev(gpu, GC3000, 0x5435) || |
| | 283 | etnaviv_is_model_rev(gpu, GC2200, 0x5244) || |
| | 284 | etnaviv_is_model_rev(gpu, GC2100, 0x5108) || |
| | 285 | etnaviv_is_model_rev(gpu, GC2000, 0x5108) || |
| | 286 | etnaviv_is_model_rev(gpu, GC1500, 0x5246) || |
| | 287 | etnaviv_is_model_rev(gpu, GC880, 0x5107) || |
| | 288 | etnaviv_is_model_rev(gpu, GC880, 0x5106)) |
| | 289 | gpu->identity.varyings_count -= 1; |
| 242 | } | 290 | } |
| 243 | | 291 | |
| 244 | static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) | 292 | static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) |
| @@ -305,6 +353,8 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) · 60 unmodified lines |
| 305 | gpu->identity.minor_features1 = 0; | 353 | gpu->identity.minor_features1 = 0; |
| 306 | gpu->identity.minor_features2 = 0; | 354 | gpu->identity.minor_features2 = 0; |
| 307 | gpu->identity.minor_features3 = 0; | 355 | gpu->identity.minor_features3 = 0; |
| | 356 | gpu->identity.minor_features4 = 0; |
| | 357 | gpu->identity.minor_features5 = 0; |
| 308 | } else | 358 | } else |
| 309 | gpu->identity.minor_features0 = | 359 | gpu->identity.minor_features0 = |
| 310 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_0); | 360 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_0); |
| @@ -317,6 +367,10 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) · 6 unmodified lines |
| 317 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_2); | 367 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_2); |
| 318 | gpu->identity.minor_features3 = | 368 | gpu->identity.minor_features3 = |
| 319 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_3); | 369 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_3); |
| | 370 | gpu->identity.minor_features4 = |
| | 371 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_4); |
| | 372 | gpu->identity.minor_features5 = |
| | 373 | gpu_read(gpu, VIVS_HI_CHIP_MINOR_FEATURE_5); |
| 320 | } | 374 | } |
| 321 | | 375 | |
| 322 | /* GC600 idle register reports zero bits where modules aren't present */ | 376 | /* GC600 idle register reports zero bits where modules aren't present */ |
| @@ -645,6 +699,10 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) · 322 unmodified lines |
| 645 | gpu->identity.minor_features2); | 699 | gpu->identity.minor_features2); |
| 646 | seq_printf(m, "\t minor_features3: 0x%08x\n", | 700 | seq_printf(m, "\t minor_features3: 0x%08x\n", |
| 647 | gpu->identity.minor_features3); | 701 | gpu->identity.minor_features3); |
| | 702 | seq_printf(m, "\t minor_features4: 0x%08x\n", |
| | 703 | gpu->identity.minor_features4); |
| | 704 | seq_printf(m, "\t minor_features5: 0x%08x\n", |
| | 705 | gpu->identity.minor_features5); |
| 648 | | 706 | |
| 649 | seq_puts(m, "\tspecs\n"); | 707 | seq_puts(m, "\tspecs\n"); |
| 650 | seq_printf(m, "\t stream_count: %d\n", | 708 | seq_printf(m, "\t stream_count: %d\n", |
| @@ -667,6 +725,8 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) · 16 unmodified lines |
| 667 | gpu->identity.instruction_count); | 725 | gpu->identity.instruction_count); |
| 668 | seq_printf(m, "\t num_constants: %d\n", | 726 | seq_printf(m, "\t num_constants: %d\n", |
| 669 | gpu->identity.num_constants); | 727 | gpu->identity.num_constants); |
| | 728 | seq_printf(m, "\t varyings_count: %d\n", |
| | 729 | gpu->identity.varyings_count); |
| 670 | | 730 | |
| 671 | seq_printf(m, "\taxi: 0x%08x\n", axi); | 731 | seq_printf(m, "\taxi: 0x%08x\n", axi); |
| 672 | seq_printf(m, "\tidle: 0x%08x\n", idle); | 732 | seq_printf(m, "\tidle: 0x%08x\n", idle); |