From: Imre Deak Date: Mon, 29 Jul 2013 14:21:21 +0000 (+0300) Subject: kms_render: fix gpu-blit for non-32bit bpps X-Git-Tag: intel-gpu-tools-1.4~276 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3052fe2c91f927cce7f6b9340357ea14fed24c9a;p=profile%2Fextras%2Fintel-gpu-tools.git kms_render: fix gpu-blit for non-32bit bpps intel_copy_bo assumes a 32bpp bo, whereas we passed it bos with arbitrary bpp values. This resulted in thrashing GPU memory following the destination bo. Fix this by using a blit helper that can handle other bpps too. Signed-off-by: Imre Deak --- diff --git a/tests/kms_render.c b/tests/kms_render.c index 72bae2f..e6d3e93 100644 --- a/tests/kms_render.c +++ b/tests/kms_render.c @@ -31,6 +31,7 @@ #include #include +#include "drm_fourcc.h" #include "drmtest.h" #include "testdisplay.h" #include "intel_bufmgr.h" @@ -75,7 +76,12 @@ static void gpu_blit(struct kmstest_fb *dst_fb, struct kmstest_fb *src_fb) { drm_intel_bo *dst_bo; drm_intel_bo *src_bo; + int bpp; + assert(dst_fb->drm_format == src_fb->drm_format); + assert(src_fb->drm_format == DRM_FORMAT_RGB565 || + drm_format_to_bpp(src_fb->drm_format) != 16); + bpp = drm_format_to_bpp(src_fb->drm_format); dst_bo = gem_handle_to_libdrm_bo(bufmgr, drm_fd, "destination", dst_fb->gem_handle); assert(dst_bo); @@ -83,7 +89,10 @@ static void gpu_blit(struct kmstest_fb *dst_fb, struct kmstest_fb *src_fb) src_fb->gem_handle); assert(src_bo); - intel_copy_bo(batch, dst_bo, src_bo, src_fb->width, src_fb->height); + intel_blt_copy(batch, + src_bo, 0, 0, src_fb->width * bpp / 8, + dst_bo, 0, 0, dst_fb->width * bpp / 8, + src_fb->width, src_fb->height, bpp); intel_batchbuffer_flush(batch); gem_quiescent_gpu(drm_fd);