[Libva] FGLRX detection code overly restrictive
Gwenole Beauchesne
gb.devel at gmail.com
Sun Oct 9 00:42:42 PDT 2011
Hi,
2011/10/7 Stephan Diestelhorst <stephan.diestelhorst at gmail.com>:
> This is the first bug: handing in a NULL pointer to strlen without checking.
The check was done through the return value of va_GetDriverName().
VA_FGLRXGetClientName() indeed has a bug that would make it return
success even if no valid match was found.
> Eventually, this causes a mismatch in match_display in
> libva/va/x11/va_fglrx.c such
> that x11_dpy_name = ":0", test_dpy_name=":0.0" (and display_name being
> ":0" in there)
> which causes the comparison to fail and hence does not set the driver
> name to fglrx,
> but returns a success error code.
That's another problem. AFAIK, in a single monitor system, we can
assume :0 == :0.0. However, in a multi-monitor system, that won't hold
true. Besides, an XvBA context would be screen dependent, if I
remember correctly.
The proper fixes would be:
1. Don't return success if no valid match was found.
2. Account for ":0" cases in a single monitor system.
Regards,
Gwenole.
More information about the Libva
mailing list