aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch')
-rw-r--r--common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch b/common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch
new file mode 100644
index 00000000..40ba2ded
--- /dev/null
+++ b/common/recipes-graphics/drm/libdrm-2.4.66/0059-drm-fix-multi-GPU-drmGetDevices-only-return-one-devi.patch
@@ -0,0 +1,38 @@
+From 9d50d529f35b5ec2e9300bcff55fca1da84f75ec Mon Sep 17 00:00:00 2001
+From: Qiang Yu <Qiang.Yu@amd.com>
+Date: Mon, 30 May 2016 21:45:47 +0800
+Subject: [PATCH 059/117] drm: fix multi GPU drmGetDevices only return one
+ device
+
+When multi GPU present, after drmFoldDuplicatedDevices
+merge same busid deveces, two different devices may be
+seperated by zero in local_devices[]. The for loop
+should check all local_devices instead of exit when
+meet a zero.
+
+Change-Id: I0b655f795727492bd7886cb60e07832bd9849d89
+Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
+Reviewed-by Jim Qu <Jim.Qu@amd.com>
+---
+ xf86drm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/xf86drm.c b/xf86drm.c
+index 5f587d9..6689f7c 100644
+--- a/xf86drm.c
++++ b/xf86drm.c
+@@ -3267,7 +3267,10 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
+ drmFoldDuplicatedDevices(local_devices, node_count);
+
+ device_count = 0;
+- for (i = 0; i < node_count && local_devices[i]; i++) {
++ for (i = 0; i < node_count; i++) {
++ if (!local_devices[i])
++ continue;
++
+ if ((devices != NULL) && (device_count < max_devices))
+ devices[device_count] = local_devices[i];
+ else
+--
+2.7.4
+