Commit 7a7e55c5 authored by Alex Goins's avatar Alex Goins Committed by Aaron Plattner
Browse files

glamor: Update pixmap's devKind when making it exportable

When making a pixmap exportable, glamor will currently create a temporary
exported pixmap backed by a GBM bo, with the devKind updated to the stride of
the bo. However, when the backing of the exported pixmap is swapped into the
original, the devKind of the original is not updated.

Some GBM bos may get implicitly padded, in which case the devKind of the pixmap
will not match the stride of the backing bo. For example, an 800x600 pixmap will
have a devKind of 3200, but the bo's stride will be 3328. This can cause
corruption with PRIME, when the sink uses the wrong stride to display the shared

This commit changes glamor_make_pixmap_exportable() to update the devKind of the
original pixmap after it swaps exported pixmap's backing into it, keeping
everything consistent.

Fixes issue #1018.
Signed-off-by: Alex Goins's avatarAlex Goins <>
Signed-off-by: Aaron Plattner's avatarAaron Plattner <>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
parent affc4745
Pipeline #223964 passed with stages
in 5 minutes and 8 seconds
......@@ -362,6 +362,9 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
glamor_egl_exchange_buffers(pixmap, exported);
/* Swap the devKind into the original pixmap, reflecting the bo's stride */
screen->ModifyPixmapHeader(pixmap, 0, 0, 0, 0, exported->devKind, NULL);
return TRUE;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment