mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
nouveau: fix race in nouveau_screen_get_name
Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Pierre Moreau <dev@pmoreau.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8765>
This commit is contained in:
parent
98280e8348
commit
b7d2add5e0
2 changed files with 5 additions and 5 deletions
|
|
@ -40,11 +40,8 @@ int nouveau_mesa_debug = 0;
|
|||
static const char *
|
||||
nouveau_screen_get_name(struct pipe_screen *pscreen)
|
||||
{
|
||||
struct nouveau_device *dev = nouveau_screen(pscreen)->device;
|
||||
static char buffer[128];
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "NV%02X", dev->chipset);
|
||||
return buffer;
|
||||
struct nouveau_screen *screen = nouveau_screen(pscreen);
|
||||
return screen->chipset_name;
|
||||
}
|
||||
|
||||
static const char *
|
||||
|
|
@ -318,6 +315,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
|
|||
if (!ret)
|
||||
screen->cpu_gpu_time_delta = time - screen->cpu_gpu_time_delta * 1000;
|
||||
|
||||
snprintf(screen->chipset_name, sizeof(screen->chipset_name), "NV%02X", dev->chipset);
|
||||
pscreen->get_name = nouveau_screen_get_name;
|
||||
pscreen->get_vendor = nouveau_screen_get_vendor;
|
||||
pscreen->get_device_vendor = nouveau_screen_get_device_vendor;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ struct nouveau_screen {
|
|||
struct nouveau_client *client;
|
||||
struct nouveau_pushbuf *pushbuf;
|
||||
|
||||
char chipset_name[8];
|
||||
|
||||
int refcount;
|
||||
|
||||
unsigned transfer_pushbuf_threshold;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue