+ ctx->mc_buffer,
+ ctx->decode_target,
+ past, future, num_macroblocks,
+ mpeg12_macroblocks, fence);
+}
+
+static void
+sp_mpeg12_surface_fill(struct pipe_video_context *vpipe,
+ struct pipe_surface *dst,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height,
+ unsigned value)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+ float rgba[4] = { 0, 0, 0, 0 };
+
+ assert(vpipe);
+ assert(dst);
+
+ if (ctx->pipe->clear_render_target)
+ ctx->pipe->clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height);
+ else
+ util_clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height);
+}
+
+static void
+sp_mpeg12_surface_copy(struct pipe_video_context *vpipe,
+ struct pipe_surface *dst,
+ unsigned dstx, unsigned dsty,
+ struct pipe_surface *src,
+ unsigned srcx, unsigned srcy,
+ unsigned width, unsigned height)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(dst);
+
+ struct pipe_subresource subdst, subsrc;
+ subdst.face = dst->face;
+ subdst.level = dst->level;
+ subsrc.face = src->face;
+ subsrc.level = src->level;
+
+ if (ctx->pipe->resource_copy_region)
+ ctx->pipe->resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice,
+ src->texture, subsrc, srcx, srcy, src->zslice,
+ width, height);
+ else
+ util_resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice,
+ src->texture, subsrc, srcx, srcy, src->zslice,
+ width, height);
+}
+
+static struct pipe_transfer*
+sp_mpeg12_get_transfer(struct pipe_video_context *vpipe,
+ struct pipe_resource *resource,
+ struct pipe_subresource subresource,
+ unsigned usage, /* a combination of PIPE_TRANSFER_x */
+ const struct pipe_box *box)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(resource);
+ assert(box);
+
+ return ctx->pipe->get_transfer(ctx->pipe, resource, subresource, usage, box);
+}
+
+static void
+sp_mpeg12_transfer_destroy(struct pipe_video_context *vpipe,
+ struct pipe_transfer *transfer)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(transfer);
+
+ ctx->pipe->transfer_destroy(ctx->pipe, transfer);
+}
+
+static void*
+sp_mpeg12_transfer_map(struct pipe_video_context *vpipe,
+ struct pipe_transfer *transfer)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(transfer);
+
+ return ctx->pipe->transfer_map(ctx->pipe, transfer);
+}
+
+static void
+sp_mpeg12_transfer_flush_region(struct pipe_video_context *vpipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(transfer);
+ assert(box);
+
+ ctx->pipe->transfer_flush_region(ctx->pipe, transfer, box);
+}
+
+static void
+sp_mpeg12_transfer_unmap(struct pipe_video_context *vpipe,
+ struct pipe_transfer *transfer)
+{
+ struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+
+ assert(vpipe);
+ assert(transfer);
+
+ ctx->pipe->transfer_unmap(ctx->pipe, transfer);