nouveau/winsys: allocate unique object handles across channels.

GSP requires unique object handles across channels, otherwise
it reports an error.

This fixes vulkaninfo on gsp enabled fw

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Dave Airlie
2023-03-17 15:54:14 +10:00
committed by Marge Bot
parent 37505e9bba
commit 983b5e9934
+6 -4
View File
@@ -124,6 +124,7 @@ nouveau_ws_context_create(struct nouveau_ws_device *dev, struct nouveau_ws_conte
{
struct drm_nouveau_channel_alloc req = { };
uint32_t classes[NOUVEAU_WS_CONTEXT_MAX_CLASSES];
uint32_t base;
*out = CALLOC_STRUCT(nouveau_ws_context);
if (!*out)
@@ -137,15 +138,16 @@ nouveau_ws_context_create(struct nouveau_ws_device *dev, struct nouveau_ws_conte
if (ret)
goto fail_chan;
base = (0xbeef + req.channel) << 16;
uint32_t obj_class = nouveau_ws_context_find_class(classes, 0x2d);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, 0xbeef902d, obj_class, &(*out)->eng2d);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, base | 0x902d, obj_class, &(*out)->eng2d);
if (ret)
goto fail_2d;
obj_class = nouveau_ws_context_find_class(classes, 0x40);
if (!obj_class)
obj_class = nouveau_ws_context_find_class(classes, 0x39);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, 0xbeef323f, obj_class, &(*out)->m2mf);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, base | 0x323f, obj_class, &(*out)->m2mf);
if (ret)
goto fail_subchan;
@@ -155,12 +157,12 @@ nouveau_ws_context_create(struct nouveau_ws_device *dev, struct nouveau_ws_conte
goto fail_subchan;
obj_class = nouveau_ws_context_find_class(classes, 0x97);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, 0xbeef003d, obj_class, &(*out)->eng3d);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, base | 0x003d, obj_class, &(*out)->eng3d);
if (ret)
goto fail_subchan;
obj_class = nouveau_ws_context_find_class(classes, 0xc0);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, 0xbeef00c0, obj_class, &(*out)->compute);
ret = nouveau_ws_subchan_alloc(dev->fd, req.channel, base | 0x00c0, obj_class, &(*out)->compute);
if (ret)
goto fail_subchan;