All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Knockel <jeff@jeffreyknockel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH xf86-video-intel] sna: Initialize sna pointer
Date: Thu, 21 Jul 2022 15:37:36 -0400	[thread overview]
Message-ID: <f865400b-8065-2bb4-0896-2abf3b7dd7b0@jeffreyknockel.com> (raw)

From: Jeffrey Knockel <jeff@jeffreyknockel.com>

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@jeffreyknockel.com>
---
 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

             reply	other threads:[~2022-07-21 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 19:37 Jeffrey Knockel [this message]
2022-07-21 19:52 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for sna: Initialize sna pointer Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f865400b-8065-2bb4-0896-2abf3b7dd7b0@jeffreyknockel.com \
    --to=jeff@jeffreyknockel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.