diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-11-16 15:18:24 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-11-20 17:37:05 +0100 |
commit | 10c983077a782ff9d02b6e5c47281039830fe6fb (patch) | |
tree | c91ced2d113943a4e11dde0dcafd581163027152 /lib/intel_batchbuffer.c | |
parent | fdcdfa1e220c5070072d5dac9523cd105e7406c2 (diff) |
lib/batchbuffer: Set bpp in igt_buf.
We want to allow bpp = 8 or 16, so make sure we set the bpp
in igt_buf. This way we can extend rendercopy to support
other values for bpp.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
[mlankhorst: Fix double ;; (Ville]
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'lib/intel_batchbuffer.c')
-rw-r--r-- | lib/intel_batchbuffer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index c13b1dc4..ad2e718f 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -511,7 +511,7 @@ intel_copy_bo(struct intel_batchbuffer *batch, */ unsigned igt_buf_width(const struct igt_buf *buf) { - return buf->stride/sizeof(uint32_t); + return buf->stride/(buf->bpp / 8); } /** @@ -764,7 +764,6 @@ void igt_blitter_fast_copy__raw(int fd, * @src_y: source pixel y-coordination * @width: width of the copied rectangle * @height: height of the copied rectangle - * @bpp: source and destination bits per pixel * @dst: destination i-g-t buffer object * @dst_delta: offset into the destination i-g-t bo * @dst_x: destination pixel x-coordination @@ -785,10 +784,12 @@ void igt_blitter_fast_copy(struct intel_batchbuffer *batch, uint32_t src_pitch, dst_pitch; uint32_t dword0, dword1; + igt_assert(src->bpp == dst->bpp); + src_pitch = fast_copy_pitch(src->stride, src->tiling); dst_pitch = fast_copy_pitch(dst->stride, src->tiling); dword0 = fast_copy_dword0(src->tiling, dst->tiling); - dword1 = fast_copy_dword1(src->tiling, dst->tiling, bpp); + dword1 = fast_copy_dword1(src->tiling, dst->tiling, dst->bpp); #define CHECK_RANGE(x) ((x) >= 0 && (x) < (1 << 15)) assert(CHECK_RANGE(src_x) && CHECK_RANGE(src_y) && |