Commit 4b92b960 authored by Tom Denis's avatar Tom Denis Committed by Michel Dänzer
Browse files

cleanup the entity rec



Based on radeon commit: b32a0a3de84a44b9af4f1ca8be19f10d7fa31b12

Some of these were set, some of them were
always opposites, so clean things up.
Signed-off-by: Tom Denis's avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
parent fe100fd6
......@@ -223,7 +223,6 @@ typedef struct {
#endif
Bool IsSecondary;
Bool IsPrimary;
Bool shadow_fb;
void *fb_shadow;
......
......@@ -724,7 +724,6 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info = AMDGPUPTR(pScrn);
info->IsSecondary = FALSE;
info->IsPrimary = FALSE;
info->pEnt =
xf86GetEntityInfo(pScrn->entityList[pScrn->numEntities - 1]);
if (info->pEnt->location.type != BUS_PCI
......@@ -741,12 +740,8 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
if (xf86IsEntityShared(pScrn->entityList[0])) {
if (xf86IsPrimInitDone(pScrn->entityList[0])) {
info->IsSecondary = TRUE;
pAMDGPUEnt->pSecondaryScrn = pScrn;
} else {
info->IsPrimary = TRUE;
xf86SetPrimInitDone(pScrn->entityList[0]);
pAMDGPUEnt->pPrimaryScrn = pScrn;
pAMDGPUEnt->HasSecondary = FALSE;
}
}
......
......@@ -237,7 +237,6 @@ static Bool amdgpu_get_scrninfo(int entity_num, void *pci_dev)
pPriv->ptr = xnfcalloc(sizeof(AMDGPUEntRec), 1);
pAMDGPUEnt = pPriv->ptr;
pAMDGPUEnt->HasSecondary = FALSE;
if (amdgpu_open_drm_master(pScrn)) {
goto error_fd;
......@@ -255,7 +254,6 @@ static Bool amdgpu_get_scrninfo(int entity_num, void *pci_dev)
}
} else {
pAMDGPUEnt = pPriv->ptr;
pAMDGPUEnt->HasSecondary = TRUE;
}
xf86SetEntityInstanceForScreen(pScrn, pEnt->index,
......@@ -356,7 +354,6 @@ amdgpu_platform_probe(DriverPtr pDriver,
pPriv->ptr = xnfcalloc(sizeof(AMDGPUEntRec), 1);
pAMDGPUEnt = pPriv->ptr;
pAMDGPUEnt->HasSecondary = FALSE;
pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, dev->pdev, dev);
if (pAMDGPUEnt->fd < 0)
goto error_fd;
......@@ -373,7 +370,6 @@ amdgpu_platform_probe(DriverPtr pDriver,
}
} else {
pAMDGPUEnt = pPriv->ptr;
pAMDGPUEnt->HasSecondary = TRUE;
}
pAMDGPUEnt->platform_dev = dev;
......
......@@ -75,11 +75,8 @@ typedef struct {
} AMDGPUCardInfo;
typedef struct {
Bool HasSecondary;
Bool HasCRTC2; /* All cards except original Radeon */
ScrnInfoPtr pSecondaryScrn;
ScrnInfoPtr pPrimaryScrn;
amdgpu_device_handle pDev;
int fd; /* for sharing across zaphod heads */
......
......@@ -1523,7 +1523,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
if (!AMDGPUZaphodStringMatches(pScrn, s, name))
goto out_free_encoders;
} else {
if (info->IsPrimary && (num != 0))
if (!info->IsSecondary && (num != 0))
goto out_free_encoders;
else if (info->IsSecondary && (num != 1))
goto out_free_encoders;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment