[PATCH xf86-video-amdgpu 01/12] Build RandR 1.4 provider name from chipset name and bus ID

Michel Dänzer michel at daenzer.net
Fri Mar 18 10:01:26 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

Instead of just "amdgpu", it's now e.g. "TONGA @ pci:0000:01:00.0".

(Ported from radeon commit c7cf00487cd6d4a5d0f39d5b92ff04f6420d6a32)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 658eb90..17a0f67 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -43,6 +43,10 @@
 #include "amdgpu_glamor.h"
 #include "amdgpu_pixmap.h"
 
+#ifdef AMDGPU_PIXMAP_SHARING
+#include <dri.h>
+#endif
+
 /* DPMS */
 #ifdef HAVE_XEXTPROTO_71
 #include <X11/extensions/dpmsconst.h>
@@ -1904,6 +1908,9 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 	int i, num_dvi = 0, num_hdmi = 0;
 	unsigned int crtcs_needed = 0;
 	drmModeResPtr mode_res;
+#ifdef AMDGPU_PIXMAP_SHARING
+	char *bus_id_string, *provider_name;
+#endif
 
 	xf86CrtcConfigInit(pScrn, &drmmode_xf86crtc_config_funcs);
 
@@ -1947,7 +1954,11 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 	drmmode_clones_init(pScrn, drmmode, mode_res);
 
 #ifdef AMDGPU_PIXMAP_SHARING
-	xf86ProviderSetup(pScrn, NULL, "amdgpu");
+	bus_id_string = DRICreatePCIBusID(info->PciInfo);
+	XNFasprintf(&provider_name, "%s @ %s", pScrn->chipset, bus_id_string);
+	free(bus_id_string);
+	xf86ProviderSetup(pScrn, NULL, provider_name);
+	free(provider_name);
 #endif
 
 	xf86InitialConfiguration(pScrn, TRUE);
-- 
2.7.0



More information about the xorg-driver-ati mailing list