diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2016-01-06 13:36:40 (GMT) |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2016-01-07 10:57:57 (GMT) |
commit | c33246d793b5bb9d8be7c67918136c310185c23d (patch) | |
tree | 77c8ff675729d6ec069c51983610f58f6d53c35e /drivers/gpu/drm/etnaviv | |
parent | ed94add00e290e675c36cef6767d7d1f51a02f28 (diff) | |
download | linux-c33246d793b5bb9d8be7c67918136c310185c23d.tar.xz |
drm/etnaviv: fix workaround for GC500
The hardware description macros define the mask and shifts the wrong
way around for the intended use, leading to the condition never being
true and the chip revision ending up with the wrong value.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index d39093d..056a72e 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -251,9 +251,12 @@ static void etnaviv_hw_identify(struct etnaviv_gpu *gpu) chipIdentity = gpu_read(gpu, VIVS_HI_CHIP_IDENTITY); /* Special case for older graphic cores. */ - if (VIVS_HI_CHIP_IDENTITY_FAMILY(chipIdentity) == 0x01) { + if (((chipIdentity & VIVS_HI_CHIP_IDENTITY_FAMILY__MASK) + >> VIVS_HI_CHIP_IDENTITY_FAMILY__SHIFT) == 0x01) { gpu->identity.model = 0x500; /* gc500 */ - gpu->identity.revision = VIVS_HI_CHIP_IDENTITY_REVISION(chipIdentity); + gpu->identity.revision = + (chipIdentity & VIVS_HI_CHIP_IDENTITY_REVISION__MASK) + >> VIVS_HI_CHIP_IDENTITY_REVISION__SHIFT; } else { gpu->identity.model = gpu_read(gpu, VIVS_HI_CHIP_MODEL); |