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

Axel Davy axel.davy at ens.fr
Sat Jan 7 19:20:23 UTC 2017


Here are screenshots of how far I got with that driconf replacement

https://drive.google.com/open?id=0B5-qhFoZtgKPZmR2LVg0X3pOZnM

It was more than two years ago, hadn't had time to work on it since.

Screenshot 1, 2 and 3:
There is a list of apps with settings in system drirc or user drirc.
Options set are shown. There is a help, reset and delete button for each 
setting.
Other known options are proposed.
At the bottom of the list (not shown in the screenshots) you can add 
manually a new option not proposed.
For known options, depending on the value type you are shown a checkbox, 
an enum option or a string.

Screenshot 4:
I hoped one day to show a lot of useful infos here about the cards of 
the system (all cards available are detected)

Screenshot 5 and 6:
For dual-gpu systems, that menu allowed to detect all running apps on a 
given card (or detect only apps started after clicking on "Detect Future 
Running Apps" and before clicking again on "Stop"), and change device_id 
to affect on which card to run in the future.

On 07/01/2017 14:01, Axel Davy wrote:
> I find ~/.drirc useful.
>
> You can add hacks missing in system drirc, or use device_id to set the 
> card to use for the given game for dual gpu systems. Nine also has 
> some drirc settings that are not hacks, but user options.
>
> I think it's driconf that should be fixed. It shouldn't copy the 
> system drirc, and instead just create minimal drirc with the settings 
> the user has set.
> I had worked long ago on a driconf replacement, and I think it was 
> doing that right. The interface was in QML (using Qt), and mainly what 
> was missing in the project was more advanced interface (doing a 
> complete interface with QML is not that easy to get right for a 
> beginner). The tool also worked multi-gpu and could detect on which 
> card running apps were running, and enabled to switch the card for 
> next run.
>
> Perhaps some company funding Mesa developpement could hire some intern 
> to write a driconf replacement ?
>
> Axel
>
> On 07/01/2017 13:45, Marek Olšák wrote:
>> 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);
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list