diff mbox

[2/2] etnaviv: use stream count from VIVS_HI_CHIP_SPECS_4

Message ID 1453187110-19388-2-git-send-email-christian.gmeiner@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christian Gmeiner Jan. 19, 2016, 7:05 a.m. UTC
Freescales v5 kernel driver reads stream count from SPECS_4 register
and if that value is 0 it falls back to the value from CHIP_SPECS.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Christian Gmeiner Jan. 19, 2016, 8:13 a.m. UTC | #1
2016-01-19 8:05 GMT+01:00 Christian Gmeiner <christian.gmeiner@gmail.com>:
> Freescales v5 kernel driver reads stream count from SPECS_4 register
> and if that value is 0 it falls back to the value from CHIP_SPECS.
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index e4f6008..926e369 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -133,10 +133,17 @@ static void etnaviv_hw_specs(struct etnaviv_gpu *gpu)

Here I am missing the specs array change - shame on me.


>                 specs[0] = gpu_read(gpu, VIVS_HI_CHIP_SPECS);
>                 specs[1] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_2);
>                 specs[2] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_3);
> +               specs[3] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_4);
>
>                 gpu->identity.stream_count =
> -                       (specs[0] & VIVS_HI_CHIP_SPECS_STREAM_COUNT__MASK)
> -                               >> VIVS_HI_CHIP_SPECS_STREAM_COUNT__SHIFT;
> +                       (specs[3] & VIVS_HI_CHIP_SPECS_4_STREAM_COUNT__MASK)
> +                               >> VIVS_HI_CHIP_SPECS_4_STREAM_COUNT__SHIFT;
> +
> +               if (gpu->identity.stream_count == 0)
> +                       gpu->identity.stream_count =
> +                               (specs[0] & VIVS_HI_CHIP_SPECS_STREAM_COUNT__MASK)
> +                                       >> VIVS_HI_CHIP_SPECS_STREAM_COUNT__SHIFT;
> +
>                 gpu->identity.register_max =
>                         (specs[0] & VIVS_HI_CHIP_SPECS_REGISTER_MAX__MASK)
>                                 >> VIVS_HI_CHIP_SPECS_REGISTER_MAX__SHIFT;

Will send a V2 later the day.

greets
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner
diff mbox

Patch

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index e4f6008..926e369 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -133,10 +133,17 @@  static void etnaviv_hw_specs(struct etnaviv_gpu *gpu)
 		specs[0] = gpu_read(gpu, VIVS_HI_CHIP_SPECS);
 		specs[1] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_2);
 		specs[2] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_3);
+		specs[3] = gpu_read(gpu, VIVS_HI_CHIP_SPECS_4);
 
 		gpu->identity.stream_count =
-			(specs[0] & VIVS_HI_CHIP_SPECS_STREAM_COUNT__MASK)
-				>> VIVS_HI_CHIP_SPECS_STREAM_COUNT__SHIFT;
+			(specs[3] & VIVS_HI_CHIP_SPECS_4_STREAM_COUNT__MASK)
+				>> VIVS_HI_CHIP_SPECS_4_STREAM_COUNT__SHIFT;
+
+		if (gpu->identity.stream_count == 0)
+			gpu->identity.stream_count =
+				(specs[0] & VIVS_HI_CHIP_SPECS_STREAM_COUNT__MASK)
+					>> VIVS_HI_CHIP_SPECS_STREAM_COUNT__SHIFT;
+
 		gpu->identity.register_max =
 			(specs[0] & VIVS_HI_CHIP_SPECS_REGISTER_MAX__MASK)
 				>> VIVS_HI_CHIP_SPECS_REGISTER_MAX__SHIFT;