|
@@ -10,7 +10,7 @@
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
*
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
- * paragraph) shall be included in all copies or substantial portions of the
|
|
|
+ * paragr) shall be included in all copies or substantial portions of the
|
|
|
* Software.
|
|
|
*
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
@@ -32,12 +32,12 @@
|
|
|
#include <subdev/timer.h>
|
|
|
|
|
|
#include <engine/fifo.h>
|
|
|
-#include <engine/graph.h>
|
|
|
+#include <engine/gr.h>
|
|
|
|
|
|
#include "regs.h"
|
|
|
|
|
|
static u32
|
|
|
-nv04_graph_ctx_regs[] = {
|
|
|
+nv04_gr_ctx_regs[] = {
|
|
|
0x0040053c,
|
|
|
0x00400544,
|
|
|
0x00400540,
|
|
@@ -351,21 +351,21 @@ nv04_graph_ctx_regs[] = {
|
|
|
NV04_PGRAPH_DEBUG_3
|
|
|
};
|
|
|
|
|
|
-struct nv04_graph_priv {
|
|
|
- struct nouveau_graph base;
|
|
|
- struct nv04_graph_chan *chan[16];
|
|
|
+struct nv04_gr_priv {
|
|
|
+ struct nouveau_gr base;
|
|
|
+ struct nv04_gr_chan *chan[16];
|
|
|
spinlock_t lock;
|
|
|
};
|
|
|
|
|
|
-struct nv04_graph_chan {
|
|
|
+struct nv04_gr_chan {
|
|
|
struct nouveau_object base;
|
|
|
int chid;
|
|
|
- u32 nv04[ARRAY_SIZE(nv04_graph_ctx_regs)];
|
|
|
+ u32 nv04[ARRAY_SIZE(nv04_gr_ctx_regs)];
|
|
|
};
|
|
|
|
|
|
|
|
|
-static inline struct nv04_graph_priv *
|
|
|
-nv04_graph_priv(struct nv04_graph_chan *chan)
|
|
|
+static inline struct nv04_gr_priv *
|
|
|
+nv04_gr_priv(struct nv04_gr_chan *chan)
|
|
|
{
|
|
|
return (void *)nv_object(chan)->engine;
|
|
|
}
|
|
@@ -449,9 +449,9 @@ nv04_graph_priv(struct nv04_graph_chan *chan)
|
|
|
*/
|
|
|
|
|
|
static void
|
|
|
-nv04_graph_set_ctx1(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
+nv04_gr_set_ctx1(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)object->engine;
|
|
|
+ struct nv04_gr_priv *priv = (void *)object->engine;
|
|
|
int subc = (nv_rd32(priv, NV04_PGRAPH_TRAPPED_ADDR) >> 13) & 0x7;
|
|
|
u32 tmp;
|
|
|
|
|
@@ -465,7 +465,7 @@ nv04_graph_set_ctx1(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
}
|
|
|
|
|
|
static void
|
|
|
-nv04_graph_set_ctx_val(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
+nv04_gr_set_ctx_val(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
{
|
|
|
int class, op, valid = 1;
|
|
|
u32 tmp, ctx1;
|
|
@@ -509,11 +509,11 @@ nv04_graph_set_ctx_val(struct nouveau_object *object, u32 mask, u32 value)
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- nv04_graph_set_ctx1(object, 0x01000000, valid << 24);
|
|
|
+ nv04_gr_set_ctx1(object, 0x01000000, valid << 24);
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_set_operation(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_set_operation(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
u32 class = nv_ro32(object, 0) & 0xff;
|
|
@@ -523,17 +523,17 @@ nv04_graph_mthd_set_operation(struct nouveau_object *object, u32 mthd,
|
|
|
/* Old versions of the objects only accept first three operations. */
|
|
|
if (data > 2 && class < 0x40)
|
|
|
return 1;
|
|
|
- nv04_graph_set_ctx1(object, 0x00038000, data << 15);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00038000, data << 15);
|
|
|
/* changing operation changes set of objects needed for validation */
|
|
|
- nv04_graph_set_ctx_val(object, 0, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0, 0);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_surf3d_clip_h(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_surf3d_clip_h(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)object->engine;
|
|
|
+ struct nv04_gr_priv *priv = (void *)object->engine;
|
|
|
u32 data = *(u32 *)args;
|
|
|
u32 min = data & 0xffff, max;
|
|
|
u32 w = data >> 16;
|
|
@@ -551,10 +551,10 @@ nv04_graph_mthd_surf3d_clip_h(struct nouveau_object *object, u32 mthd,
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_surf3d_clip_v(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_surf3d_clip_v(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)object->engine;
|
|
|
+ struct nv04_gr_priv *priv = (void *)object->engine;
|
|
|
u32 data = *(u32 *)args;
|
|
|
u32 min = data & 0xffff, max;
|
|
|
u32 w = data >> 16;
|
|
@@ -572,7 +572,7 @@ nv04_graph_mthd_surf3d_clip_v(struct nouveau_object *object, u32 mthd,
|
|
|
}
|
|
|
|
|
|
static u16
|
|
|
-nv04_graph_mthd_bind_class(struct nouveau_object *object, u32 *args, u32 size)
|
|
|
+nv04_gr_mthd_bind_class(struct nouveau_object *object, u32 *args, u32 size)
|
|
|
{
|
|
|
struct nouveau_instmem *imem = nouveau_instmem(object);
|
|
|
u32 inst = *(u32 *)args << 4;
|
|
@@ -580,380 +580,380 @@ nv04_graph_mthd_bind_class(struct nouveau_object *object, u32 *args, u32 size)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf2d(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf2d(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx1(object, 0x00004000, 0);
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00004000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0);
|
|
|
return 0;
|
|
|
case 0x42:
|
|
|
- nv04_graph_set_ctx1(object, 0x00004000, 0);
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00004000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf2d_swzsurf(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf2d_swzsurf(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx1(object, 0x00004000, 0);
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00004000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0);
|
|
|
return 0;
|
|
|
case 0x42:
|
|
|
- nv04_graph_set_ctx1(object, 0x00004000, 0);
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00004000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
return 0;
|
|
|
case 0x52:
|
|
|
- nv04_graph_set_ctx1(object, 0x00004000, 0x00004000);
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
+ nv04_gr_set_ctx1(object, 0x00004000, 0x00004000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv01_graph_mthd_bind_patt(struct nouveau_object *object, u32 mthd,
|
|
|
+nv01_gr_mthd_bind_patt(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x08000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x08000000, 0);
|
|
|
return 0;
|
|
|
case 0x18:
|
|
|
- nv04_graph_set_ctx_val(object, 0x08000000, 0x08000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x08000000, 0x08000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_patt(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_patt(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x08000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x08000000, 0);
|
|
|
return 0;
|
|
|
case 0x44:
|
|
|
- nv04_graph_set_ctx_val(object, 0x08000000, 0x08000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x08000000, 0x08000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_rop(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_rop(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x10000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x10000000, 0);
|
|
|
return 0;
|
|
|
case 0x43:
|
|
|
- nv04_graph_set_ctx_val(object, 0x10000000, 0x10000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x10000000, 0x10000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_beta1(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_beta1(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x20000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x20000000, 0);
|
|
|
return 0;
|
|
|
case 0x12:
|
|
|
- nv04_graph_set_ctx_val(object, 0x20000000, 0x20000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x20000000, 0x20000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_beta4(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_beta4(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x40000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x40000000, 0);
|
|
|
return 0;
|
|
|
case 0x72:
|
|
|
- nv04_graph_set_ctx_val(object, 0x40000000, 0x40000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x40000000, 0x40000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf_dst(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf_dst(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0);
|
|
|
return 0;
|
|
|
case 0x58:
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf_src(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf_src(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x04000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x04000000, 0);
|
|
|
return 0;
|
|
|
case 0x59:
|
|
|
- nv04_graph_set_ctx_val(object, 0x04000000, 0x04000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x04000000, 0x04000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf_color(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf_color(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0);
|
|
|
return 0;
|
|
|
case 0x5a:
|
|
|
- nv04_graph_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x02000000, 0x02000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_mthd_bind_surf_zeta(struct nouveau_object *object, u32 mthd,
|
|
|
+nv04_gr_mthd_bind_surf_zeta(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx_val(object, 0x04000000, 0);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x04000000, 0);
|
|
|
return 0;
|
|
|
case 0x5b:
|
|
|
- nv04_graph_set_ctx_val(object, 0x04000000, 0x04000000);
|
|
|
+ nv04_gr_set_ctx_val(object, 0x04000000, 0x04000000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv01_graph_mthd_bind_clip(struct nouveau_object *object, u32 mthd,
|
|
|
+nv01_gr_mthd_bind_clip(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx1(object, 0x2000, 0);
|
|
|
+ nv04_gr_set_ctx1(object, 0x2000, 0);
|
|
|
return 0;
|
|
|
case 0x19:
|
|
|
- nv04_graph_set_ctx1(object, 0x2000, 0x2000);
|
|
|
+ nv04_gr_set_ctx1(object, 0x2000, 0x2000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv01_graph_mthd_bind_chroma(struct nouveau_object *object, u32 mthd,
|
|
|
+nv01_gr_mthd_bind_chroma(struct nouveau_object *object, u32 mthd,
|
|
|
void *args, u32 size)
|
|
|
{
|
|
|
- switch (nv04_graph_mthd_bind_class(object, args, size)) {
|
|
|
+ switch (nv04_gr_mthd_bind_class(object, args, size)) {
|
|
|
case 0x30:
|
|
|
- nv04_graph_set_ctx1(object, 0x1000, 0);
|
|
|
+ nv04_gr_set_ctx1(object, 0x1000, 0);
|
|
|
return 0;
|
|
|
/* Yes, for some reason even the old versions of objects
|
|
|
* accept 0x57 and not 0x17. Consistency be damned.
|
|
|
*/
|
|
|
case 0x57:
|
|
|
- nv04_graph_set_ctx1(object, 0x1000, 0x1000);
|
|
|
+ nv04_gr_set_ctx1(object, 0x1000, 0x1000);
|
|
|
return 0;
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv03_graph_gdi_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x0188, 0x0188, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv03_gr_gdi_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x0188, 0x0188, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_gdi_omthds[] = {
|
|
|
- { 0x0188, 0x0188, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_gdi_omthds[] = {
|
|
|
+ { 0x0188, 0x0188, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv01_graph_blit_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x018c, 0x018c, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x019c, 0x019c, nv04_graph_mthd_bind_surf_src },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv01_gr_blit_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x018c, 0x018c, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x019c, 0x019c, nv04_gr_mthd_bind_surf_src },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_blit_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x019c, 0x019c, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_blit_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x019c, 0x019c, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_iifc_omthds[] = {
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x018c, 0x018c, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x019c, 0x019c, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x01a0, 0x01a0, nv04_graph_mthd_bind_surf2d_swzsurf },
|
|
|
- { 0x03e4, 0x03e4, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_iifc_omthds[] = {
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x018c, 0x018c, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x019c, 0x019c, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x01a0, 0x01a0, nv04_gr_mthd_bind_surf2d_swzsurf },
|
|
|
+ { 0x03e4, 0x03e4, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv01_graph_ifc_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x018c, 0x018c, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv01_gr_ifc_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x018c, 0x018c, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_ifc_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x019c, 0x019c, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_ifc_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x019c, 0x019c, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv03_graph_sifc_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv03_gr_sifc_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_sifc_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_chroma },
|
|
|
- { 0x0188, 0x0188, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_sifc_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_chroma },
|
|
|
+ { 0x0188, 0x0188, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv03_graph_sifm_omthds[] = {
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x0304, 0x0304, nv04_graph_mthd_set_operation },
|
|
|
+nv03_gr_sifm_omthds[] = {
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x0304, 0x0304, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_sifm_omthds[] = {
|
|
|
- { 0x0188, 0x0188, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x0304, 0x0304, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_sifm_omthds[] = {
|
|
|
+ { 0x0188, 0x0188, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x0304, 0x0304, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_surf3d_omthds[] = {
|
|
|
- { 0x02f8, 0x02f8, nv04_graph_mthd_surf3d_clip_h },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_surf3d_clip_v },
|
|
|
+nv04_gr_surf3d_omthds[] = {
|
|
|
+ { 0x02f8, 0x02f8, nv04_gr_mthd_surf3d_clip_h },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_surf3d_clip_v },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv03_graph_ttri_omthds[] = {
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_surf_color },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_surf_zeta },
|
|
|
+nv03_gr_ttri_omthds[] = {
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_surf_color },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_surf_zeta },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv01_graph_prim_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x0188, 0x0188, nv01_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_surf_dst },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv01_gr_prim_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x0188, 0x0188, nv01_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_surf_dst },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static struct nouveau_omthds
|
|
|
-nv04_graph_prim_omthds[] = {
|
|
|
- { 0x0184, 0x0184, nv01_graph_mthd_bind_clip },
|
|
|
- { 0x0188, 0x0188, nv04_graph_mthd_bind_patt },
|
|
|
- { 0x018c, 0x018c, nv04_graph_mthd_bind_rop },
|
|
|
- { 0x0190, 0x0190, nv04_graph_mthd_bind_beta1 },
|
|
|
- { 0x0194, 0x0194, nv04_graph_mthd_bind_beta4 },
|
|
|
- { 0x0198, 0x0198, nv04_graph_mthd_bind_surf2d },
|
|
|
- { 0x02fc, 0x02fc, nv04_graph_mthd_set_operation },
|
|
|
+nv04_gr_prim_omthds[] = {
|
|
|
+ { 0x0184, 0x0184, nv01_gr_mthd_bind_clip },
|
|
|
+ { 0x0188, 0x0188, nv04_gr_mthd_bind_patt },
|
|
|
+ { 0x018c, 0x018c, nv04_gr_mthd_bind_rop },
|
|
|
+ { 0x0190, 0x0190, nv04_gr_mthd_bind_beta1 },
|
|
|
+ { 0x0194, 0x0194, nv04_gr_mthd_bind_beta4 },
|
|
|
+ { 0x0198, 0x0198, nv04_gr_mthd_bind_surf2d },
|
|
|
+ { 0x02fc, 0x02fc, nv04_gr_mthd_set_operation },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_object_ctor(struct nouveau_object *parent,
|
|
|
+nv04_gr_object_ctor(struct nouveau_object *parent,
|
|
|
struct nouveau_object *engine,
|
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
|
struct nouveau_object **pobject)
|
|
@@ -978,8 +978,8 @@ nv04_graph_object_ctor(struct nouveau_object *parent,
|
|
|
}
|
|
|
|
|
|
struct nouveau_ofuncs
|
|
|
-nv04_graph_ofuncs = {
|
|
|
- .ctor = nv04_graph_object_ctor,
|
|
|
+nv04_gr_ofuncs = {
|
|
|
+ .ctor = nv04_gr_object_ctor,
|
|
|
.dtor = _nouveau_gpuobj_dtor,
|
|
|
.init = _nouveau_gpuobj_init,
|
|
|
.fini = _nouveau_gpuobj_fini,
|
|
@@ -988,48 +988,48 @@ nv04_graph_ofuncs = {
|
|
|
};
|
|
|
|
|
|
static struct nouveau_oclass
|
|
|
-nv04_graph_sclass[] = {
|
|
|
- { 0x0012, &nv04_graph_ofuncs }, /* beta1 */
|
|
|
- { 0x0017, &nv04_graph_ofuncs }, /* chroma */
|
|
|
- { 0x0018, &nv04_graph_ofuncs }, /* pattern (nv01) */
|
|
|
- { 0x0019, &nv04_graph_ofuncs }, /* clip */
|
|
|
- { 0x001c, &nv04_graph_ofuncs, nv01_graph_prim_omthds }, /* line */
|
|
|
- { 0x001d, &nv04_graph_ofuncs, nv01_graph_prim_omthds }, /* tri */
|
|
|
- { 0x001e, &nv04_graph_ofuncs, nv01_graph_prim_omthds }, /* rect */
|
|
|
- { 0x001f, &nv04_graph_ofuncs, nv01_graph_blit_omthds },
|
|
|
- { 0x0021, &nv04_graph_ofuncs, nv01_graph_ifc_omthds },
|
|
|
- { 0x0030, &nv04_graph_ofuncs }, /* null */
|
|
|
- { 0x0036, &nv04_graph_ofuncs, nv03_graph_sifc_omthds },
|
|
|
- { 0x0037, &nv04_graph_ofuncs, nv03_graph_sifm_omthds },
|
|
|
- { 0x0038, &nv04_graph_ofuncs }, /* dvd subpicture */
|
|
|
- { 0x0039, &nv04_graph_ofuncs }, /* m2mf */
|
|
|
- { 0x0042, &nv04_graph_ofuncs }, /* surf2d */
|
|
|
- { 0x0043, &nv04_graph_ofuncs }, /* rop */
|
|
|
- { 0x0044, &nv04_graph_ofuncs }, /* pattern */
|
|
|
- { 0x0048, &nv04_graph_ofuncs, nv03_graph_ttri_omthds },
|
|
|
- { 0x004a, &nv04_graph_ofuncs, nv04_graph_gdi_omthds },
|
|
|
- { 0x004b, &nv04_graph_ofuncs, nv03_graph_gdi_omthds },
|
|
|
- { 0x0052, &nv04_graph_ofuncs }, /* swzsurf */
|
|
|
- { 0x0053, &nv04_graph_ofuncs, nv04_graph_surf3d_omthds },
|
|
|
- { 0x0054, &nv04_graph_ofuncs }, /* ttri */
|
|
|
- { 0x0055, &nv04_graph_ofuncs }, /* mtri */
|
|
|
- { 0x0057, &nv04_graph_ofuncs }, /* chroma */
|
|
|
- { 0x0058, &nv04_graph_ofuncs }, /* surf_dst */
|
|
|
- { 0x0059, &nv04_graph_ofuncs }, /* surf_src */
|
|
|
- { 0x005a, &nv04_graph_ofuncs }, /* surf_color */
|
|
|
- { 0x005b, &nv04_graph_ofuncs }, /* surf_zeta */
|
|
|
- { 0x005c, &nv04_graph_ofuncs, nv04_graph_prim_omthds }, /* line */
|
|
|
- { 0x005d, &nv04_graph_ofuncs, nv04_graph_prim_omthds }, /* tri */
|
|
|
- { 0x005e, &nv04_graph_ofuncs, nv04_graph_prim_omthds }, /* rect */
|
|
|
- { 0x005f, &nv04_graph_ofuncs, nv04_graph_blit_omthds },
|
|
|
- { 0x0060, &nv04_graph_ofuncs, nv04_graph_iifc_omthds },
|
|
|
- { 0x0061, &nv04_graph_ofuncs, nv04_graph_ifc_omthds },
|
|
|
- { 0x0064, &nv04_graph_ofuncs }, /* iifc (nv05) */
|
|
|
- { 0x0065, &nv04_graph_ofuncs }, /* ifc (nv05) */
|
|
|
- { 0x0066, &nv04_graph_ofuncs }, /* sifc (nv05) */
|
|
|
- { 0x0072, &nv04_graph_ofuncs }, /* beta4 */
|
|
|
- { 0x0076, &nv04_graph_ofuncs, nv04_graph_sifc_omthds },
|
|
|
- { 0x0077, &nv04_graph_ofuncs, nv04_graph_sifm_omthds },
|
|
|
+nv04_gr_sclass[] = {
|
|
|
+ { 0x0012, &nv04_gr_ofuncs }, /* beta1 */
|
|
|
+ { 0x0017, &nv04_gr_ofuncs }, /* chroma */
|
|
|
+ { 0x0018, &nv04_gr_ofuncs }, /* pattern (nv01) */
|
|
|
+ { 0x0019, &nv04_gr_ofuncs }, /* clip */
|
|
|
+ { 0x001c, &nv04_gr_ofuncs, nv01_gr_prim_omthds }, /* line */
|
|
|
+ { 0x001d, &nv04_gr_ofuncs, nv01_gr_prim_omthds }, /* tri */
|
|
|
+ { 0x001e, &nv04_gr_ofuncs, nv01_gr_prim_omthds }, /* rect */
|
|
|
+ { 0x001f, &nv04_gr_ofuncs, nv01_gr_blit_omthds },
|
|
|
+ { 0x0021, &nv04_gr_ofuncs, nv01_gr_ifc_omthds },
|
|
|
+ { 0x0030, &nv04_gr_ofuncs }, /* null */
|
|
|
+ { 0x0036, &nv04_gr_ofuncs, nv03_gr_sifc_omthds },
|
|
|
+ { 0x0037, &nv04_gr_ofuncs, nv03_gr_sifm_omthds },
|
|
|
+ { 0x0038, &nv04_gr_ofuncs }, /* dvd subpicture */
|
|
|
+ { 0x0039, &nv04_gr_ofuncs }, /* m2mf */
|
|
|
+ { 0x0042, &nv04_gr_ofuncs }, /* surf2d */
|
|
|
+ { 0x0043, &nv04_gr_ofuncs }, /* rop */
|
|
|
+ { 0x0044, &nv04_gr_ofuncs }, /* pattern */
|
|
|
+ { 0x0048, &nv04_gr_ofuncs, nv03_gr_ttri_omthds },
|
|
|
+ { 0x004a, &nv04_gr_ofuncs, nv04_gr_gdi_omthds },
|
|
|
+ { 0x004b, &nv04_gr_ofuncs, nv03_gr_gdi_omthds },
|
|
|
+ { 0x0052, &nv04_gr_ofuncs }, /* swzsurf */
|
|
|
+ { 0x0053, &nv04_gr_ofuncs, nv04_gr_surf3d_omthds },
|
|
|
+ { 0x0054, &nv04_gr_ofuncs }, /* ttri */
|
|
|
+ { 0x0055, &nv04_gr_ofuncs }, /* mtri */
|
|
|
+ { 0x0057, &nv04_gr_ofuncs }, /* chroma */
|
|
|
+ { 0x0058, &nv04_gr_ofuncs }, /* surf_dst */
|
|
|
+ { 0x0059, &nv04_gr_ofuncs }, /* surf_src */
|
|
|
+ { 0x005a, &nv04_gr_ofuncs }, /* surf_color */
|
|
|
+ { 0x005b, &nv04_gr_ofuncs }, /* surf_zeta */
|
|
|
+ { 0x005c, &nv04_gr_ofuncs, nv04_gr_prim_omthds }, /* line */
|
|
|
+ { 0x005d, &nv04_gr_ofuncs, nv04_gr_prim_omthds }, /* tri */
|
|
|
+ { 0x005e, &nv04_gr_ofuncs, nv04_gr_prim_omthds }, /* rect */
|
|
|
+ { 0x005f, &nv04_gr_ofuncs, nv04_gr_blit_omthds },
|
|
|
+ { 0x0060, &nv04_gr_ofuncs, nv04_gr_iifc_omthds },
|
|
|
+ { 0x0061, &nv04_gr_ofuncs, nv04_gr_ifc_omthds },
|
|
|
+ { 0x0064, &nv04_gr_ofuncs }, /* iifc (nv05) */
|
|
|
+ { 0x0065, &nv04_gr_ofuncs }, /* ifc (nv05) */
|
|
|
+ { 0x0066, &nv04_gr_ofuncs }, /* sifc (nv05) */
|
|
|
+ { 0x0072, &nv04_gr_ofuncs }, /* beta4 */
|
|
|
+ { 0x0076, &nv04_gr_ofuncs, nv04_gr_sifc_omthds },
|
|
|
+ { 0x0077, &nv04_gr_ofuncs, nv04_gr_sifm_omthds },
|
|
|
{},
|
|
|
};
|
|
|
|
|
@@ -1037,10 +1037,10 @@ nv04_graph_sclass[] = {
|
|
|
* PGRAPH context
|
|
|
******************************************************************************/
|
|
|
|
|
|
-static struct nv04_graph_chan *
|
|
|
-nv04_graph_channel(struct nv04_graph_priv *priv)
|
|
|
+static struct nv04_gr_chan *
|
|
|
+nv04_gr_channel(struct nv04_gr_priv *priv)
|
|
|
{
|
|
|
- struct nv04_graph_chan *chan = NULL;
|
|
|
+ struct nv04_gr_chan *chan = NULL;
|
|
|
if (nv_rd32(priv, NV04_PGRAPH_CTX_CONTROL) & 0x00010000) {
|
|
|
int chid = nv_rd32(priv, NV04_PGRAPH_CTX_USER) >> 24;
|
|
|
if (chid < ARRAY_SIZE(priv->chan))
|
|
@@ -1050,13 +1050,13 @@ nv04_graph_channel(struct nv04_graph_priv *priv)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_load_context(struct nv04_graph_chan *chan, int chid)
|
|
|
+nv04_gr_load_context(struct nv04_gr_chan *chan, int chid)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = nv04_graph_priv(chan);
|
|
|
+ struct nv04_gr_priv *priv = nv04_gr_priv(chan);
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(nv04_graph_ctx_regs); i++)
|
|
|
- nv_wr32(priv, nv04_graph_ctx_regs[i], chan->nv04[i]);
|
|
|
+ for (i = 0; i < ARRAY_SIZE(nv04_gr_ctx_regs); i++)
|
|
|
+ nv_wr32(priv, nv04_gr_ctx_regs[i], chan->nv04[i]);
|
|
|
|
|
|
nv_wr32(priv, NV04_PGRAPH_CTX_CONTROL, 0x10010100);
|
|
|
nv_mask(priv, NV04_PGRAPH_CTX_USER, 0xff000000, chid << 24);
|
|
@@ -1065,13 +1065,13 @@ nv04_graph_load_context(struct nv04_graph_chan *chan, int chid)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_unload_context(struct nv04_graph_chan *chan)
|
|
|
+nv04_gr_unload_context(struct nv04_gr_chan *chan)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = nv04_graph_priv(chan);
|
|
|
+ struct nv04_gr_priv *priv = nv04_gr_priv(chan);
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(nv04_graph_ctx_regs); i++)
|
|
|
- chan->nv04[i] = nv_rd32(priv, nv04_graph_ctx_regs[i]);
|
|
|
+ for (i = 0; i < ARRAY_SIZE(nv04_gr_ctx_regs); i++)
|
|
|
+ chan->nv04[i] = nv_rd32(priv, nv04_gr_ctx_regs[i]);
|
|
|
|
|
|
nv_wr32(priv, NV04_PGRAPH_CTX_CONTROL, 0x10000000);
|
|
|
nv_mask(priv, NV04_PGRAPH_CTX_USER, 0xff000000, 0x0f000000);
|
|
@@ -1079,36 +1079,36 @@ nv04_graph_unload_context(struct nv04_graph_chan *chan)
|
|
|
}
|
|
|
|
|
|
static void
|
|
|
-nv04_graph_context_switch(struct nv04_graph_priv *priv)
|
|
|
+nv04_gr_context_switch(struct nv04_gr_priv *priv)
|
|
|
{
|
|
|
- struct nv04_graph_chan *prev = NULL;
|
|
|
- struct nv04_graph_chan *next = NULL;
|
|
|
+ struct nv04_gr_chan *prev = NULL;
|
|
|
+ struct nv04_gr_chan *next = NULL;
|
|
|
unsigned long flags;
|
|
|
int chid;
|
|
|
|
|
|
spin_lock_irqsave(&priv->lock, flags);
|
|
|
- nv04_graph_idle(priv);
|
|
|
+ nv04_gr_idle(priv);
|
|
|
|
|
|
/* If previous context is valid, we need to save it */
|
|
|
- prev = nv04_graph_channel(priv);
|
|
|
+ prev = nv04_gr_channel(priv);
|
|
|
if (prev)
|
|
|
- nv04_graph_unload_context(prev);
|
|
|
+ nv04_gr_unload_context(prev);
|
|
|
|
|
|
/* load context for next channel */
|
|
|
chid = (nv_rd32(priv, NV04_PGRAPH_TRAPPED_ADDR) >> 24) & 0x0f;
|
|
|
next = priv->chan[chid];
|
|
|
if (next)
|
|
|
- nv04_graph_load_context(next, chid);
|
|
|
+ nv04_gr_load_context(next, chid);
|
|
|
|
|
|
spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
}
|
|
|
|
|
|
-static u32 *ctx_reg(struct nv04_graph_chan *chan, u32 reg)
|
|
|
+static u32 *ctx_reg(struct nv04_gr_chan *chan, u32 reg)
|
|
|
{
|
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < ARRAY_SIZE(nv04_graph_ctx_regs); i++) {
|
|
|
- if (nv04_graph_ctx_regs[i] == reg)
|
|
|
+ for (i = 0; i < ARRAY_SIZE(nv04_gr_ctx_regs); i++) {
|
|
|
+ if (nv04_gr_ctx_regs[i] == reg)
|
|
|
return &chan->nv04[i];
|
|
|
}
|
|
|
|
|
@@ -1116,14 +1116,14 @@ static u32 *ctx_reg(struct nv04_graph_chan *chan, u32 reg)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_context_ctor(struct nouveau_object *parent,
|
|
|
+nv04_gr_context_ctor(struct nouveau_object *parent,
|
|
|
struct nouveau_object *engine,
|
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
|
struct nouveau_object **pobject)
|
|
|
{
|
|
|
struct nouveau_fifo_chan *fifo = (void *)parent;
|
|
|
- struct nv04_graph_priv *priv = (void *)engine;
|
|
|
- struct nv04_graph_chan *chan;
|
|
|
+ struct nv04_gr_priv *priv = (void *)engine;
|
|
|
+ struct nv04_gr_chan *chan;
|
|
|
unsigned long flags;
|
|
|
int ret;
|
|
|
|
|
@@ -1150,10 +1150,10 @@ nv04_graph_context_ctor(struct nouveau_object *parent,
|
|
|
}
|
|
|
|
|
|
static void
|
|
|
-nv04_graph_context_dtor(struct nouveau_object *object)
|
|
|
+nv04_gr_context_dtor(struct nouveau_object *object)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)object->engine;
|
|
|
- struct nv04_graph_chan *chan = (void *)object;
|
|
|
+ struct nv04_gr_priv *priv = (void *)object->engine;
|
|
|
+ struct nv04_gr_chan *chan = (void *)object;
|
|
|
unsigned long flags;
|
|
|
|
|
|
spin_lock_irqsave(&priv->lock, flags);
|
|
@@ -1164,16 +1164,16 @@ nv04_graph_context_dtor(struct nouveau_object *object)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_context_fini(struct nouveau_object *object, bool suspend)
|
|
|
+nv04_gr_context_fini(struct nouveau_object *object, bool suspend)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)object->engine;
|
|
|
- struct nv04_graph_chan *chan = (void *)object;
|
|
|
+ struct nv04_gr_priv *priv = (void *)object->engine;
|
|
|
+ struct nv04_gr_chan *chan = (void *)object;
|
|
|
unsigned long flags;
|
|
|
|
|
|
spin_lock_irqsave(&priv->lock, flags);
|
|
|
nv_mask(priv, NV04_PGRAPH_FIFO, 0x00000001, 0x00000000);
|
|
|
- if (nv04_graph_channel(priv) == chan)
|
|
|
- nv04_graph_unload_context(chan);
|
|
|
+ if (nv04_gr_channel(priv) == chan)
|
|
|
+ nv04_gr_unload_context(chan);
|
|
|
nv_mask(priv, NV04_PGRAPH_FIFO, 0x00000001, 0x00000001);
|
|
|
spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
|
@@ -1181,13 +1181,13 @@ nv04_graph_context_fini(struct nouveau_object *object, bool suspend)
|
|
|
}
|
|
|
|
|
|
static struct nouveau_oclass
|
|
|
-nv04_graph_cclass = {
|
|
|
+nv04_gr_cclass = {
|
|
|
.handle = NV_ENGCTX(GR, 0x04),
|
|
|
.ofuncs = &(struct nouveau_ofuncs) {
|
|
|
- .ctor = nv04_graph_context_ctor,
|
|
|
- .dtor = nv04_graph_context_dtor,
|
|
|
+ .ctor = nv04_gr_context_ctor,
|
|
|
+ .dtor = nv04_gr_context_dtor,
|
|
|
.init = nouveau_object_init,
|
|
|
- .fini = nv04_graph_context_fini,
|
|
|
+ .fini = nv04_gr_context_fini,
|
|
|
},
|
|
|
};
|
|
|
|
|
@@ -1196,17 +1196,17 @@ nv04_graph_cclass = {
|
|
|
******************************************************************************/
|
|
|
|
|
|
bool
|
|
|
-nv04_graph_idle(void *obj)
|
|
|
+nv04_gr_idle(void *obj)
|
|
|
{
|
|
|
- struct nouveau_graph *graph = nouveau_graph(obj);
|
|
|
+ struct nouveau_gr *gr = nouveau_gr(obj);
|
|
|
u32 mask = 0xffffffff;
|
|
|
|
|
|
if (nv_device(obj)->card_type == NV_40)
|
|
|
mask &= ~NV40_PGRAPH_STATUS_SYNC_STALL;
|
|
|
|
|
|
- if (!nv_wait(graph, NV04_PGRAPH_STATUS, mask, 0)) {
|
|
|
- nv_error(graph, "idle timed out with status 0x%08x\n",
|
|
|
- nv_rd32(graph, NV04_PGRAPH_STATUS));
|
|
|
+ if (!nv_wait(gr, NV04_PGRAPH_STATUS, mask, 0)) {
|
|
|
+ nv_error(gr, "idle timed out with status 0x%08x\n",
|
|
|
+ nv_rd32(gr, NV04_PGRAPH_STATUS));
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1214,13 +1214,13 @@ nv04_graph_idle(void *obj)
|
|
|
}
|
|
|
|
|
|
static const struct nouveau_bitfield
|
|
|
-nv04_graph_intr_name[] = {
|
|
|
+nv04_gr_intr_name[] = {
|
|
|
{ NV_PGRAPH_INTR_NOTIFY, "NOTIFY" },
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
static const struct nouveau_bitfield
|
|
|
-nv04_graph_nstatus[] = {
|
|
|
+nv04_gr_nstatus[] = {
|
|
|
{ NV04_PGRAPH_NSTATUS_STATE_IN_USE, "STATE_IN_USE" },
|
|
|
{ NV04_PGRAPH_NSTATUS_INVALID_STATE, "INVALID_STATE" },
|
|
|
{ NV04_PGRAPH_NSTATUS_BAD_ARGUMENT, "BAD_ARGUMENT" },
|
|
@@ -1229,7 +1229,7 @@ nv04_graph_nstatus[] = {
|
|
|
};
|
|
|
|
|
|
const struct nouveau_bitfield
|
|
|
-nv04_graph_nsource[] = {
|
|
|
+nv04_gr_nsource[] = {
|
|
|
{ NV03_PGRAPH_NSOURCE_NOTIFICATION, "NOTIFICATION" },
|
|
|
{ NV03_PGRAPH_NSOURCE_DATA_ERROR, "DATA_ERROR" },
|
|
|
{ NV03_PGRAPH_NSOURCE_PROTECTION_ERROR, "PROTECTION_ERROR" },
|
|
@@ -1253,10 +1253,10 @@ nv04_graph_nsource[] = {
|
|
|
};
|
|
|
|
|
|
static void
|
|
|
-nv04_graph_intr(struct nouveau_subdev *subdev)
|
|
|
+nv04_gr_intr(struct nouveau_subdev *subdev)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv = (void *)subdev;
|
|
|
- struct nv04_graph_chan *chan = NULL;
|
|
|
+ struct nv04_gr_priv *priv = (void *)subdev;
|
|
|
+ struct nv04_gr_chan *chan = NULL;
|
|
|
struct nouveau_namedb *namedb = NULL;
|
|
|
struct nouveau_handle *handle = NULL;
|
|
|
u32 stat = nv_rd32(priv, NV03_PGRAPH_INTR);
|
|
@@ -1290,7 +1290,7 @@ nv04_graph_intr(struct nouveau_subdev *subdev)
|
|
|
nv_wr32(priv, NV03_PGRAPH_INTR, NV_PGRAPH_INTR_CONTEXT_SWITCH);
|
|
|
stat &= ~NV_PGRAPH_INTR_CONTEXT_SWITCH;
|
|
|
show &= ~NV_PGRAPH_INTR_CONTEXT_SWITCH;
|
|
|
- nv04_graph_context_switch(priv);
|
|
|
+ nv04_gr_context_switch(priv);
|
|
|
}
|
|
|
|
|
|
nv_wr32(priv, NV03_PGRAPH_INTR, stat);
|
|
@@ -1298,11 +1298,11 @@ nv04_graph_intr(struct nouveau_subdev *subdev)
|
|
|
|
|
|
if (show) {
|
|
|
nv_error(priv, "%s", "");
|
|
|
- nouveau_bitfield_print(nv04_graph_intr_name, show);
|
|
|
+ nouveau_bitfield_print(nv04_gr_intr_name, show);
|
|
|
pr_cont(" nsource:");
|
|
|
- nouveau_bitfield_print(nv04_graph_nsource, nsource);
|
|
|
+ nouveau_bitfield_print(nv04_gr_nsource, nsource);
|
|
|
pr_cont(" nstatus:");
|
|
|
- nouveau_bitfield_print(nv04_graph_nstatus, nstatus);
|
|
|
+ nouveau_bitfield_print(nv04_gr_nstatus, nstatus);
|
|
|
pr_cont("\n");
|
|
|
nv_error(priv,
|
|
|
"ch %d [%s] subc %d class 0x%04x mthd 0x%04x data 0x%08x\n",
|
|
@@ -1314,34 +1314,34 @@ nv04_graph_intr(struct nouveau_subdev *subdev)
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
|
|
+nv04_gr_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
|
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
|
struct nouveau_object **pobject)
|
|
|
{
|
|
|
- struct nv04_graph_priv *priv;
|
|
|
+ struct nv04_gr_priv *priv;
|
|
|
int ret;
|
|
|
|
|
|
- ret = nouveau_graph_create(parent, engine, oclass, true, &priv);
|
|
|
+ ret = nouveau_gr_create(parent, engine, oclass, true, &priv);
|
|
|
*pobject = nv_object(priv);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
|
|
|
nv_subdev(priv)->unit = 0x00001000;
|
|
|
- nv_subdev(priv)->intr = nv04_graph_intr;
|
|
|
- nv_engine(priv)->cclass = &nv04_graph_cclass;
|
|
|
- nv_engine(priv)->sclass = nv04_graph_sclass;
|
|
|
+ nv_subdev(priv)->intr = nv04_gr_intr;
|
|
|
+ nv_engine(priv)->cclass = &nv04_gr_cclass;
|
|
|
+ nv_engine(priv)->sclass = nv04_gr_sclass;
|
|
|
spin_lock_init(&priv->lock);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
static int
|
|
|
-nv04_graph_init(struct nouveau_object *object)
|
|
|
+nv04_gr_init(struct nouveau_object *object)
|
|
|
{
|
|
|
struct nouveau_engine *engine = nv_engine(object);
|
|
|
- struct nv04_graph_priv *priv = (void *)engine;
|
|
|
+ struct nv04_gr_priv *priv = (void *)engine;
|
|
|
int ret;
|
|
|
|
|
|
- ret = nouveau_graph_init(&priv->base);
|
|
|
+ ret = nouveau_gr_init(&priv->base);
|
|
|
if (ret)
|
|
|
return ret;
|
|
|
|
|
@@ -1377,12 +1377,12 @@ nv04_graph_init(struct nouveau_object *object)
|
|
|
}
|
|
|
|
|
|
struct nouveau_oclass
|
|
|
-nv04_graph_oclass = {
|
|
|
+nv04_gr_oclass = {
|
|
|
.handle = NV_ENGINE(GR, 0x04),
|
|
|
.ofuncs = &(struct nouveau_ofuncs) {
|
|
|
- .ctor = nv04_graph_ctor,
|
|
|
- .dtor = _nouveau_graph_dtor,
|
|
|
- .init = nv04_graph_init,
|
|
|
- .fini = _nouveau_graph_fini,
|
|
|
+ .ctor = nv04_gr_ctor,
|
|
|
+ .dtor = _nouveau_gr_dtor,
|
|
|
+ .init = nv04_gr_init,
|
|
|
+ .fini = _nouveau_gr_fini,
|
|
|
},
|
|
|
};
|