[PATCH xserver] randr: Stop dirty tracking for shared pixmap being destroyed

Alex Goins agoins at nvidia.com
Mon Dec 7 14:02:54 PST 2015


Are you sure about this? rrCreateSharedPixmap() does not actually start pixmap
tracking, rather it is done later in rrSetupPixmapSharing(). It's not a given
that a 'shared pixmap' is being tracked when it is destroyed.

The regression was introduced when that patch was taken by itself without
subsequent patches, didn't notice the bug since I was mostly testing with all
the patches together.

A better solution would be to re-introduce the master->StopPixmapTracking() call
in front of rrDestroySharedPixmap() in RRCrtcDetachScanoutPixmap().

Thanks,
Alex

On Wed, 2 Dec 2015, Michel Dänzer wrote:

> From: Michel Dänzer <michel.daenzer at amd.com>
> 
> Otherwise, we leave a dangling reference to the destroyed pixmap in the
> master screen's pixmap_dirty_list.
> 
> Fixes regression from commit cf5d6414 ("randr: Factor out shared pixmap
> destruction").
> 
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>  randr/rrcrtc.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
> index 8d9c5bb..ec26fcd 100644
> --- a/randr/rrcrtc.c
> +++ b/randr/rrcrtc.c
> @@ -363,13 +363,18 @@ RRComputeContiguity(ScreenPtr pScreen)
>  
>  static void
>  rrDestroySharedPixmap(RRCrtcPtr crtc, PixmapPtr pPixmap) {
> -    if (crtc->pScreen->current_master && pPixmap->master_pixmap) {
> +    ScreenPtr master = crtc->pScreen->current_master;
> +
> +    if (master && pPixmap->master_pixmap) {
> +        PixmapPtr mscreenpix = master->GetScreenPixmap(master);
> +
> +        master->StopPixmapTracking(mscreenpix, pPixmap);
>          /*
>           * Unref the pixmap twice: once for the original reference, and once
>           * for the reference implicitly added by PixmapShareToSlave.
>           */
> -        crtc->pScreen->current_master->DestroyPixmap(pPixmap->master_pixmap);
> -        crtc->pScreen->current_master->DestroyPixmap(pPixmap->master_pixmap);
> +        master->DestroyPixmap(pPixmap->master_pixmap);
> +        master->DestroyPixmap(pPixmap->master_pixmap);
>      }
>  
>      crtc->pScreen->DestroyPixmap(pPixmap);
> -- 
> 2.6.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list