]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
drm/gf100-/gr: implement the proper SetShaderExceptions method
authorBen Skeggs <bskeggs@redhat.com>
Sat, 9 Aug 2014 18:10:30 +0000 (04:10 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 9 Aug 2014 19:28:17 +0000 (05:28 +1000)
We have another version of it implemented in SW, however, that version
isn't serialised with normal PGRAPH operation and can possibly clobber
the enables for another context.

This is the same method that's implemented by the NVIDIA binary driver.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/graph/gk20a.c
drivers/gpu/drm/nouveau/core/engine/graph/gm107.c
drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h
drivers/gpu/drm/nouveau/core/engine/graph/nvc1.c
drivers/gpu/drm/nouveau/core/engine/graph/nvc8.c
drivers/gpu/drm/nouveau/core/engine/graph/nve4.c
drivers/gpu/drm/nouveau/core/engine/graph/nvf0.c
drivers/gpu/drm/nouveau/nvif/class.h

index 2420251ebc67c73f096c40602a450f2716d2b729..7d0abe9f3fe73dbc9912d929deb70e4a82fd0dd1 100644 (file)
@@ -27,8 +27,8 @@ static struct nouveau_oclass
 gk20a_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0xa040, &nouveau_object_ofuncs },
-       { KEPLER_C, &nvc0_fermi_ofuncs },
-       { 0xa0c0, &nouveau_object_ofuncs },
+       { KEPLER_C, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { KEPLER_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index e20b98dbaf3e1e79c98c0d12923fb095ebea777b..4bdbdab2fd9a3379e3d5103298bc6d1e809dcc5f 100644 (file)
@@ -36,8 +36,8 @@ static struct nouveau_oclass
 gm107_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0xa140, &nouveau_object_ofuncs },
-       { MAXWELL_A, &nvc0_fermi_ofuncs },
-       { 0xb0c0, &nouveau_object_ofuncs },
+       { MAXWELL_A, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { MAXWELL_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index 85d5c36c3f0a9407ebfcb94a586caec051ee6c0a..db19191176fa513ed958377fdceb1a4e6a735afd 100644 (file)
@@ -214,12 +214,38 @@ nvc0_fermi_ofuncs = {
        .mthd = nvc0_fermi_mthd,
 };
 
+static int
+nvc0_graph_set_shader_exceptions(struct nouveau_object *object, u32 mthd,
+                                void *pdata, u32 size)
+{
+       struct nvc0_graph_priv *priv = (void *)nv_engine(object);
+       if (size >= sizeof(u32)) {
+               u32 data = *(u32 *)pdata ? 0xffffffff : 0x00000000;
+               nv_wr32(priv, 0x419e44, data);
+               nv_wr32(priv, 0x419e4c, data);
+               return 0;
+       }
+       return -EINVAL;
+}
+
+struct nouveau_omthds
+nvc0_graph_9097_omthds[] = {
+       { 0x1528, 0x1528, nvc0_graph_set_shader_exceptions },
+       {}
+};
+
+struct nouveau_omthds
+nvc0_graph_90c0_omthds[] = {
+       { 0x1528, 0x1528, nvc0_graph_set_shader_exceptions },
+       {}
+};
+
 struct nouveau_oclass
 nvc0_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0x9039, &nouveau_object_ofuncs },
-       { FERMI_A, &nvc0_fermi_ofuncs },
-       { 0x90c0, &nouveau_object_ofuncs },
+       { FERMI_A, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index d520143681303de309e18b17236542a475624dd1..7ed9e89c34350bc30f8e1e5da3fd5cff7749ce81 100644 (file)
@@ -150,6 +150,8 @@ int  nvf0_graph_fini(struct nouveau_object *, bool);
 extern struct nouveau_ofuncs nvc0_fermi_ofuncs;
 
 extern struct nouveau_oclass nvc0_graph_sclass[];
+extern struct nouveau_omthds nvc0_graph_9097_omthds[];
+extern struct nouveau_omthds nvc0_graph_90c0_omthds[];
 extern struct nouveau_oclass nvc8_graph_sclass[];
 extern struct nouveau_oclass nvf0_graph_sclass[];
 
index 80096762e483654302406901b17cc6bfcce24950..93d58e5b82c266d53632b0cdee78fed0c76110d5 100644 (file)
@@ -33,9 +33,9 @@ static struct nouveau_oclass
 nvc1_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0x9039, &nouveau_object_ofuncs },
-       { FERMI_A, &nvc0_fermi_ofuncs },
-       { FERMI_B, &nvc0_fermi_ofuncs },
-       { 0x90c0, &nouveau_object_ofuncs },
+       { FERMI_A, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_B, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index c944590838d41ba490ab04d29218bd78a14cb967..692e1eda0eb4aa9c61e1644c064c38cb34068202 100644 (file)
@@ -33,10 +33,10 @@ struct nouveau_oclass
 nvc8_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0x9039, &nouveau_object_ofuncs },
-       { FERMI_A, &nvc0_fermi_ofuncs },
-       { FERMI_B, &nvc0_fermi_ofuncs },
-       { FERMI_C, &nvc0_fermi_ofuncs },
-       { 0x90c0, &nouveau_object_ofuncs },
+       { FERMI_A, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_B, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_C, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { FERMI_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index 96c8d44e0f444e546fc685ab2f1b3bcaac9400e7..0c71f5c67ae029b73ddcb6fef7776e446ddf82b2 100644 (file)
@@ -35,8 +35,8 @@ static struct nouveau_oclass
 nve4_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0xa040, &nouveau_object_ofuncs },
-       { KEPLER_A, &nvc0_fermi_ofuncs },
-       { 0xa0c0, &nouveau_object_ofuncs },
+       { KEPLER_A, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { KEPLER_COMPUTE_A, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index 979ac8aa9a0342b7105574920105d3096e43c9d1..c306c0f2fc84a28d8c4ece9b2494b8cea437daa0 100644 (file)
@@ -33,8 +33,8 @@ struct nouveau_oclass
 nvf0_graph_sclass[] = {
        { 0x902d, &nouveau_object_ofuncs },
        { 0xa140, &nouveau_object_ofuncs },
-       { KEPLER_B, &nvc0_fermi_ofuncs },
-       { 0xa1c0, &nouveau_object_ofuncs },
+       { KEPLER_B, &nvc0_fermi_ofuncs, nvc0_graph_9097_omthds },
+       { KEPLER_COMPUTE_B, &nouveau_object_ofuncs, nvc0_graph_90c0_omthds },
        {}
 };
 
index 73bf1269c72eb31d2074c83ea16b1da97c85ca86..cc81e0e5fd30652203bc9f2af64db3055c71258d 100644 (file)
 
 #define MAXWELL_A                                                    0x0000b097
 
+#define FERMI_COMPUTE_A                                              0x000090c0
+#define FERMI_COMPUTE_B                                              0x000091c0
+
+#define KEPLER_COMPUTE_A                                             0x0000a0c0
+#define KEPLER_COMPUTE_B                                             0x0000a1c0
+
+#define MAXWELL_COMPUTE_A                                            0x0000b0c0
+
 
 /*******************************************************************************
  * client