diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2018-02-14 18:06:18 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2018-02-15 17:23:30 +0100 |
commit | 6b44b8c584f3b63712858be11277842c97d03426 (patch) | |
tree | 67c9aff1f6476f357caf241bdda82e7b87e518e7 /src/radeon_kms.c | |
parent | 8a55e66bfd77dcb2553a43e86215b9d3c87b03f0 (diff) |
Don't call RADEONFreeRec from RADEONPreInit_KMS
If the latter fails, Xorg will call RADEONFreeScreen_KMS, which calls
the former.
(Ported from amdgpu commit 103b7285845b786929fb509083c57e074c48f9be)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 6b1dc38b..06f7883e 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1712,7 +1712,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) && info->pEnt->location.type != BUS_PLATFORM #endif ) - goto fail; + return FALSE; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], getRADEONEntityIndex()); @@ -1739,24 +1739,24 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) pScrn->monitor = pScrn->confScreen->monitor; if (!RADEONPreInitVisual(pScrn)) - goto fail; + return FALSE; xf86CollectOptions(pScrn, NULL); if (!(info->Options = malloc(sizeof(RADEONOptions_KMS)))) - goto fail; + return FALSE; memcpy(info->Options, RADEONOptions_KMS, sizeof(RADEONOptions_KMS)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options); if (!RADEONPreInitWeight(pScrn)) - goto fail; + return FALSE; if (!RADEONPreInitChipType_KMS(pScrn)) - goto fail; + return FALSE; if (radeon_open_drm_master(pScrn) == FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n"); - goto fail; + return FALSE; } info->dri2.available = FALSE; @@ -1765,14 +1765,15 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) if (info->dri2.pKernelDRMVersion == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "RADEONDRIGetVersion failed to get the DRM version\n"); - goto fail; + return FALSE; } /* Get ScreenInit function */ if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; - if (!RADEONPreInitAccel_KMS(pScrn)) goto fail; + if (!RADEONPreInitAccel_KMS(pScrn)) + return FALSE; /* Depth 30 not yet supported under glamor. */ if (pScrn->depth == 30 && info->use_glamor && @@ -1780,7 +1781,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported under GLAMOR accel. Select EXA.\n", pScrn->depth); - goto fail; + return FALSE; } /* Depth 30 only supported since Linux 3.16 / kms driver minor version 39 */ @@ -1788,7 +1789,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported. Kernel too old. Needs Linux 3.16+\n", pScrn->depth); - goto fail; + return FALSE; } radeon_drm_queue_init(); @@ -1901,7 +1902,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) if (drmmode_pre_init(pScrn, &info->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n"); - goto fail; + return FALSE; } RADEONSetupCapabilities(pScrn); @@ -1995,14 +1996,10 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) #endif ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); - goto fail; - } + return FALSE; + } return TRUE; - fail: - RADEONFreeRec(pScrn); - return FALSE; - } static Bool RADEONCursorInit_KMS(ScreenPtr pScreen) |