modesetting: Fix msSharePixmapBacking Segfault Regression

Commit cb1b1e18 modified msSharePixmapBacking() to derive modesettingPtr from
the 'screen' argument. Unfortunately, the name of the argument is misleading --
the screen is the slave screen. If the master is modesetting,
and the slave is not modesetting, it will segfault.

To fix the problem, this change derives modesettingPtr from
ppix->drawable.pScreen. This method is already used when calling
ms->glamor.shareable_fd_from_pixmap() later in the function.

To avoid future issues, this change also renames the 'screen' argument to

Signed-off-by: Alex Goins <>
Reviewed-by: Michel Dänzer <>
3 jobs for agoins-msSharePixmapBacking-segv-fix in 5 minutes and 34 seconds (queued for 1 second)