nouveau/winsys: Add m2mf/compute objects
authorDave Airlie <airlied@redhat.com>
Thu, 2 Jun 2022 04:46:40 +0000 (14:46 +1000)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:31:54 +0000 (21:31 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/winsys/nouveau_context.c
src/nouveau/winsys/nouveau_context.h

index 367ae28..ce31947 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "nvtypes.h"
 #include "classes/cl902d.h"
+#include "classes/clc5c0.h"
 
 int
 nouveau_ws_context_create(struct nouveau_ws_device *dev, struct nouveau_ws_context **out)
@@ -29,6 +30,22 @@ nouveau_ws_context_create(struct nouveau_ws_device *dev, struct nouveau_ws_conte
    if (ret)
       goto fail_2d;
 
+   uint32_t obj_class = 0xa140;//NVF0_P2MF_CLASS;
+   ret = nouveau_object_new((*out)->channel, 0xbeef323f, obj_class, NULL, 0,
+                            &(*out)->m2mf);
+   if (ret) {
+      FREE(*out);
+      return ret;
+   }
+
+   obj_class = TURING_COMPUTE_A;
+   ret = nouveau_object_new((*out)->channel, 0xbeef00c0, obj_class, NULL, 0,
+                          &(*out)->compute);
+   if (ret) {
+      FREE(*out);
+      return ret;
+   }
+
    return 0;
 
 fail_2d:
index 2d54b8c..e335772 100644 (file)
@@ -9,6 +9,8 @@ struct nouveau_ws_context {
    struct nouveau_object *channel;
 
    struct nouveau_object *eng2d;
+   struct nouveau_object *m2mf;
+   struct nouveau_object *compute;
 };
 
 int nouveau_ws_context_create(struct nouveau_ws_device *, struct nouveau_ws_context **out);