[Mesa-dev] [PATCH] dri: don't load .drirc from $HOME

Kai Wasserbäch kai at dev.carbon-project.org
Sat Jan 7 17:02:20 UTC 2017


Hey Axel,
Axel Davy wrote on 07.01.2017 14:28:
> Expecting the user to use env vars it ok for power users, but not very
> user-friendly for newbies, or just people who don't like using the command line.
> And that's exactly these users who are likely to use something like driconf.

I would guess, that non-power-users play most games through Steam and there you
have the launch options setting. So no need to go to the command line. Ok, there
might be some Wine users with custom stuff out there, but then I find that many
programs require me to go to the CLI anyway if I want to contain them into a
unique prefix (which IMHO is a good idea regardless of this discussion). And
even if not: editing the .desktop file shouldn't be harder than editing ~/.drirc.

Anyway, I have no strong feelings on this, I just prefer a system, where I can't
screw myself over because I forgot I set some option ages ago.

What I really wouldn't like is the drivers behaving differently. That's sure to
cause support trouble down the line.

Just my 2 cents, though.

Cheers,
Kai


> On 07/01/2017 14:23, Kai Wasserbäch wrote:
>> Hey Marek,
>> maybe <http://mesa3d.org/application-issues.html> should be updated then as
>> well? Just so the page doesn't recommend using driconf? Apart from that, the
>> page is basically useless anyway so maybe deleting it altogether would be best?
>> (What would be nicer to have would be a page listing all options one can set,
>> like the allow_glsl_extension_directive_midshader and similar options.)
>>
>> Apart from that I find the idea (from a user POV) good. If I want options
>> applied I can always set them on the command line while launching. And/Or send a
>> patch for the system dric if I find it important enough. Which reminds me that I
>> wanted to send one for "Divinity: Original Sin Enhanced Edition".
>>
>> Cheers,
>> Kai
>>
>>
>> Marek Olšák wrote on 07.01.2017 13:45:
>>> From: Marek Olšák <marek.olsak at amd.com>
>>>
>>> ~/.drirc is created by the driconf tool (GPL license) and it overrides
>>> system drirc settings and can't be changed by Mesa updates.
>>> This drops support for the tool. It has been a source of major pain
>>> for us and it continues to cause problems.
>>>
>>> If people wanna keep this and enjoy the pain, I will make a v2 that
>>> applies it to radeon drivers only.
>>> ---
>>>   src/mesa/drivers/dri/common/xmlconfig.c | 51 ++++++++++-----------------------
>>>   1 file changed, 15 insertions(+), 36 deletions(-)
>>>
>>> diff --git a/src/mesa/drivers/dri/common/xmlconfig.c
>>> b/src/mesa/drivers/dri/common/xmlconfig.c
>>> index a8f7c9b..3d6cb67 100644
>>> --- a/src/mesa/drivers/dri/common/xmlconfig.c
>>> +++ b/src/mesa/drivers/dri/common/xmlconfig.c
>>> @@ -937,65 +937,44 @@ static void parseOneConfigFile (XML_Parser p) {
>>>       close (fd);
>>>   #undef BUF_SIZE
>>>   }
>>>     #ifndef SYSCONFDIR
>>>   #define SYSCONFDIR "/etc"
>>>   #endif
>>>     void driParseConfigFiles (driOptionCache *cache, const driOptionCache *info,
>>>                 int screenNum, const char *driverName) {
>>> -    char *filenames[2] = { SYSCONFDIR "/drirc", NULL};
>>> -    char *home;
>>> -    uint32_t i;
>>>       struct OptConfData userData;
>>> +    XML_Parser p;
>>>         initOptionCache (cache, info);
>>>         userData.cache = cache;
>>>       userData.screenNum = screenNum;
>>>       userData.driverName = driverName;
>>>       userData.execName = GET_PROGRAM_NAME();
>>>   -    if ((home = getenv ("HOME"))) {
>>> -    uint32_t len = strlen (home);
>>> -    filenames[1] = malloc(len + 7+1);
>>> -    if (filenames[1] == NULL)
>>> -        __driUtilMessage ("Can't allocate memory for %s/.drirc.", home);
>>> -    else {
>>> -        memcpy (filenames[1], home, len);
>>> -        memcpy (filenames[1] + len, "/.drirc", 7+1);
>>> -    }
>>> -    }
>>> -
>>> -    for (i = 0; i < 2; ++i) {
>>> -    XML_Parser p;
>>> -    if (filenames[i] == NULL)
>>> -        continue;
>>> -
>>> -    p = XML_ParserCreate (NULL); /* use encoding specified by file */
>>> -    XML_SetElementHandler (p, optConfStartElem, optConfEndElem);
>>> -    XML_SetUserData (p, &userData);
>>> -    userData.parser = p;
>>> -    userData.name = filenames[i];
>>> -    userData.ignoringDevice = 0;
>>> -    userData.ignoringApp = 0;
>>> -    userData.inDriConf = 0;
>>> -    userData.inDevice = 0;
>>> -    userData.inApp = 0;
>>> -    userData.inOption = 0;
>>> -
>>> -    parseOneConfigFile (p);
>>> -    XML_ParserFree (p);
>>> -    }
>>> -
>>> -    free(filenames[1]);
>>> +    p = XML_ParserCreate (NULL); /* use encoding specified by file */
>>> +    XML_SetElementHandler (p, optConfStartElem, optConfEndElem);
>>> +    XML_SetUserData (p, &userData);
>>> +    userData.parser = p;
>>> +    userData.name = SYSCONFDIR "/drirc";
>>> +    userData.ignoringDevice = 0;
>>> +    userData.ignoringApp = 0;
>>> +    userData.inDriConf = 0;
>>> +    userData.inDevice = 0;
>>> +    userData.inApp = 0;
>>> +    userData.inOption = 0;
>>> +
>>> +    parseOneConfigFile (p);
>>> +    XML_ParserFree (p);
>>>   }
>>>     void driDestroyOptionInfo (driOptionCache *info) {
>>>       driDestroyOptionCache (info);
>>>       if (info->info) {
>>>       uint32_t i, size = 1 << info->tableSize;
>>>       for (i = 0; i < size; ++i) {
>>>           if (info->info[i].name) {
>>>           free(info->info[i].name);
>>>           free(info->info[i].ranges);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170107/6374216e/attachment.sig>


More information about the mesa-dev mailing list