xf86-video-amdgpu: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Fri May 13 02:39:10 UTC 2016


 man/amdgpu.man        |    2 ++
 src/amdgpu_kms.c      |    4 ++++
 src/drmmode_display.c |   44 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 40 insertions(+), 10 deletions(-)

New commits:
commit 14606e127f4b6eb0b00fd42cec13d524a67e4c4a
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu May 12 16:38:56 2016 +0900

    Handle Zaphod mode correctly in amdgpu_mode_hotplug
    
    We need to scan both screens of the entity for existing connectors, and
    enumerate DVI & HDMI connectors consistently regardless of which screen
    they're assigned to.
    
    Fixes crash when hot-(un)plugging connectors in Zaphod mode.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415
    (Ported from radeon commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f)
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 64ee489..7b326bb 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -36,6 +36,7 @@
 #include "damagestr.h"
 #include "micmap.h"
 #include "xf86cmap.h"
+#include "xf86Priv.h"
 #include "sarea.h"
 
 #include "drmmode_display.h"
@@ -2362,9 +2363,10 @@ amdgpu_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr drmmode)
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
 	drmModeResPtr mode_res;
-	int i, j;
+	int i, j, s;
 	Bool found;
 	Bool changed = FALSE;
+	int num_dvi = 0, num_hdmi = 0;
 
 	mode_res = drmModeGetResources(pAMDGPUEnt->fd);
 	if (!mode_res)
@@ -2400,21 +2402,43 @@ restart_destroy:
 	for (i = 0; i < mode_res->count_connectors; i++) {
 		found = FALSE;
 
-		for (j = 0; j < config->num_output; j++) {
-			xf86OutputPtr output = config->output[j];
-			drmmode_output_private_ptr drmmode_output;
+		for (s = 0; !found && s < xf86NumScreens; s++) {
+			ScrnInfoPtr loop_scrn = xf86Screens[s];
+			xf86CrtcConfigPtr loop_config =
+				XF86_CRTC_CONFIG_PTR(loop_scrn);
 
-			drmmode_output = output->driver_private;
-			if (mode_res->connectors[i] == drmmode_output->output_id) {
-				found = TRUE;
-				break;
+			if (AMDGPUEntPriv(loop_scrn) != pAMDGPUEnt)
+				continue;
+
+			for (j = 0; !found && j < loop_config->num_output; j++) {
+				xf86OutputPtr output = loop_config->output[j];
+				drmmode_output_private_ptr drmmode_output;
+
+				drmmode_output = output->driver_private;
+				if (mode_res->connectors[i] ==
+				    drmmode_output->output_id) {
+					found = TRUE;
+
+					switch(drmmode_output->mode_output->connector_type) {
+					case DRM_MODE_CONNECTOR_DVII:
+					case DRM_MODE_CONNECTOR_DVID:
+					case DRM_MODE_CONNECTOR_DVIA:
+						num_dvi++;
+						break;
+					case DRM_MODE_CONNECTOR_HDMIA:
+					case DRM_MODE_CONNECTOR_HDMIB:
+						num_hdmi++;
+						break;
+					}
+				}
 			}
 		}
 		if (found)
 			continue;
 
-		changed = TRUE;
-		drmmode_output_init(scrn, drmmode, mode_res, i, NULL, NULL, 1);
+		if (drmmode_output_init(scrn, drmmode, mode_res, i, &num_dvi,
+					&num_hdmi, 1) != 0)
+			changed = TRUE;
 	}
 
 	if (changed) {
commit 861da1d5c243f51d6c1f76e5b13e5184aa608776
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu May 12 16:34:30 2016 +0900

    Enable DRI3 by default when building for Xorg >= 1.18.3
    
    Seems to work well enough in general now.
    
    (Ported from radeon commit 1181b9c582f10b6c523e4b2988e2ce87ecf3d367)
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/man/amdgpu.man b/man/amdgpu.man
index 0100400..fd35a9f 100644
--- a/man/amdgpu.man
+++ b/man/amdgpu.man
@@ -64,6 +64,8 @@ will assign xrandr outputs LVDS and VGA-0 to this instance of the driver.
 .BI "Option \*qDRI\*q \*q" integer \*q
 Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 for DRI3.
 The default is
+.B 3 for DRI3
+if the driver was compiled for Xorg >= 1.18.3, otherwise
 .B 2 for DRI2.
 .TP
 .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 125cb77..3c53bc9 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1230,7 +1230,11 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	}
 #endif
 
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
+	value = TRUE;
+#else
 	value = FALSE;
+#endif
 	from = X_DEFAULT;
 
 	if (info->use_glamor) {


More information about the xorg-commit mailing list