[igt-dev] [PATCH i-g-t 05/25] tests/gem_render_copy: Fix clipped height
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Aug 28 14:21:11 UTC 2018
On Thu, Aug 23, 2018 at 08:17:54PM -0700, Dhinakaran Pandiyan wrote:
>
>
> On Thu, 2018-07-19 at 18:03 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > 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().
> >
> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
Thanks. Patch pushed.
>
> > Fixes: aaa23eff21a1 ("tests/gem_render_copy: Use a more elaborate
> > pattern of pixels")
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > tests/gem_render_copy.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
> > index 238e70e97b5d..135375a90ec2 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],
--
Ville Syrjälä
Intel
More information about the igt-dev
mailing list