[Mesa-dev] [PATCH] st/dri: fix winsys handle stride calculation for block formats

Emil Velikov emil.l.velikov at gmail.com
Thu May 26 11:43:37 UTC 2016


Hi gents,

On 26 May 2016 at 11:28, Philipp Zabel <p.zabel at pengutronix.de> wrote:
> Hi Michel,
>
> Am Donnerstag, den 26.05.2016, 17:59 +0900 schrieb Michel Dänzer:
>> On 25.05.2016 22:20, Philipp Zabel wrote:
>> > This fixes the stride calculation for pipe formats with a block width
>> > larger than one.
>> >
>> > Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
>> > ---
>> >  src/gallium/state_trackers/dri/dri2.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
>> > index 0c84baf..c0b0d21 100644
>> > --- a/src/gallium/state_trackers/dri/dri2.c
>> > +++ b/src/gallium/state_trackers/dri/dri2.c
>> > @@ -804,7 +804,7 @@ dri2_create_image_from_name(__DRIscreen *_screen,
>> >     if (pf == PIPE_FORMAT_NONE)
>> >        return NULL;
>> >
>> > -   whandle.stride = pitch * util_format_get_blocksize(pf);
>> > +   whandle.stride = util_format_get_stride(pf, pitch);
>> >
>> >     return dri2_create_image_from_winsys(_screen, width, height, format,
>> >                                          &whandle, loaderPrivate);
>> >
>>
>> Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
>>
>> Do you need somebody to push this patch for you?
>
> Yes, thank you.
>
Can we add a note if this fixes a real world case (on which driver
and/or format) ? Is it worth adding this patch in stable releases ?

Thanks
Emil


More information about the mesa-dev mailing list