[RFC 3/3] xfree86: Support driver loading via OutputClass

Aaron Plattner aplattner at nvidia.com
Thu Feb 13 14:21:54 PST 2014


On 02/13/2014 02:13 PM, Thierry Reding wrote:
> On Thu, Feb 13, 2014 at 01:36:17PM -0800, Aaron Plattner wrote:
>> On 02/13/2014 05:22 AM, Thierry Reding wrote:
> [...]
>>> diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
> [...]
>>> +static Bool
>>> +MatchToken(const char *value, struct xorg_list *patterns,
>>> +           int (*compare)(const char *, const char *))
>>> +{
> [...]
>>> +}
>>
>> It's a little unfortunate to have to copy this from xf86input.c, but I don't
>> have a good suggestion for where would be a better place to move it.
>
> I could move it somewhere into hw/xfree86/parser perhaps into a new file
> xf86tokens.c or similar.
>
>>> @@ -208,6 +284,8 @@ xf86PlatformMatchDriver(char *matches[], int nmatches)
>>>               if ((info != NULL) && (j < nmatches)) {
>>>                   j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j);
>>>               }
>>> +
>>> +            j += xf86OutputClassDriverList(i, &matches[j], nmatches - j);
>>
>> This works, but it sorts the server built-in drivers ahead of the Output
>> class ones.  Do you think it would be reasonable to move this line earlier
>> so drivers configured this way take precedence over the ones from
>> xf86VideoPtrToDriverList?
>
> I'm slightly reluctant to do that for fear of breaking things. Last time
> I tried to implement this (though the solution was rather different from
> this one) it broke in some subtle ways.
>
> That said, these matches will only be added if configuration snippets do
> exist. One could argue that configuration files should override built-in
> defaults. So I guess it would be reasonable, yes.

Right.  I want to be able to have a conf snippet that loads nvidia_drv, 
and having the server automatically use nv_drv first would break that.

> Given the above, would you say that these should also take precedence
> over the ones added by xf86MatchDriverFromFiles()? That would probably
> require another patch because that function assumes that it fills the
> beginning of the list.

I don't care as much about that.  I'd be fine with the new line being 
between xf86MatchDriverFromFiles() and xf86VideoPtrToDriverList().

-- 
Aaron


More information about the xorg-devel mailing list