Bug 9693 - First device is always returned on systems with multiple graphics cards
Summary: First device is always returned on systems with multiple graphics cards
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: SGI Linux (All)
: high normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-17 15:33 UTC by Jonathan Lim
Modified: 2009-08-24 12:25 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Jonathan Lim 2007-01-17 15:33:05 UTC
On systems with multiple graphics cards, a unique name for each is
not found, therefore the default first device is always returned.
The following patch fixes the problem:

Index: xc/extras/drm/libdrm/xf86drm.c
===================================================================
--- xc/extras/drm/libdrm/xf86drm.c.orig 2006-09-19 07:39:21.044019637 -0700
+++ xc/extras/drm/libdrm/xf86drm.c      2006-09-19 07:39:25.830123221 -0700
@@ -117,6 +117,9 @@
 
 #define DRM_MSG_VERBOSITY 3
 
+/* declare forward referenced function to avoid pointer truncation */
+char *drmGetBusid(int fd);
+
 /**
  * Output a message to stderr.
  *
Comment 1 Matthias Hopf 2007-01-26 03:43:52 UTC
Trivially correct. Please apply.
This belongs to mesa/libdrm.
Comment 2 Matthias Hopf 2007-01-26 03:46:55 UTC
Could someone with commit rights please apply this to libdrm?
I don't have rights in the mesa/ tree, and this patch is trivially correct.
Comment 3 Matthias Hopf 2007-02-20 08:17:11 UTC
Adding Brian as discussed on XDC.

Brian, could you please commit?
Comment 4 Adam Jackson 2007-03-11 18:13:35 UTC
This patch doesn't appear to be relevant to current libdrm.  There's already a forward-declaration of drmGetBusid in xf8drm.h.
Comment 5 Stefan Dirsch 2007-03-12 02:09:07 UTC
Probably this bugreport is against SLES10 (X.Org 6.9(monolithic)/Mesa 6.4.2 based). But even there I can find a forward declaration.

xc/extras/drm/libdrm/xf86drm.h:
[...]
extern char          *drmGetBusid(int fd);

Jonathan, could you provide more details, which X.Org/Mesa/libdrm version you're referring to?
Comment 6 Jonathan Lim 2007-03-12 11:03:08 UTC
I ran diff against the source in xorg-x11-6.9.0-50.35.src.rpm (SLES10).
Comment 7 Stefan Dirsch 2007-11-04 10:38:37 UTC
SLES10 uses Mesa/libdrm and not these xc/extras/drm sources from X.Org tarball. This issue has been fixed in libdrm (comments #4/5).
Comment 8 Adam Jackson 2009-08-24 12:25:37 UTC
Mass version move, cvs -> git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.