summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-11-10 12:30:10 +0900
committerMichel Dänzer <michel@daenzer.net>2016-11-16 17:22:00 +0900
commit24e36c7044a24294d5709c0306efacc8de6df072 (patch)
tree7a309853d8aa8161180fe8726a593a7a160f4207
parent257be5b0853814a557a5337878a4311acbc89856 (diff)
Use pAMDGPUEnt to find both screens of a GPU in amdgpu_mode_hotplug
Fixes misbehaviour when hotplugging DisplayPort connectors on secondary GPUs. Fixes: 14606e127f4b ("Handle Zaphod mode correctly in amdgpu_mode_hotplug") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98626 (Ported from radeon commit 9760ef33cba5795eddeda4d5c2fcbe2dcce21689) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_kms.c5
-rw-r--r--src/amdgpu_probe.h2
-rw-r--r--src/drmmode_display.c23
3 files changed, 15 insertions, 15 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index b21cd37..bf9058e 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1313,6 +1313,11 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
}
}
+ if (info->IsSecondary)
+ pAMDGPUEnt->secondary_scrn = pScrn;
+ else
+ pAMDGPUEnt->primary_scrn = pScrn;
+
info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index);
pScrn->monitor = pScrn->confScreen->monitor;
diff --git a/src/amdgpu_probe.h b/src/amdgpu_probe.h
index e6af3a2..802df12 100644
--- a/src/amdgpu_probe.h
+++ b/src/amdgpu_probe.h
@@ -93,6 +93,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;
struct xf86_platform_device *platform_dev;
} AMDGPUEntRec, *AMDGPUEntPtr;
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 0ca78e0..a75cc5c 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2402,7 +2402,7 @@ 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, s;
+ int i, j;
Bool found;
Bool changed = FALSE;
int num_dvi = 0, num_hdmi = 0;
@@ -2439,20 +2439,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) ||
- AMDGPUEntPriv(loop_scrn) != pAMDGPUEnt)
- continue;
-
- found = drmmode_find_output(loop_scrn,
- mode_res->connectors[i],
- &num_dvi, &num_hdmi);
- }
- if (found)
+ if (drmmode_find_output(pAMDGPUEnt->primary_scrn,
+ mode_res->connectors[i],
+ &num_dvi, &num_hdmi) ||
+ (pAMDGPUEnt->secondary_scrn &&
+ drmmode_find_output(pAMDGPUEnt->secondary_scrn,
+ mode_res->connectors[i],
+ &num_dvi, &num_hdmi)))
continue;
if (drmmode_output_init(scrn, drmmode, mode_res, i, &num_dvi,