From: Jeffrey Knockel <jeff@xxxxxxxxxxxxxxxxxx> Initialize the sna pointer if it hasn't already been initialized. Otherwise, we have the following segfault: 0x00007f24b993ef04 in list_add (entry=0x564a7a1380f8, head=0x7ffd01899aa8) at ../../src/intel_list.h:161 0x00007f24b993f0a0 in list_move (list=0x564a7a1380f8, head=0x7ffd01899aa8) at ../../src/intel_list.h:248 0x00007f24b99524c9 in sna_drawable_use_bo (drawable=0x564a79ef0530, flags=0, box=0x7ffd01853c80, damage=0x7ffd01853ca0) at sna_accel.c:3965 0x00007f24b996f21b in sna_poly_segment (drawable=0x564a79ef0530, gc=0x564a7a0c44f0, n=146, seg=0x564a7a582ff4) at sna_accel.c:10858 0x0000564a788607bf in damagePolySegment (pDrawable=0x564a79ef0530, pGC=0x564a7a0c44f0, nSeg=146, pSeg=0x564a7a582ff4) at ../miext/damage/damage.c:1023 0x0000564a787e3577 in ProcPolySegment (client=0x564a7a15bc10) at ../dix/dispatch.c:1909 0x0000564a787df4be in Dispatch () at ../dix/dispatch.c:551 0x0000564a787eeb2b in dix_main (argc=11, argv=0x7ffd01854128, envp=0x7ffd01854188) at ../dix/main.c:272 0x0000564a789e05cd in main (argc=11, argv=0x7ffd01854128, envp=0x7ffd01854188) at ../dix/stubmain.c:34 Signed-off-by: Jeffrey Knockel <jeff@xxxxxxxxxxxxxxxxxx> --- src/sna/sna_accel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 89b82afa..72a84833 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3632,7 +3632,7 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, { PixmapPtr pixmap = get_drawable_pixmap(drawable); struct sna_pixmap *priv = sna_pixmap(pixmap); - struct sna *sna; + struct sna *sna = NULL; RegionRec region; int16_t dx, dy; int ret; @@ -3962,6 +3962,8 @@ use_gpu_bo: if (priv->shm) { assert(!priv->flush); + if (sna == NULL) + sna = to_sna_from_pixmap(pixmap); list_move(&priv->flush_list, &sna->flush_pixmaps); } -- 2.34.1