[PATCH 1/2] xserver: add xorg.conf support for gpu devices. (v2)

Keith Packard keithp at keithp.com
Sun Apr 19 21:25:32 PDT 2015


Dave Airlie <airlied at gmail.com> writes:

> On 14 April 2015 at 00:07, Keith Packard <keithp at keithp.com> wrote:
>> Dave Airlie <airlied at gmail.com> writes:
>>
>>> +#define CONF_MAXGPUDEVICES 4
>>>  typedef struct {
>>>      GenericListRec list;
>>>      const char *scrn_identifier;
>>> @@ -276,6 +277,10 @@ typedef struct {
>>>      char *scrn_comment;
>>>      int scrn_virtualX, scrn_virtualY;
>>>      char *match_seat;
>>> +
>>> +    int num_gpu_devices;
>>> +    const char *scrn_gpu_device_str[CONF_MAXGPUDEVICES];
>>> +    XF86ConfDevicePtr scrn_gpu_devices[CONF_MAXGPUDEVICES];
>>
>> It seems like just using realloc would actually make this easier as you
>> wouldn't need to deal with checking for this limit?
>>
>> Hard limits are annoying anyways.
>>
>
> Well I mainly did this because that is what parser does everywhere it takes
> multiple values, it never seems to use realloc for anything like this.
>
> I'd prefer the parser code to be consistent rather than useful, since nobody
> likes to touch or maintain it, and coming back in a few years wondering
> why this is realloc based and the rest isn't could be confusing.

Yeah, match the existing syle, even if sub-optimal. Sounds good to me.

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150419/45168fa0/attachment.sig>


More information about the xorg-devel mailing list