From d48faad3c2d7efb7f4bf727b63487071c4a75e7a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 18 Jun 2014 10:24:04 -0400 Subject: freedreno/a3xx: enable/disable wa's based on patch-level It seems like for the most part, different behaviors, workarounds, etc, should be conditional on GPU patch revision (ie. a320.0 vs a320.2) rather than GPU id (a320 vs a330). Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/freedreno_screen.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gallium/drivers/freedreno/freedreno_screen.c') diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index c574cb81f6a..d4a928a7c1a 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -451,6 +451,23 @@ fd_screen_create(struct fd_device *dev) } screen->gpu_id = val; + if (fd_pipe_get_param(screen->pipe, FD_CHIP_ID, &val)) { + DBG("could not get chip-id"); + /* older kernels may not have this property: */ + unsigned core = screen->gpu_id / 100; + unsigned major = (screen->gpu_id % 100) / 10; + unsigned minor = screen->gpu_id % 10; + unsigned patch = 0; /* assume the worst */ + val = (patch & 0xff) | ((minor & 0xff) << 8) | + ((major & 0xff) << 16) | ((core & 0xff) << 24); + } + screen->chip_id = val; + + DBG("Pipe Info:"); + DBG(" GPU-id: %d", screen->gpu_id); + DBG(" Chip-id: 0x%08x", screen->chip_id); + DBG(" GMEM size: 0x%08x", screen->gmemsize_bytes); + /* explicitly checking for GPU revisions that are known to work. This * may be overly conservative for a3xx, where spoofing the gpu_id with * the blob driver seems to generate identical cmdstream dumps. But -- cgit v1.2.3