Hello community, here is the log from the commit of package xf86-video-ati for openSUSE:Factory checked in at 2016-11-13 22:49:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xf86-video-ati (Old) and /work/SRC/openSUSE:Factory/.xf86-video-ati.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "xf86-video-ati" Changes: -------- --- /work/SRC/openSUSE:Factory/xf86-video-ati/xf86-video-ati.changes 2016-11-05 21:22:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.xf86-video-ati.new/xf86-video-ati.changes 2016-11-13 22:49:40.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Nov 10 11:21:31 UTC 2016 - mstaudt@suse.com + +- U_21-Refactor-radeon_mode_hotplug.patch + U_22-Use-pRADEONEnt-to-find-both-screens-of-a-GPU-in-radeon_mode_hotplug.patch + + Fix enumeration of connectors per GPU (bsc#1008200). + +------------------------------------------------------------------- New: ---- U_21-Refactor-radeon_mode_hotplug.patch U_22-Use-pRADEONEnt-to-find-both-screens-of-a-GPU-in-radeon_mode_hotplug.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xf86-video-ati.spec ++++++ --- /var/tmp/diff_new_pack.XDwVra/_old 2016-11-13 22:49:41.000000000 +0100 +++ /var/tmp/diff_new_pack.XDwVra/_new 2016-11-13 22:49:41.000000000 +0100 @@ -48,6 +48,8 @@ Patch18: U_18-Move-up-radeon_scanout_extents_intersect.patch Patch19: U_19-Synchronize-scanout-pixmaps-for-TearFree.patch Patch20: U_20-Make-TearFree-effective-with-PRIME-slave-scanout.patch +Patch21: U_21-Refactor-radeon_mode_hotplug.patch +Patch22: U_22-Use-pRADEONEnt-to-find-both-screens-of-a-GPU-in-radeon_mode_hotplug.patch BuildRequires: Mesa-devel BuildRequires: autoconf >= 2.60 @@ -109,6 +111,8 @@ %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 +%patch22 -p1 %build autoreconf -fiv ++++++ U_21-Refactor-radeon_mode_hotplug.patch ++++++ From: Michel Dänzer <michel.daenzer@amd.com> Date: Tue Nov 8 13:01:58 2016 +0900 Subject: [PATCH 1/2]Refactor radeon_mode_hotplug Patch-mainline: Upstream Git-repo: git://anongit.freedesktop.org/xorg/driver/xf86-video-ati Git-commit: 35bec4937d89b48a79acfcb4f814b7370cb631b2 References: bsc#1008200 Signed-off-by: Max Staudt <mstaudt@suse.de> Preparation for the next change, no functional change intended. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> --- src/drmmode_display.c | 58 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 44615d3..574003c 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2577,6 +2577,37 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) return TRUE; } +static Bool +drmmode_find_output(ScrnInfoPtr scrn, int output_id, int *num_dvi, + int *num_hdmi) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int i; + + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + drmmode_output_private_ptr drmmode_output = output->driver_private; + + if (drmmode_output->output_id == output_id) { + 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; + } + + return TRUE; + } + } + + return FALSE; +} + void radeon_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr drmmode) { @@ -2624,35 +2655,14 @@ restart_destroy: for (s = 0; !found && s < xf86NumScreens; s++) { ScrnInfoPtr loop_scrn = xf86Screens[s]; - xf86CrtcConfigPtr loop_config = - XF86_CRTC_CONFIG_PTR(loop_scrn); if (strcmp(loop_scrn->driverName, scrn->driverName) || RADEONEntPriv(loop_scrn) != pRADEONEnt) 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; - } - } - } + found = drmmode_find_output(loop_scrn, + mode_res->connectors[i], + &num_dvi, &num_hdmi); } if (found) continue; ++++++ U_22-Use-pRADEONEnt-to-find-both-screens-of-a-GPU-in-radeon_mode_hotplug.patch ++++++ From: Michel Dänzer <michel.daenzer@amd.com> Date: Tue Nov 8 13:02:43 2016 +0900 Subject: [PATCH 2/2]Use pRADEONEnt to find both screens of a GPU in radeon_mode_hotplug Patch-mainline: Upstream Git-repo: git://anongit.freedesktop.org/xorg/driver/xf86-video-ati Git-commit: 9760ef33cba5795eddeda4d5c2fcbe2dcce21689 References: bsc#1008200 Signed-off-by: Max Staudt <mstaudt@suse.de> Fixes misbehaviour when hotplugging DisplayPort connectors on secondary GPUs. Fixes: c801f9f10a5d ("Handle Zaphod mode correctly in radeon_mode_hotplug") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98626 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> --- src/drmmode_display.c | 23 ++++++++--------------- src/radeon_kms.c | 5 +++++ src/radeon_probe.h | 2 ++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 574003c..4eb7b77 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -2614,7 +2614,7 @@ radeon_mode_hotplug(ScrnInfoPtr scrn, drmmode_ptr drmmode) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); drmModeResPtr mode_res; - int i, j, s; + int i, j; Bool found; Bool changed = FALSE; int num_dvi = 0, num_hdmi = 0; @@ -2651,20 +2651,13 @@ restart_destroy: /* find new output ids we don't have outputs for */ for (i = 0; i < mode_res->count_connectors; i++) { - found = FALSE; - - for (s = 0; !found && s < xf86NumScreens; s++) { - ScrnInfoPtr loop_scrn = xf86Screens[s]; - - if (strcmp(loop_scrn->driverName, scrn->driverName) || - RADEONEntPriv(loop_scrn) != pRADEONEnt) - continue; - - found = drmmode_find_output(loop_scrn, - mode_res->connectors[i], - &num_dvi, &num_hdmi); - } - if (found) + if (drmmode_find_output(pRADEONEnt->primary_scrn, + mode_res->connectors[i], + &num_dvi, &num_hdmi) || + (pRADEONEnt->secondary_scrn && + drmmode_find_output(pRADEONEnt->secondary_scrn, + mode_res->connectors[i], + &num_dvi, &num_hdmi))) continue; if (drmmode_output_init(scrn, drmmode, mode_res, i, &num_dvi, diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 9bcf657..d4399b8 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1638,6 +1638,11 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) } } + if (info->IsSecondary) + pRADEONEnt->secondary_scrn = pScrn; + else + pRADEONEnt->primary_scrn = pScrn; + info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); pScrn->monitor = pScrn->confScreen->monitor; diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 258c7be..573d988 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -139,6 +139,8 @@ typedef struct unsigned long fd_wakeup_registered; /* server generation for which fd has been registered for wakeup handling */ int fd_wakeup_ref; unsigned int assigned_crtcs; + ScrnInfoPtr primary_scrn; + ScrnInfoPtr secondary_scrn; #ifdef XSERVER_PLATFORM_BUS struct xf86_platform_device *platform_dev; #endif