diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2010-11-09 12:52:31 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2010-12-06 12:50:04 +0800 |
commit | ff6eec3e4cdbee3f1afdd3121eee491919ce790a (patch) | |
tree | eb9a973349f553f3ca278895dc1df5a6b72876e4 /i965_drv_video/intel_batchbuffer.c | |
parent | b077c9077327e3b26b2dc4c366a4fc1d61e8f204 (diff) |
i965_drv_video: check batch buffer emitting
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'i965_drv_video/intel_batchbuffer.c')
-rw-r--r-- | i965_drv_video/intel_batchbuffer.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/i965_drv_video/intel_batchbuffer.c b/i965_drv_video/intel_batchbuffer.c index e561e8b..87c2abc 100644 --- a/i965_drv_video/intel_batchbuffer.c +++ b/i965_drv_video/intel_batchbuffer.c @@ -356,3 +356,47 @@ intel_batchbuffer_end_atomic_bcs(VADriverContextP ctx) intel_batchbuffer_end_atomic_helper(intel->batch_bcs); } +static void +intel_batchbuffer_begin_batch_helper(struct intel_batchbuffer *batch, int total) +{ + batch->emit_total = total * 4; + batch->emit_start = batch->ptr; +} + +void +intel_batchbuffer_begin_batch(VADriverContextP ctx, int total) +{ + struct intel_driver_data *intel = intel_driver_data(ctx); + + intel_batchbuffer_begin_batch_helper(intel->batch, total); +} + +void +intel_batchbuffer_begin_batch_bcs(VADriverContextP ctx, int total) +{ + struct intel_driver_data *intel = intel_driver_data(ctx); + + intel_batchbuffer_begin_batch_helper(intel->batch_bcs, total); +} + +static void +intel_batchbuffer_advance_batch_helper(struct intel_batchbuffer *batch) +{ + assert(batch->emit_total == (batch->ptr - batch->emit_start)); +} + +void +intel_batchbuffer_advance_batch(VADriverContextP ctx) +{ + struct intel_driver_data *intel = intel_driver_data(ctx); + + intel_batchbuffer_advance_batch_helper(intel->batch); +} + +void +intel_batchbuffer_advance_batch_bcs(VADriverContextP ctx) +{ + struct intel_driver_data *intel = intel_driver_data(ctx); + + intel_batchbuffer_advance_batch_helper(intel->batch_bcs); +} |