Skip to content
  • Matt Turner's avatar
    i965: Optimize batchbuffer macros. · f11c6f09
    Matt Turner authored
    Previously OUT_BATCH was just a macro around an inline function which
    does
    
       brw->batch.map[brw->batch.used++] = dword;
    
    When making consecutive calls to intel_batchbuffer_emit_dword() the
    compiler isn't able to recognize that we're writing consecutive memory
    locations or that it doesn't need to write batch.used back to memory
    each time.
    
    We can avoid both of these problems by making a local pointer to the
    next location in the batch in BEGIN_BATCH().
    
    Cuts 18k from the .text size.
    
       text     data      bss      dec      hex  filename
    4946956   195152    26192  5168300   4edcac  i965_dri.so before
    4928956   195152    26192  5150300   4e965c  i965_dri.so after
    
    This series (including commit c0433948
    
    ) improves performance of Synmark
    OglBatch7 by 8.01389% +/- 0.63922% (n=83) on Ivybridge.
    
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    f11c6f09