[PATCH][libdrm] drm: Fix multi GPU drmGetDevice return wrong device

Yu, Qiang Qiang.Yu at amd.com
Wed Jul 13 10:17:29 UTC 2016


Hi Emil,


Nice to hear from you.

On 11 July 2016 at 06:17, Qiang Yu <Qiang.Yu at amd.com> wrote:
> drmGetDevice will always return the first device it find
> under /dev/dri/. This is not true for multi GPU situation.
>
How does the following alternative solution sound:
 - keep drmFoldDuplicatedDevices as is
 - after the drmFoldDuplicatedDevices call use the find_rdev to find
the correct device in local_devices.

[yuq] This is also OK. But drmFoldDuplicatedDevices() has to be changed for the
drmFreeDevices() in the error handling path: it also exit after see a NULL in the array.

> Plus fix the memory leak in error handling path of
> drmGetDevices.
>
Unless I'm missing something, there is no memory leak fix below ?
Alternatively please keep it as separate patch.

[yuq] This is fixed at the same time by changing drmFoldDuplicatedDevices().

> Change-Id: I2a85a8a4feba8a5cc517ad75c6afb532fa07c53d
Please drop this line.

[yuq] OK.

Regards,
Qiang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160713/94117712/attachment.html>


More information about the amd-gfx mailing list