[Mesa-dev] [PATCH resend 5/7] i965: Upload binding tables in hw-generated binding table format.

Kenneth Graunke kenneth at whitecape.org
Tue Jun 2 01:25:48 PDT 2015

On Tuesday, June 02, 2015 12:58:29 AM Kenneth Graunke wrote:
> As I mentioned in my reply to patch 3, I think you need some sort of
> "did the buffer fill up?" check.  Perhaps make a function to reserve
> space, advancing next_offset and returning the offset to use:
> static uint32_t
> reserve_hw_bt_space(struct brw_context *brw, unsigned bytes)
> {
>    if (brw->hw_bt_pool.next_offset + bytes >= hw_bt_pool.bo->size) {
>       gen7_reset_hw_bt_pool_offsets();
>    }
>    uint32_t offset = brw->hw_bt_pool.next_offset;
>    brw->hw_bt_pool.next_offset += ALIGN(bytes, 64);
>    return offset;
> }
> That would reduce the number of if (brw->has_resource_streamer) checks a
> bit too...

By the way, you'll probably also want to implement this workaround:

"WaStateBindingTableOverfetch: HW over fetches two cachelines of binding
 table indices.  When using the resource streamer, SW needs to pad
 binding table pointer updates with an additional two cache lines."

So you actually need to check:
if (next_offset + bytes >= hw_bt_pool.bo->size - 128)

Which reminds me.  Your earlier patches had all kinds of workarounds
for Haswell resource streamer hardware errata.  Dummy 3DPRIMITIVE
commands come to mind.  What happened to those?  Surely they're still

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150602/e96ea7b9/attachment.sig>

More information about the mesa-dev mailing list