glamor: Allow depth 30 with Xorg >= 1.19.99.1
PATCH 1/4 glamor: Allow depth 30 with Xorg >= 1.19.99.1
From: Michel Dänzer <[email protected]>
Corresponding to amdgpu commit 6aee5770fb913713bb1b9a1af8f0d0892a66f21a.
--- man/radeon.man | 2 +- src/radeon_kms.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
man/radeon.man +1 -1
@@ -19,7 +19,7 @@ following features: .TP 2 \(bu Full support for 8-, 15-, 16- and 24-bit pixel depths, and for 30-bit depth on Linux 3.16 -and later with EXA acceleration; +and later; .TP \(bu RandR 1.2 and RandR 1.3 support;
src/radeon_kms.c +2 -1
@@ -1767,7 +1767,8 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)if (!RADEONPreInitAccel_KMS (pScrn)) goto fail;/* Depth 30 not yet supported under glamor. */ -if (pScrn->depth ==30 && info->use_glamor) { +if (pScrn->depth ==30 && info->use_glamor && +xorgGetVersion () <XORG_VERSION_NUMERIC (1 ,19 ,99 ,1 ,0 )) {xf86DrvMsg (pScrn->scrnIndex,X_ERROR ,"Given depth (%d) is not supported under GLAMOR accel. Select EXA.\n" , pScrn->depth);
Signature · 6 lines
2.16.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180214174930.5086-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 2/4 Don't use RADEONEntPriv in RADEONFreeRec
From: Michel Dänzer <[email protected]>
It crashes if info == NULL.
(Ported from amdgpu commits fb8444e731765588c0ff1e9053c1c7b73f5f0907 &
cfccf4c4e7e5c73fe4040fabeb1b43283cf29b33)
--- src/radeon_kms.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-)
src/radeon_kms.c +20 -12
@@ -194,18 +194,33 @@ static Bool RADEONGetRec(ScrnInfoPtr pScrn)/* Free our private RADEONInfoRec */ static void RADEONFreeRec (ScrnInfoPtr pScrn) { +DevUnion *pPriv;RADEONEntPtr pRADEONEnt;RADEONInfoPtr info; +EntityInfoPtr pEnt; -if (!pScrn || !pScrn->driverPrivate)return ; +if (!pScrn) +return ; info =RADEONPTR (pScrn); +if (info) { +if (info->fbcon_pixmap) + pScrn->pScreen->DestroyPixmap (info->fbcon_pixmap); -if (info->fbcon_pixmap) - pScrn->pScreen->DestroyPixmap (info->fbcon_pixmap); +if (info->accel_state) { +free (info->accel_state); + info->accel_state =NULL ; + } - pRADEONEnt =RADEONEntPriv (pScrn); + pEnt = info->pEnt; +free (pScrn->driverPrivate); + pScrn->driverPrivate =NULL ; + }else { + pEnt =xf86GetEntityInfo (pScrn->entityList[pScrn->numEntities -1 ]); + } + pPriv =xf86GetEntityPrivate (pEnt->index, gRADEONEntityIndex); + pRADEONEnt = pPriv->ptr;if (pRADEONEnt->fd >0 ) {DevUnion *pPriv;RADEONEntPtr pRADEONEnt;
@@ -225,14 +240,7 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn) } } -if (info->accel_state) { -free (info->accel_state); - info->accel_state =NULL ; - } - -free (info->pEnt); -free (pScrn->driverPrivate); - pScrn->driverPrivate =NULL ; +free (pEnt); } static void *
Signature · 6 lines
2.16.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/4 Don't call RADEONFreeRec from RADEONPreInit_KMS
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
If the latter fails, Xorg will call RADEONFreeScreen_KMS, which calls the former.
(Ported from amdgpu commit 103b7285845b786929fb509083c57e074c48f9be)
--- src/radeon_kms.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-)
src/radeon_kms.c +14 -17
@@ -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)
Signature · 6 lines
2.16.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/4 Call RADEONFreeRec from RADEONFreeScreen_KMS even if info == NULL
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
It's safe now.
(Ported from amdgpu commit c9bd1399a13cea2e1331af2c826ca054b88db071)
--- src/radeon_kms.c | 5 ----- 1 file changed, 5 deletions(-)
src/radeon_kms.c +0 -5
@@ -2206,14 +2206,9 @@ static Bool RADEONCloseScreen_KMS(ScreenPtr pScreen)void RADEONFreeScreen_KMS (ScrnInfoPtr pScrn) { -RADEONInfoPtr info =RADEONPTR (pScrn); -xf86DrvMsgVerb (pScrn->scrnIndex,X_INFO ,RADEON_LOGLEVEL_DEBUG ,"RADEONFreeScreen\n" ); -/* when server quits at PreInit, we don't need do this anymore*/ -if (!info)return ; -RADEONFreeRec (pScrn); }
Signature · 6 lines
2.16.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180214174930.5086-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Deucher, Alexander
Reviewed-byRe: [PATCH xf86-video-ati 4/4] Call RADEONFreeRec from RADEONFreeScreen_KMS even if info == NULL
Series is:
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Michel Dänzer <[email protected]>
Sent: Wednesday, February 14, 2018 12:49:30 PM
To: [email protected]
Subject: [PATCH xf86-video-ati 4/4] Call RADEONFreeRec from RADEONFreeScreen_KMS even if info == NULL
From: Michel Dänzer <[email protected]>
It's safe now.
(Ported from amdgpu commit c9bd1399a13cea2e1331af2c826ca054b88db071)
--- src/radeon_kms.c | 5 ----- 1 file changed, 5 deletions(-)
src/radeon_kms.c +0 -5
@@ -2206,14 +2206,9 @@ static Bool RADEONCloseScreen_KMS(ScreenPtr pScreen)void RADEONFreeScreen_KMS (ScrnInfoPtr pScrn) { -RADEONInfoPtr info =RADEONPTR (pScrn); -xf86DrvMsgVerb (pScrn->scrnIndex,X_INFO ,RADEON_LOGLEVEL_DEBUG ,"RADEONFreeScreen\n" ); -/* when server quits at PreInit, we don't need do this anymore*/ -if (!info)return ; -RADEONFreeRec (pScrn); }
--
2.16.1
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx