mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-03-24 01:24:31 +00:00
Use pAMDGPUEnt to find both screens of a GPU in amdgpu_mode_hotplug
Fixes misbehaviour when hotplugging DisplayPort connectors on secondary
GPUs.
Fixes: 14606e127f ("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>
This commit is contained in:
committed by
Michel Dänzer
parent
257be5b085
commit
24e36c7044
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user