OSDN Git Service

drm: drmGetDevice return correct device on multi GPU setups
authorQiang Yu <Qiang.Yu@amd.com>
Thu, 14 Jul 2016 09:10:55 +0000 (17:10 +0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 20 Jul 2016 22:38:35 +0000 (23:38 +0100)
commit3c20893daa0a56b91869d806ae0d3a8d5d8b4cba
tree0f5451ee50eb35ba7ad75ceb164bc797dcc494ce
parent5d830819480b089f62637fecc3aad11c5d1d5857
drm: drmGetDevice return correct device on multi GPU setups

Currently drmGetDevice always returns the first device it finds under
/dev/dri/.

Move the target device to the start of the list during iteration. This
way during deduplication it'll preserve its place and will be returned
to the user.

v2: Keep the memory leak separate.
v3: Move the drmFoldDuplicatedDevices description

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
[Emil Velikov: move drmFoldDuplicatedDevices description, add
changelog, reword commit message]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
xf86drm.c