diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-07-17 18:45:15 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-08-28 17:11:24 +0300 |
commit | b966dd93a30f41581fe1dbf9bc1c4a29b552ca05 (patch) | |
tree | 61fa31bbbd7d8e0a62ee5f432021b8d0587355f3 | |
parent | c40743d3fce5055682d31610519758dd7379c0f8 (diff) |
tests/gem_render_copy: Fix clipped height
Assign the clipped height to 'h', not 'w'. This didn't cause any
problems so far because we use square buffers.
Also get rid of the gcc variable shadowing warnings by not nesting the
min()/max().
Fixes: aaa23eff21a1 ("tests/gem_render_copy: Use a more elaborate pattern of pixels")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
-rw-r--r-- | tests/gem_render_copy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c index 238e70e9..135375a9 100644 --- a/tests/gem_render_copy.c +++ b/tests/gem_render_copy.c @@ -254,8 +254,11 @@ scratch_buf_copy(data_t *data, linear_src = gem_mmap__gtt(data->drm_fd, src->bo->handle, src->bo->size, PROT_READ); - w = min(w, min(width - sx, width - dx)); - w = min(h, min(height - sy, height - dy)); + w = min(w, width - sx); + w = min(w, width - dx); + + h = min(h, height - sy); + h = min(h, height - dy); for (int y = 0; y < h; y++) { igt_memcpy_from_wc(&linear_dst[(dy+y) * width + dx], |