From: "Zhao, Yakui" <[email protected]> Some machines have two BSD video rings. Sometimes the user-space application want to specify which BSD ring is to dispatch the video command. In such case the override flag is needed so that the kernel can handle it.
Reviewed-by: Xiang Haihao <[email protected]> Signed-off-by: Zhao Yakui <[email protected]> --- src/intel_batchbuffer.c | 24 ++++++++++++++++++++++++ src/intel_batchbuffer.h | 8 ++++++++ 2 files changed, 32 insertions(+) diff --git a/src/intel_batchbuffer.c b/src/intel_batchbuffer.c index fd84fe0..60178c6 100644 --- a/src/intel_batchbuffer.c +++ b/src/intel_batchbuffer.c @@ -34,6 +34,11 @@ #define MAX_BATCH_SIZE 0x400000 +#define LOCAL_I915_EXEC_BSD_MASK (3<<13) +#define LOCAL_I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */ +#define LOCAL_I915_EXEC_BSD_RING0 (1<<13) +#define LOCAL_I915_EXEC_BSD_RING1 (2<<13) + static void intel_batchbuffer_reset(struct intel_batchbuffer *batch, int buffer_size) { @@ -370,6 +375,25 @@ intel_batchbuffer_start_atomic_veb(struct intel_batchbuffer *batch, unsigned int intel_batchbuffer_start_atomic_helper(batch, I915_EXEC_VEBOX, size); } +void intel_batchbuffer_start_atomic_bcs_override(struct intel_batchbuffer *batch, unsigned int size, + bsd_ring_flag override_flag) +{ + uint32_t ring_flag; + + switch(override_flag) { + case BSD_RING0: + ring_flag = I915_EXEC_BSD + LOCAL_I915_EXEC_BSD_RING0; + break; + case BSD_RING1: + ring_flag = I915_EXEC_BSD + LOCAL_I915_EXEC_BSD_RING1; + break; + default: + ring_flag = I915_EXEC_BSD + LOCAL_I915_EXEC_BSD_DEFAULT; + break; + } + intel_batchbuffer_start_atomic_helper(batch, ring_flag, size); +} + void intel_batchbuffer_end_atomic(struct intel_batchbuffer *batch) diff --git a/src/intel_batchbuffer.h b/src/intel_batchbuffer.h index e4d0994..41d359d 100644 --- a/src/intel_batchbuffer.h +++ b/src/intel_batchbuffer.h @@ -51,6 +51,14 @@ int intel_batchbuffer_check_free_space(struct intel_batchbuffer *batch, int size int intel_batchbuffer_used_size(struct intel_batchbuffer *batch); void intel_batchbuffer_align(struct intel_batchbuffer *batch, unsigned int alignedment); +typedef enum { + BSD_DEFAULT, + BSD_RING0, + BSD_RING1, +} bsd_ring_flag; + +void intel_batchbuffer_start_atomic_bcs_override(struct intel_batchbuffer *batch, unsigned int size, + bsd_ring_flag override_flag); #define __BEGIN_BATCH(batch, n, f) do { \ assert(f == (batch->flag & I915_EXEC_RING_MASK)); \ -- 1.9.1 _______________________________________________ Libva mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libva
