EXA: Handle NULL BO pointer in radeon_set_pixmap_bo
PATCH 1/4 EXA: Handle NULL BO pointer in radeon_set_pixmap_bo
From: Michel Dänzer <[email protected]>
Signed-off-by Michel Dänzer <[email protected]>
--- src/radeon.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
src/radeon.h +7 -3
@@ -772,11 +772,15 @@ static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_buffer *boradeon_buffer_unref (&driver_priv->bo);drmmode_fb_reference (pRADEONEnt->fd, &driver_priv->fb,NULL ); -radeon_buffer_ref (bo); driver_priv->bo = bo; -radeon_bo_get_tiling (bo->bo.radeon, &driver_priv->tiling_flags, - &pitch); +if (bo) { +radeon_buffer_ref (bo); +radeon_bo_get_tiling (bo->bo.radeon, &driver_priv->tiling_flags, + &pitch); + }else + driver_priv->tiling_flags =0 ; +return TRUE; }
Signature · 6 lines
2.18.0 _______________________________________________ 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): 20180824090244.16520-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 2/4 Handle ihandle == -1 in radeon_set_shared_pixmap_backing
From: Michel Dänzer <[email protected]>
It means to stop using the shared pixmap backing.
Fixes crash when changing PRIME slave output configuration.
Signed-off-by Michel Dänzer <[email protected]>
--- src/radeon_bo_helper.c | 3 +++ 1 file changed, 3 insertions(+)
src/radeon_bo_helper.c +3 -0
@@ -454,6 +454,9 @@ Bool radeon_set_shared_pixmap_backing(PixmapPtr ppix, void *fd_handle,uint32_t size = ppix->devKind * ppix->drawable.height;Bool ret = FALSE; +if (ihandle ==-1 ) +return radeon_set_pixmap_bo (ppix,NULL ); + bo = (struct radeon_buffer *)calloc (1 ,sizeof (struct radeon_buffer ));if (!bo) goto error;
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/4 EXA: Handle ihandle == -1 in RADEONEXASharePixmapBacking
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Signed-off-by Michel Dänzer <[email protected]>
--- src/radeon_exa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/radeon_exa.c +2 -1
@@ -296,11 +296,12 @@ Bool RADEONEXASharePixmapBacking(PixmapPtr ppix, ScreenPtr slave, void **fd_handBool RADEONEXASetSharedPixmapBacking (PixmapPtr ppix,void *fd_handle) {struct radeon_exa_pixmap_priv *driver_priv =exaGetPixmapDriverPrivate (ppix); +int ihandle = (int )(long )fd_handle;if (!radeon_set_shared_pixmap_backing (ppix, fd_handle, &driver_priv->surface))return FALSE; - driver_priv->shared = TRUE; + driver_priv->shared = ihandle !=-1 ;return TRUE; }
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/4 glamor: Handle ihandle == -1 in radeon_glamor_set_shared_pixmap_backing
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Signed-off-by Michel Dänzer <[email protected]>
--- src/radeon_glamor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
src/radeon_glamor.c +3 -1
@@ -402,11 +402,13 @@ radeon_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *handle) {ScreenPtr screen = pixmap->drawable.pScreen;ScrnInfoPtr scrn =xf86ScreenToScrn (screen); +int ihandle = (int )(long )handle;if (!radeon_set_shared_pixmap_backing (pixmap, handle,NULL ))return FALSE; -if (!radeon_glamor_create_textured_pixmap (pixmap, +if (ihandle !=-1 && + !radeon_glamor_create_textured_pixmap (pixmap,radeon_get_pixmap_bo (pixmap))) {xf86DrvMsg (scrn->scrnIndex,X_ERROR ,"Failed to get PRIME drawable for glamor pixmap.\n" );
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx