broadcom/vc5: Don't allocate simulator BOs at offset 0.
authorEric Anholt <eric@anholt.net>
Thu, 12 Apr 2018 22:19:42 +0000 (15:19 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 24 Apr 2018 17:37:29 +0000 (10:37 -0700)
The kernel won't return us BOs at offset 0 (because things like OQs
wouldn't work there), so we shouldn't in the simulator either.

src/gallium/drivers/vc5/vc5_simulator.c

index ee4ffb28c0410875f0fbc0348b2a4a0d9cff3bca..5fbcad346adc3cd3da1fe0fba5c93cd372448232 100644 (file)
@@ -594,7 +594,11 @@ vc5_simulator_init_global(const struct v3d_device_info *devinfo)
                 v3d_hw_get_mem(sim_state.v3d, &sim_state.mem_size,
                                &sim_state.mem);
 
-        sim_state.heap = u_mmInit(0, sim_state.mem_size);
+        /* Allocate from anywhere from 4096 up.  We don't allocate at 0,
+         * because for OQs and some other addresses in the HW, 0 means
+         * disabled.
+         */
+        sim_state.heap = u_mmInit(4096, sim_state.mem_size - 4096);
 
         /* Make a block of 0xd0 at address 0 to make sure we don't screw up
          * and land there.