From 7252bb2d96590dee20b0ef2e1cd0f245806b19ea Mon Sep 17 00:00:00 2001 From: Yusuf Khan Date: Sun, 7 Apr 2024 04:44:12 -0500 Subject: [PATCH] nouveau: Fix crash when destination or source screen fences are null Fixes: dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.*, one of them, its quite finiky, one may say random Signed-off-by: Yusuf Khan Reviewed-by: Karol Herbst Cc: mesa-stable Part-of: (cherry picked from commit 482d9fcbf304e41a0a4ab461894277e5cfd2c9b2) --- .pick_status.json | 2 +- src/gallium/drivers/nouveau/nouveau_screen.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 09421326972..5f72f9c911e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -764,7 +764,7 @@ "description": "nouveau: Fix crash when destination or source screen fences are null", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index ec6c731d7d8..33ac4d92374 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -80,7 +80,8 @@ nouveau_screen_fence_ref(struct pipe_screen *pscreen, struct pipe_fence_handle **ptr, struct pipe_fence_handle *pfence) { - nouveau_fence_ref(nouveau_fence(pfence), (struct nouveau_fence **)ptr); + nouveau_fence_ref((pfence ? nouveau_fence(pfence) : NULL), + (ptr ? (struct nouveau_fence **)ptr : NULL)); } static bool