Update to 22.1.5

This commit is contained in:
Pete Walter 2022-08-04 13:06:28 +01:00
parent 84f09b5018
commit 367c78aeae
3 changed files with 2 additions and 121 deletions

View file

@ -1,116 +0,0 @@
From 9cfb950bc704d4f984f5a39838634c73a5765bac Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Thu, 14 Jul 2022 10:34:04 +1000
Subject: [PATCH] kms/dri: add mutex lock around map/unmap
this can get called from multiple threads with the recent llvmpipe
overlapping rendering changes, so make sure to lock around the
map/unmapping so they can't race.
This should fixes some crashes seen with kwin.
---
.../winsys/sw/kms-dri/kms_dri_sw_winsys.c | 20 +++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index a26ff0ffe35..aa1257acea9 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -55,6 +55,8 @@
#include "frontend/drm_driver.h"
#include "kms_dri_sw_winsys.h"
+#include "util/simple_mtx.h"
+
#ifdef DEBUG
#define DEBUG_PRINT(msg, ...) fprintf(stderr, msg, __VA_ARGS__)
#else
@@ -86,6 +88,7 @@ struct kms_sw_displaytarget
int map_count;
struct list_head link;
struct list_head planes;
+ mtx_t map_lock;
};
struct kms_sw_winsys
@@ -183,6 +186,8 @@ kms_sw_displaytarget_create(struct sw_winsys *ws,
kms_sw_dt->format = format;
+ mtx_init(&kms_sw_dt->map_lock, mtx_plain);
+
memset(&create_req, 0, sizeof(create_req));
create_req.bpp = util_format_get_blocksizebits(format);
create_req.width = width;
@@ -239,6 +244,7 @@ kms_sw_displaytarget_destroy(struct sw_winsys *ws,
list_del(&kms_sw_dt->link);
+ mtx_destroy(&kms_sw_dt->map_lock);
DEBUG_PRINT("KMS-DEBUG: destroyed buffer %u\n", kms_sw_dt->handle);
struct kms_sw_plane *tmp;
@@ -260,11 +266,12 @@ kms_sw_displaytarget_map(struct sw_winsys *ws,
struct drm_mode_map_dumb map_req;
int prot, ret;
+ mtx_lock(&kms_sw_dt->map_lock);
memset(&map_req, 0, sizeof map_req);
map_req.handle = kms_sw_dt->handle;
ret = drmIoctl(kms_sw->fd, DRM_IOCTL_MODE_MAP_DUMB, &map_req);
if (ret)
- return NULL;
+ goto fail_locked;
prot = (flags == PIPE_MAP_READ) ? PROT_READ : (PROT_READ | PROT_WRITE);
void **ptr = (flags == PIPE_MAP_READ) ? &kms_sw_dt->ro_mapped : &kms_sw_dt->mapped;
@@ -272,7 +279,7 @@ kms_sw_displaytarget_map(struct sw_winsys *ws,
void *tmp = mmap(NULL, kms_sw_dt->size, prot, MAP_SHARED,
kms_sw->fd, map_req.offset);
if (tmp == MAP_FAILED)
- return NULL;
+ goto fail_locked;
*ptr = tmp;
}
@@ -281,7 +288,12 @@ kms_sw_displaytarget_map(struct sw_winsys *ws,
kms_sw_dt->map_count++;
+ mtx_unlock(&kms_sw_dt->map_lock);
+
return *ptr + plane->offset;
+fail_locked:
+ mtx_unlock(&kms_sw_dt->map_lock);
+ return NULL;
}
static struct kms_sw_displaytarget *
@@ -363,13 +375,16 @@ kms_sw_displaytarget_unmap(struct sw_winsys *ws,
struct kms_sw_plane *plane = kms_sw_plane(dt);
struct kms_sw_displaytarget *kms_sw_dt = plane->dt;
+ mtx_lock(&kms_sw_dt->map_lock);
if (!kms_sw_dt->map_count) {
DEBUG_PRINT("KMS-DEBUG: ignore duplicated unmap %u", kms_sw_dt->handle);
+ mtx_unlock(&kms_sw_dt->map_lock);
return;
}
kms_sw_dt->map_count--;
if (kms_sw_dt->map_count) {
DEBUG_PRINT("KMS-DEBUG: ignore unmap for busy buffer %u", kms_sw_dt->handle);
+ mtx_unlock(&kms_sw_dt->map_lock);
return;
}
@@ -384,6 +399,7 @@ kms_sw_displaytarget_unmap(struct sw_winsys *ws,
munmap(kms_sw_dt->ro_mapped, kms_sw_dt->size);
kms_sw_dt->ro_mapped = MAP_FAILED;
}
+ mtx_unlock(&kms_sw_dt->map_lock);
}
static struct sw_displaytarget *
--
2.37.0

View file

@ -53,7 +53,7 @@
Name: mesa
Summary: Mesa graphics libraries
%global ver 22.1.4
%global ver 22.1.5
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Release: %autorelease
License: MIT
@ -75,9 +75,6 @@ Patch0006: 0004-Revert-nouveau-no-modifier-the-invalid-modifier.patch
Patch0007: 0005-Revert-nouveau-Use-DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEA.patch
Patch0008: 0006-Revert-nouveau-Stash-supported-sector-layout-in-scre.patch
# attempt to fix race in kms_swrast_dri.so affecting kwin.
Patch0010: 0001-kms-dri-add-mutex-lock-around-map-unmap.patch
BuildRequires: meson >= 0.45
BuildRequires: gcc
BuildRequires: gcc-c++

View file

@ -1 +1 @@
SHA512 (mesa-22.1.4.tar.xz) = 64f584a70c3c7554682c861444c75433eaa858e86725d9de4c067c234bcae535dffa9dcbab16fb86a1d30680772bd23ea6af336afdf99a50960d6c133592950f
SHA512 (mesa-22.1.5.tar.xz) = 1aa72cd5b61635d489904944e5d80b1d923a38ffbd295341e6b30c492e469463bc4d0b63f74b071580572aec3a2cdfe19b3f2919ebc0fb4bcc35e114db925abc