[Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Daniel Stone
From: Jason Ekstrand This commit fixes two bugs in intel_from_planar. First, if the planar format was non-NULL but only had a single plane, we were falling through to the planar case. If we had a CCS modifier and plane == 1, we would return NULL instead of the CCS plane. Second, if we did end

Re: [Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Jason Ekstrand
On Mon, Feb 12, 2018 at 9:45 AM, Daniel Stone wrote: > Hi, > > On 12 February 2018 at 17:16, Jason Ekstrand wrote: > > On Mon, Feb 12, 2018 at 6:36 AM, Daniel Stone > wrote: > >> On further thought, I don't see how this could work at all. If we call > >> fromPlanar on plane 0 of a non-planar im

Re: [Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Daniel Stone
Hi, On 12 February 2018 at 17:16, Jason Ekstrand wrote: > On Mon, Feb 12, 2018 at 6:36 AM, Daniel Stone wrote: >> On further thought, I don't see how this could work at all. If we call >> fromPlanar on plane 0 of a non-planar image with an aux plane, we need >> to land in the first branch (due t

Re: [Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Jason Ekstrand
On Mon, Feb 12, 2018 at 6:36 AM, Daniel Stone wrote: > Hi, > > On 10 February 2018 at 06:50, Jason Ekstrand wrote: > > -} else if (parent->planar_format == NULL) { > > + > > +const struct intel_image_format *f = parent->planar_format; > > +const int nplanes = f ? f->nplanes : 1; > >

Re: [Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Daniel Stone
Hi, On 10 February 2018 at 06:50, Jason Ekstrand wrote: > -} else if (parent->planar_format == NULL) { > + > +const struct intel_image_format *f = parent->planar_format; > +const int nplanes = f ? f->nplanes : 1; > + > +if (plane > nplanes) { > + if (parent->modifier == DRM_

Re: [Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-12 Thread Daniel Stone
Hi Jason, On 10 February 2018 at 06:50, Jason Ekstrand wrote: > intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate) > { > int width, height, offset, stride, dri_format, index; > -const struct intel_image_format *f; > __DRIimage *image; > > -if (parent == NULL

[Mesa-dev] [PATCH] i965: Fix bugs in intel_from_planar

2018-02-09 Thread Jason Ekstrand
This commit fixes two bugs in intel_from_planar. First, if the planar format was non-NULL but only had a single plane, we were falling through to the planar case. If we had a CCS modifier and plane == 1, we would return NULL instead of the CCS plane. Second, if we did end up in the planar_format