Commit 3052fe2c authored by Imre Deak's avatar Imre Deak

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's avatarImre Deak <imre.deak@intel.com>
parent 24de8bac
......@@ -31,6 +31,7 @@
#include <unistd.h>
#include <sys/time.h>
#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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment