[VDPAU] [PATCH] try DRI2DriverDRI name on DRI2DriverVDPAU absence

Rinat Ibragimov ibragimovrinat at mail.ru
Tue Jan 7 09:30:42 PST 2014


Congratulations!

To the topic. I had no response other than DRI3 related info from Eric Anholt:
http://lists.freedesktop.org/archives/intel-gfx/2013-August/031872.html
No one said 'no', though.

Вторник,  7 января 2014, 9:11 -08:00 от Aaron Plattner <aplattner at nvidia.com>:
>Sorry for the slow response.  I just got back from paternity leave.
>
>I'm not sure I understand why exactly the display driver can't just 
>report the correct DRI2DriverVDPAU name.  Is it just politics / lack of 
>developer interest?
>
>On 01/07/2014 07:31 AM, Rinat Ibragimov wrote:
>> Ping.
>>
>>
>> Среда, 11 декабря 2013, 1:57 +04:00 от Rinat Ibragimov < ibragimovrinat at mail.ru >:
>>> Hi. I'm making VDPAU driver with OpenGL/VA-API backend. Implementation is still incomplete, but
>>> already works for both Mplayer and Flash Player. Some time ago there was packaging attempt at
>>>  https://bugzilla.rpmfusion.org/show_bug.cgi?id=2897 . And they confronted with difficulties of
>>> enabling it on target hardware -- on integrated intel chips. You know, using VDPAU_DRIVER for
>>> development is fine, but in package it's dangerous as it can break things on nVidia hardware,
>>> where native VDPAU is available. Unfortunately, intel Xorg driver is the only one that
>>> does not support DRI2DriverVDPAU name, therefore it's impossible to make autoloading work.
>>> My attempts to add support of DRI2DriverVDPAU was futile. Looks like nobody interested in that on
>>> their side.
>>>
>>> So I have a humble proposal to make libvdpau try DRI2DriverDRI if DRI2DriverVDPAU fails for some
>>> reason. That way on intel equipped machines libvdpau will try to load libvdpau_i965.so. Other
>>> machines with other videoadapters will not be affected.
>>>
>>> Rinat
>>>
>>>
>>> ---
>>>   src/mesa_dri2.c     |  5 +++--
>>>   src/mesa_dri2.h     |  2 +-
>>>   src/vdpau_wrapper.c | 12 +++++++++---
>>>   3 files changed, 13 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/src/mesa_dri2.c b/src/mesa_dri2.c
>>> index 5f7146a..4dc1e85 100644
>>> --- a/src/mesa_dri2.c
>>> +++ b/src/mesa_dri2.c
>>> @@ -114,7 +114,8 @@ _vdp_DRI2QueryVersion(Display * dpy, int *major, int *minor)
>>>   }
>>>
>>>   Bool
>>> -_vdp_DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
>>> +_vdp_DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName,
>>> +                 int driverType)
>>>   {
>>>      XExtDisplayInfo *info = DRI2FindDisplay(dpy);
>>>      xDRI2ConnectReply rep;
>>> @@ -127,7 +128,7 @@ _vdp_DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName
>>>      req->reqType = info->codes->major_opcode;
>>>      req->dri2ReqType = X_DRI2Connect;
>>>      req->window = window;
>>> -   req->driverType = DRI2DriverVDPAU;
>>> +   req->driverType = driverType;
>>>   #ifdef DRI2DriverPrimeShift
>>>      {
>>>         char *prime = getenv("DRI_PRIME");
>>> diff --git a/src/mesa_dri2.h b/src/mesa_dri2.h
>>> index 09bde8c..a3bedfd 100644
>>> --- a/src/mesa_dri2.h
>>> +++ b/src/mesa_dri2.h
>>> @@ -45,7 +45,7 @@ _vdp_DRI2QueryVersion(Display * display, int *major, int *minor);
>>>
>>>   extern Bool
>>>   _vdp_DRI2Connect(Display * display, XID window, char **driverName,
>>> -                 char **deviceName);
>>> +                 char **deviceName, int driverType);
>>>
>>>   extern void
>>>   _vdp_DRI2RemoveExtension(Display * display);
>>> diff --git a/src/vdpau_wrapper.c b/src/vdpau_wrapper.c
>>> index 9932937..dccf168 100644
>>> --- a/src/vdpau_wrapper.c
>>> +++ b/src/vdpau_wrapper.c
>>> @@ -90,9 +90,15 @@ static char * _vdp_get_driver_name_from_dri2(
>>>           return NULL;
>>>       }
>>>
>>> -    if (!_vdp_DRI2Connect(display, root, &driver_name, &device_name)) {
>>> -        _vdp_DRI2RemoveExtension(display);
>>> -        return NULL;
>>> +    if (!_vdp_DRI2Connect(display, root, &driver_name, &device_name,
>>> +                          DRI2DriverVDPAU))
>>> +    {
>>> +        if (!_vdp_DRI2Connect(display, root, &driver_name, &device_name,
>>> +                              DRI2DriverDRI))
>>> +        {
>>> +            _vdp_DRI2RemoveExtension(display);
>>> +            return NULL;
>>> +        }
>>>       }
>>>
>>>       XFree(device_name);
>>> --
>>> 1.8.4.3
>>>
>>> _______________________________________________
>>> VDPAU mailing list
>>>  VDPAU at lists.freedesktop.org
>>>  http://lists.freedesktop.org/mailman/listinfo/vdpau
>>
>>
>> ---
>> Rinat
>> _______________________________________________
>> VDPAU mailing list
>>  VDPAU at lists.freedesktop.org
>>  http://lists.freedesktop.org/mailman/listinfo/vdpau
>>
>
>
>-- 
>Aaron
>_______________________________________________
>VDPAU mailing list
>VDPAU at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/vdpau


---
Rinat


More information about the VDPAU mailing list