freedreno/log: fix build error
authorRob Clark <robdclark@chromium.org>
Tue, 31 Mar 2020 15:31:00 +0000 (08:31 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Apr 2020 00:51:09 +0000 (00:51 +0000)
It seems some versions of gcc are less clever about const initializers:

```
../src/gallium/drivers/freedreno/freedreno_log.c:58:33: error: initializer element is not constant
 const unsigned msgs_per_chunk = bo_size / sizeof(uint64_t);
                                 ^~~~~~~
```

See https://gitlab.freedesktop.org/mesa/mesa/-/issues/2713

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4390>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4390>

src/gallium/drivers/freedreno/freedreno_log.c

index c1fe4da814220511e46759f477112e8951b4e490..8eb1966aabfb612ef102f1ae581e3db513701f3f 100644 (file)
  * for profiling at that level.
  */
 
-const unsigned bo_size = 0x1000;
-const unsigned msgs_per_chunk = bo_size / sizeof(uint64_t);
+enum {
+       bo_size = 0x1000,
+       msgs_per_chunk = bo_size / sizeof(uint64_t),
+};
 
 struct fd_log_chunk {
        struct list_head node;