Skip to contentSkip to conversation

Add NULL checking for drawable in sna_dri2_flip_event

PATCH In review Lim Siew Hoon 1 participant 2 messages Jan 9, 2016 – Jan 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add NULL checking for drawable in sna_dri2_flip_event

The last flip complete signal may happen after the sna_dri2_destroy_window function has been called. This leads to calling frame_swap_complete with a null flip drawable. So check for that and handle accordingly.

---
 src/sna/sna_dri2.c | 4 ++++
 1 file changed, 4 insertions(+)
src/sna/sna_dri2.c +4 -0
index 05a4f1c..6f59f05 100644
@@ -2874,6 +2874,10 @@ static void sna_dri2_flip_event(struct sna_dri2_event *flip)
 	case FLIP_THROTTLE:
 		if (flip->signal) {
 			DBG(("%s: triple buffer swap complete, unblocking client\n", __FUNCTION__));
+			if(flip->draw == NULL) {
+				sna_dri2_event_free(flip);
+				break;
+			}
 			frame_swap_complete(flip, DRI2_FLIP_COMPLETE);
 		}
 	case FLIP_COMPLETE:
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Hi,

CC-ing Chris Wilson to help do code review DDX driver side and possible others corner case that we didn't spotted. This is corner case that happen hitting assert checking until SNA DDX driver exit.

I'm trying to cc-ing Chirs Wilson in "[email protected]" email address. But received delivery failed from this email address. I don't know why.

Thanks.
...siewhoon

Quoted 39 lines

-----Original Message-----
From: Intel-gfx [mailto:[email protected]] On Behalf Of Lim Siew Hoon
Sent: Saturday, January 09, 2016 10:47 AM
To: [email protected]
Subject: [Intel-gfx] [PATCH] Add NULL checking for drawable in sna_dri2_flip_event

The last flip complete signal may happen after the sna_dri2_destroy_window function has been called. This leads to calling frame_swap_complete with a null flip drawable. So check for that and handle accordingly.

---
 src/sna/sna_dri2.c | 4 ++++
 1 file changed, 4 insertions(+)
src/sna/sna_dri2.c index 05a4f1c..6f59f05 renamed from src/sna/sna_dri2.c +0 -0

100644

src/sna/sna_dri2.c +4 -0
@@ -2874,6 +2874,10 @@ static void sna_dri2_flip_event(struct
 sna_dri2_event *flip)
 	case FLIP_THROTTLE:
 		if (flip->signal) {
 			DBG(("%s: triple buffer swap complete, unblocking
 client\n", __FUNCTION__));
+			if(flip->draw == NULL) {
+				sna_dri2_event_free(flip);
+				break;
+			}
 			frame_swap_complete(flip, DRI2_FLIP_COMPLETE);
src/sna/sna_dri2.c +0 -1
 		}
 	case FLIP_COMPLETE:
--

2.1.0

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx