[Mesa-dev] [PATCH 1/4] dri: Fix __DRIconfig reporting of __DRI_ATTRIB_SWAP_METHOD

Michel Dänzer michel at daenzer.net
Thu Aug 10 06:26:27 UTC 2017


On 10/08/17 02:25 PM, Thomas Hellstrom wrote:
> On 08/10/2017 05:20 AM, Michel Dänzer wrote:
>> On 09/08/17 06:53 PM, Thomas Hellstrom wrote:
>>> The attribMap had two entries for this attribute, and
>>> driGetConfigAttribIndex didn't return a proper value for this attribute.
>>> Fix this, and also make sure we return SWAP_UNDEFINED for single-buffer
>>> configs as required by the GLX_OML_swap_method spec.
>>>
>>> Finally bump the dri core extension version to 2, indicating that we
>>> correctly report __DRI_ATTRIB_SWAP_METHOD.
>>>
>>> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
>> [...]
>>
>>> diff --git a/src/mesa/drivers/dri/common/utils.c
>>> b/src/mesa/drivers/dri/common/utils.c
>>> index c37d446..f3ea61e 100644
>>> --- a/src/mesa/drivers/dri/common/utils.c
>>> +++ b/src/mesa/drivers/dri/common/utils.c
>>> @@ -284,8 +284,9 @@ driCreateConfigs(mesa_format format,
>>>               modes->transparentIndex = GLX_DONT_CARE;
>>>               modes->rgbMode = GL_TRUE;
>>>   -            if ( db_modes[i] == GLX_NONE ) {
>>> +            if ( db_modes[i] == GLX_NONE) {
>>>                   modes->doubleBufferMode = GL_FALSE;
>>> +                        modes->swapMethod = GLX_SWAP_UNDEFINED_OML;
>> The indentation of the added line doesn't match that of the previous
>> line. Patch 4 further changes this code (which is also what Brian's
>> comment was about AFAICT) to be even less consistently indented compared
>> to the surrounding code.
> 
> Hmm, Actually this looks awkward in the patches only due to me using
> spaces rather than tabs to indent in the new code (old code uses tabs). 
> Not sure what the preferred strategy is here, use mesa coding style
> (spaces) or old dri coding style (tabs).

I think first priority should be consistency with surrounding code
whenever possible, which it is in this case. If the formatting is to be
changed, it should be done in one go for the whole file or at least big
portions at a time, without making any functional changes at the same time.


> If the latter, we should probably at some point add subsystem editor
> setup files that override the mesa default ones.

I agree.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-dev mailing list