]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/nouveau/fifo: use defines instead of hardcoded class ids
authorBen Skeggs <bskeggs@redhat.com>
Sun, 19 Aug 2012 06:03:00 +0000 (16:03 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 3 Oct 2012 03:13:06 +0000 (13:13 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv10.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv17.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/nouveau_chan.c

index cc49284be181ed6c941803d369ffe1a44488af01..ea76e3e8c9c2db45a39c34f230289d556c24da24 100644 (file)
@@ -247,7 +247,7 @@ nv04_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nv04_fifo_sclass[] = {
-       { 0x006b, &nv04_fifo_ofuncs },
+       { NV03_CHANNEL_DMA_CLASS, &nv04_fifo_ofuncs },
        {}
 };
 
index c4c78d50b39650ef0d40c452cf7c32fbf7dd65fd..4ba75422b89dd406be7bdd3e1b8f4eb0c638e939 100644 (file)
@@ -106,7 +106,7 @@ nv10_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nv10_fifo_sclass[] = {
-       { 0x006e, &nv10_fifo_ofuncs },
+       { NV10_CHANNEL_DMA_CLASS, &nv10_fifo_ofuncs },
        {}
 };
 
index 1733765e8bf2fc5f2c3cdb0e594579398754616b..b96e6b0ae2b18088640ef0dbb09ee4bd827d632c 100644 (file)
@@ -113,7 +113,7 @@ nv17_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nv17_fifo_sclass[] = {
-       { 0x176e, &nv17_fifo_ofuncs },
+       { NV17_CHANNEL_DMA_CLASS, &nv17_fifo_ofuncs },
        {}
 };
 
index aef8ca106ac0f90d9445ec2e627b743d5128f2e5..559c3b4e1b867cf691384657f0eb30839f39edbb 100644 (file)
@@ -232,7 +232,7 @@ nv40_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nv40_fifo_sclass[] = {
-       { 0x406e, &nv40_fifo_ofuncs },
+       { NV40_CHANNEL_DMA_CLASS, &nv40_fifo_ofuncs },
        {}
 };
 
index 44a0dce07e19b48f5c0cc1d9ed0af162611aa37c..536e7634a00d26fdb4145479164653cd71961307 100644 (file)
@@ -346,8 +346,8 @@ nv50_fifo_ofuncs_ind = {
 
 static struct nouveau_oclass
 nv50_fifo_sclass[] = {
-       { 0x506e, &nv50_fifo_ofuncs_dma },
-       { 0x506f, &nv50_fifo_ofuncs_ind },
+       { NV50_CHANNEL_DMA_CLASS, &nv50_fifo_ofuncs_dma },
+       { NV50_CHANNEL_IND_CLASS, &nv50_fifo_ofuncs_ind },
        {}
 };
 
index 88ca9e89a87ac1186bfc8a91a62a5b6df51e8e55..55620fbd5c21d23c873f2c0f00117e88e0db4dce 100644 (file)
@@ -310,8 +310,8 @@ nv84_fifo_ofuncs_ind = {
 
 static struct nouveau_oclass
 nv84_fifo_sclass[] = {
-       { 0x826e, &nv84_fifo_ofuncs_dma },
-       { 0x826f, &nv84_fifo_ofuncs_ind },
+       { NV84_CHANNEL_DMA_CLASS, &nv84_fifo_ofuncs_dma },
+       { NV84_CHANNEL_IND_CLASS, &nv84_fifo_ofuncs_ind },
        {}
 };
 
index d10dca237ca35dd2bbe0a61911b428e7a56e495e..dda0a442453e36ee6eb61d46b445cb479a25a233 100644 (file)
@@ -258,7 +258,7 @@ nvc0_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nvc0_fifo_sclass[] = {
-       { 0x906f, &nvc0_fifo_ofuncs },
+       { NVC0_CHANNEL_IND_CLASS, &nvc0_fifo_ofuncs },
        {}
 };
 
index 042afadbdf2ec2038d9be06ebffd30c5809625a8..f4803239c5f90c8c2da821b3abbd7f5bb0373a27 100644 (file)
@@ -303,7 +303,7 @@ nve0_fifo_ofuncs = {
 
 static struct nouveau_oclass
 nve0_fifo_sclass[] = {
-       { 0xa06f, &nve0_fifo_ofuncs },
+       { NVE0_CHANNEL_IND_CLASS, &nve0_fifo_ofuncs },
        {}
 };
 
index e6451847df4a042f873e1676a1c87e37b999ff59..55dc51c1b92eb33399c3c793d3c4e10d0ac5f9aa 100644 (file)
@@ -187,7 +187,11 @@ nouveau_channel_ind(struct nouveau_drm *drm, struct nouveau_cli *cli,
                    u32 parent, u32 handle, u32 engine,
                    struct nouveau_channel **pchan)
 {
-       static const u16 oclasses[] = { 0xa06f, 0x906f, 0x826f, 0x506f, 0 };
+       static const u16 oclasses[] = { NVE0_CHANNEL_IND_CLASS,
+                                       NVC0_CHANNEL_IND_CLASS,
+                                       NV84_CHANNEL_IND_CLASS,
+                                       NV50_CHANNEL_IND_CLASS,
+                                       0 };
        const u16 *oclass = oclasses;
        struct nve0_channel_ind_class args;
        struct nouveau_channel *chan;
@@ -221,7 +225,11 @@ static int
 nouveau_channel_dma(struct nouveau_drm *drm, struct nouveau_cli *cli,
                    u32 parent, u32 handle, struct nouveau_channel **pchan)
 {
-       static const u16 oclasses[] = { 0x406e, 0x176e, 0x006e, 0x006b, 0 };
+       static const u16 oclasses[] = { NV40_CHANNEL_DMA_CLASS,
+                                       NV17_CHANNEL_DMA_CLASS,
+                                       NV10_CHANNEL_DMA_CLASS,
+                                       NV03_CHANNEL_DMA_CLASS,
+                                       0 };
        const u16 *oclass = oclasses;
        struct nv03_channel_dma_class args;
        struct nouveau_channel *chan;