[Mesa-dev] [PATCH] egl: remove explicit config_id management from dri2_add_config()

Emil Velikov emil.l.velikov at gmail.com
Wed Nov 9 22:12:09 UTC 2016


On 20 October 2016 at 15:47, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> On Friday, 2016-09-30 13:45:55 +0100, Emil Velikov wrote:
>> From: Emil Velikov <emil.velikov at collabora.com>
>>
>> Currently we only saved the id to memcpy the whole _EGLConfig to write
>> back the exact same id value.
>>
>> Remove the unneeded and confusing/misleading code.
>>
>> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
>
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
>
Thanks Eric, yet I've realised how blind I were. Namely...

>> ---
>>  src/egl/drivers/dri2/egl_dri2.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
>> index 1659af6..39e6244 100644
>> --- a/src/egl/drivers/dri2/egl_dri2.c
>> +++ b/src/egl/drivers/dri2/egl_dri2.c
>> @@ -166,7 +166,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
>>     unsigned int dri_masks[4] = { 0, 0, 0, 0 };
>>     _EGLConfig *matching_config;
>>     EGLint num_configs = 0;
>> -   EGLint config_id;
>>     int i;
>>
>>     dri2_dpy = disp->DriverData;
>> @@ -278,7 +277,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
>>        return NULL;
>>     }
>>
>> -   config_id = base.ConfigID;
Here we store the reference of the config_id [which in 99.99% of the
time is the same as id fed to dri2_add_config() by its callers]

>>     base.ConfigID    = EGL_DONT_CARE;
... and then we overwrite it thus we'll end up with EGL_DONT_CARE
after the memcpy. Asserting shortly after in _eglLinkConfig().

-Emil


More information about the mesa-dev mailing list