• Arun Siluvery's avatar
    drm/i915: Add provision to extend Golden context batch · 84e81020
    Arun Siluvery authored
    The Golden batch carries 3D state at the beginning so that HW starts with
    a known state. It is carried as a binary blob which is auto-generated from
    source. The idea was it would be easier to maintain and keep the complexity
    out of the kernel which makes sense as we don't really touch it. However if
    you really need to update it then you need to update generator source and
    keep the binary blob in sync with it.
    
    There is a need to patch this in bxt to send one additional command to enable
    a feature. A solution was to patch the binary data with some additional
    data structures (included as part of auto-generator source) but it was
    unnecessarily complicated.
    
    Chris suggested the idea of having a secondary batch and execute two batch
    buffers. It has clear advantages as we needn't touch the base golden batch,
    can customize secondary/auxiliary batch depending on Gen and can be carried
    in the driver with no dependencies.
    
    This patch adds support for this auxiliary batch which is inserted at the
    end of golden batch and is completely independent from it. Thanks to Mika
    for the preliminary review.
    
    v2: Strictly conform to the batch size requirements to cover Gen2 and
    add comments to clarify overflow check in macro (Chris, Mika).
    
    v3: aux_batch_offset was declared as u64, change it to u32 (Chris)
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Cc: Mika Kuoppala <mika.kuoppala@intel.com>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Armin Reese <armin.c.reese@intel.com>
    Signed-off-by: default avatarArun Siluvery <arun.siluvery@linux.intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    84e81020
intel_lrc.c 72.1 KB