[Mesa-dev] [PATCH 06/34] gbm: Export a per plane getter for stride
daniel at fooishbar.org
Sun Feb 5 13:55:54 UTC 2017
On 4 February 2017 at 05:29, Ben Widawsky <ben at bwidawsk.net> wrote:
> On 17-01-31 11:33:39, Jason Ekstrand wrote:
>> On Mon, Jan 23, 2017 at 10:19 PM, Ben Widawsky <ben at bwidawsk.net> wrote:
>>> + /* Preserve legacy behavior if plane is 0 */
>>> + if (plane == 0)
>>> + return _bo->stride;
>> This implies that, for multi-planar images, you have to have the BO stride
>> be the same as the image stride. Do we want this or do we only want to
>> return bo->stride if we don't have enough DRI stuff (in the if below) to
>> use the image? I think it's probably ok either way.
> The biggest problem is if I change it (see hunk below) is that it
> doesn't match the old behavior, and I don't really have a great way to test
> outside of our environment. I went with the path of least risk, however you
> raise a good point.
> Daniel, do you have an opinion here?
I think Jason's suggestion is the right thing to do. The main case I
worry about is dumb buffers, covered by !bo->image, which cannot be
multi-planar. If we ever have a single-planar image where the stride
doesn't match the DRIimage stride, that sounds like something to be
fixed anyway. So, let's go with this and fix up anything which breaks,
though I can't immediately see how that would happen.
More information about the mesa-dev