[Mesa-dev] [PATCH v2] gbm: Replace GBM_DRIVERS_PATH with LIBGL_DRIVERS_PATH

Emil Velikov emil.l.velikov at gmail.com
Thu Jul 24 17:17:59 PDT 2014


On 24/07/14 22:08, Dylan Baker wrote:
> On Thursday, July 24, 2014 09:32:38 PM Emil Velikov wrote:
>> On 22/07/14 19:43, Dylan Baker wrote:
>>> GBM_DRIVERS_PATH is not documented, and only used to set the location of
>>> gbm drivers, while LIBGL_DRIVERS_PATH is used for everything else, and
>>> is documented.
>>>
>>> Generally this split leads to confusion as to why gbm doesn't work.
>>>
>>> This patch makes LIBGL_DRIVERS_PATH the main variable, but uses
>>> GBM_DRIVERS_PATH as a fallback if LIBGL_DRIVERS_PATH is NULL.
>>
>> Dylan if we're going the LIBGL road, can we please use the GBM variable
>> first and then fallback to the LIBGL one ? This way things won't break for
>> people using the former. Meanwhile I'm writing docs/gbm.html with some
>> rough description what gbm is and all the env vars used :-)
>>
> 
> Is there a usecase for having a seperate GBM_DRIVERS_PATH?
Guess we'll know that when people come complaining that it broke their setup.
It will be piglit's "OMG this broke my setup - revert revert. But this has
been on the ML for xx days", story all over again.

> I was under the 
> impression that people had asked to get a v2 that still used GBM_DRIVERS_PATH to 
> keep people scripts working.
> 
Indeed, but the order seems the wrong way IMHO. Current patch will break if
people have both LIBGL and GBM set. Flip the order and things will work as
original. You can still use LIBGL :)

-Emil

>> git grep -i gbm -- docs/
>> 0 matches found
>>
>> Thanks
>> Emil
>>
>>> v2: - Use GBM_DRIVERS_PATH as a fallback
>>>
>>> Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
>>> ---
>>>
>>>  src/gbm/backends/dri/gbm_dri.c | 11 +++++++++--
>>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/gbm/backends/dri/gbm_dri.c
>>> b/src/gbm/backends/dri/gbm_dri.c index 347bc99..3e4851c 100644
>>> --- a/src/gbm/backends/dri/gbm_dri.c
>>> +++ b/src/gbm/backends/dri/gbm_dri.c
>>> @@ -211,9 +211,16 @@ dri_load_driver(struct gbm_dri_device *dri)
>>>
>>>     char *get_extensions_name;
>>>     
>>>     search_paths = NULL;
>>>
>>> +   /* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
>>>
>>>     if (geteuid() == getuid()) {
>>>
>>> -      /* don't allow setuid apps to use GBM_DRIVERS_PATH */
>>> -      search_paths = getenv("GBM_DRIVERS_PATH");
>>> +      search_paths = getenv("LIBGL_DRIVERS_PATH");
>>> +
>>> +      /* fallback path for compatability, GBM_DRIVERS_PATH should be
>>> +       * dropped eventually
>>> +       */
>>> +      if (search_paths == NULL) {
>>> +         search_paths = getenv("GBM_DRIVERS_PATH");
>>> +      }
>>>
>>>     }
>>>     if (search_paths == NULL)
>>>     
>>>        search_paths = DEFAULT_DRIVER_DIR;
> 
> 



More information about the mesa-dev mailing list