diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-13 03:35:02 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-13 18:07:22 +0100 |
commit | eaccd444f774ff88f9cfc24fb0a5e5b20f71d749 (patch) | |
tree | e31fe06cde23fdec8b31b043d1d615b572a9a31c /lib | |
parent | 32d41cc7a7fc357758a60f019341805ae1ee418d (diff) |
lib: switch intel_copy_bo to directly take a size
Instead of a width/height combination. Since I've been lazy with the
math this now only accepts page-aligned copy operations, but that's
all we need really.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/intel_batchbuffer.c | 21 | ||||
-rw-r--r-- | lib/intel_batchbuffer.h | 2 |
2 files changed, 10 insertions, 13 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index 931cfca8..195f1b29 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -366,24 +366,21 @@ intel_blt_copy(struct intel_batchbuffer *batch, * @batch: batchbuffer object * @src_bo: source libdrm buffer object * @dst_bo: destination libdrm buffer object - * @width: width of the copied area in 4-byte pixels - * @height: height of the copied area in lines + * @size: size of the copy range in bytes * * This emits a copy operation using blitter commands into the supplied batch - * buffer object. A total of @width times @height bytes from the start of - * @src_bo is copied over to @dst_bo. - * - * FIXME: We need @width and @height to avoid hitting into platform specific - * of the blitter. It would be easier to just accept a size and do the math - * ourselves. + * buffer object. A total of @size bytes from the start of @src_bo is copied + * over to @dst_bo. Note that @size must be page-aligned. */ void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, - int width, int height) + long int size) { + assert(size % 4096 == 0); + intel_blt_copy(batch, - src_bo, 0, 0, width * 4, - dst_bo, 0, 0, width * 4, - width, height, 32); + src_bo, 0, 0, 4096, + dst_bo, 0, 0, 4096, + 4096/4, size/4096, 32); } diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index 65a21d78..10088c2e 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -193,6 +193,6 @@ intel_blt_copy(struct intel_batchbuffer *batch, int width, int height, int bpp); void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, - int width, int height); + long int size); #endif |