[PATCH 1/2] xserver: add xorg.conf support for gpu devices. (v2)
Dave Airlie
airlied at gmail.com
Sun Apr 19 21:01:51 PDT 2015
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.
Dave.
More information about the xorg-devel
mailing list