On 01/ 3/15 12:12 PM, Adel Gadllah wrote:
Currently when the ddx does not set any driver name we set DRI2 driver but
not the VDPAU driver name. The result is that VDPAU drivers will not get found
by libvdpau when the modesetting driver is being used.

Just assume that the VDPAU driver matches the DRI2 driver name, this is true
for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported
by mesa.

Signed-off-by: Adel Gadllah <adel.gadl...@gmail.com>
---
  hw/xfree86/dri2/dri2.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index c8fcd62..68518c4 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -1573,15 +1573,15 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)

      if (info->version == 3 || info->numDrivers == 0) {
          /* Driver too old: use the old-style driverName field */
-        ds->numDrivers = 1;
-        ds->driverNames = malloc(sizeof(*ds->driverNames));
+        ds->numDrivers = info->driverName ? 1 : 2;
+        ds->driverNames = malloc(ds->numDrivers * sizeof(*ds->driverNames));
          if (!ds->driverNames)
              goto err_out;

          if (info->driverName) {
              ds->driverNames[0] = info->driverName;
          } else {
-            ds->driverNames[0] = dri2_probe_driver_name(pScreen, info);
+            ds->driverNames[0] = ds->driverNames[1] = 
dri2_probe_driver_name(pScreen, info);
              if (!ds->driverNames[0])
                  return FALSE;
          }


Thanks for fixing - I assume you lucked out in previous testing that
you weren't overwriting anything important (perhaps just malloc padding),
but we can't rely on everyone always being so lucky.

Reviewed-by: Alan Coopersmith <alan.coopersm...@oracle.com>

--
        -Alan Coopersmith-              alan.coopersm...@oracle.com
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to