[Mesa-stable] [Mesa-dev] [PATCH] egl/dri2: expose srgb configs when KHR_gl_colorspace is available

Emil Velikov emil.l.velikov at gmail.com
Sat Nov 7 08:03:20 PST 2015


On 6 November 2015 at 19:26, Marek Olšák <maraeo at gmail.com> wrote:
> On Fri, Nov 6, 2015 at 8:24 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> On Thu, Oct 15, 2015 at 2:28 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>> On 3 October 2015 at 12:19, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>>> On 3 October 2015 at 02:12, Marek Olšák <maraeo at gmail.com> wrote:
>>>>> I'm not sure if this is correct or if we should just return NULL in
>>>>> this case like the "case" statement above that does.
>>>>>
>>>> Actually I was thinking about bailing out when the requested attribute
>>>> is set. I.e.
>>>>
>>>> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
>>>> index 1740ee3..0450269 100644
>>>> --- a/src/egl/drivers/dri2/egl_dri2.c
>>>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>>>> @@ -237,6 +237,8 @@ dri2_add_config(_EGLDisplay *disp, const
>>>> __DRIconfig *dri_config, int id,
>>>>
>>>>       case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
>>>>          srgb = value != 0;
>>>> +         if (!dpy->Extensions.KHR_gl_colorspace && srgb)
>>>> +            return NULL;
>>>>          break;
>>>>
>>>>       default:
>>>>
>>> Guys can anyone give this patch a quick test ? Afaict it is very
>>> uncommon to get here, but it still does the right thing.
>>
>> It doesn't cause any piglit regressions. Sadly, I don't have any EGL
>> apps. eglgears_x11 in mesa/demos is already broken for me on VI/Tonga.
>> It might be a hw-specific issue.
>
> BTW, I had to fix a compile failure in your patch.
>
Hmm seems like we dropped the mesa-dev somewhere along the way.

In brief:
 - there is a typo - s/dpy/disp/
 - with KHR_gl_colorspace enabled or disabled, things seems to work
fine on android land.
 - locally things seem to work as well.

The original conversation can be seen below.
-Emil

On 18 October 2015 at 22:41, Mauro Rossi <issor.oruam at gmail.com> wrote:
> Hi Emil,
>
> I've tested the two patches for egl_dri2.c on top of mesa 11.0.3 and
> 11.1.0devel and I saw no regression.
>
> Mauro
>
> Il venerdì 16 ottobre 2015, Emil Velikov <emil.l.velikov at gmail.com> ha
> scritto:
>>
>> On 15 October 2015 at 22:27, Mauro Rossi <issor.oruam at gmail.com> wrote:
>> > Hi Emil,
>> >
>> > I get the following  building error
>> >
>> > external/mesa/src/egl/drivers/dri2/egl_dri2.c: In function
>> > 'dri2_add_config':
>> > external/mesa/src/egl/drivers/dri2/egl_dri2.c:238:15: error: 'dpy'
>> > undeclared (first use in this function)
>> >           if (!dpy->Extensions.KHR_gl_colorspace && srgb)
>> >                ^
>> >
>> > Shouldn't it be the patched as follows with !disp instead of !dpy?
>> > Thanks  for your confirmation
>> Oops, silly typo :-\
>>
>> Yes you are correct. Can you try the patch in conjunction with the one
>> in https://bugs.freedesktop.org/show_bug.cgi?id=91596#c8
>>
>> Thanks
>> Emil


More information about the mesa-stable mailing list