drm/nv40/fb: start bashing zcomp registers on relevant chipsets
authorBen Skeggs <bskeggs@redhat.com>
Wed, 10 Oct 2012 00:57:49 +0000 (10:57 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 28 Nov 2012 23:56:29 +0000 (09:56 +1000)
Always bashing "disabled" for now, actual compressing coming up...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv41.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv44.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv46.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv4e.c

index 500998cee0ed4035ea5db697fb37cb32ea573688..e8d0d73db51cc9ebe2c846ae88fc53e7d230afcd 100644 (file)
@@ -145,9 +145,11 @@ void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
 void nv30_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
 
 int  nv41_fb_init(struct nouveau_object *);
-int  nv44_fb_init(struct nouveau_object *);
 void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
 
+int  nv44_fb_init(struct nouveau_object *);
+void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
+
 void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
                       u32 pitch, u32 flags, struct nouveau_fb_tile *);
 
index 3652d2b6ce6e60c5f96ce601f6d4171a7d1c53eb..425bb1d7ab2b0661047979889c6d663b9ac5cbf2 100644 (file)
@@ -30,6 +30,13 @@ struct nv40_fb_priv {
        struct nouveau_fb base;
 };
 
+static void
+nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
+                 struct nouveau_fb_tile *tile)
+{
+       tile->zcomp = 0x00000000;
+}
+
 static int
 nv40_fb_init(struct nouveau_object *object)
 {
@@ -72,8 +79,9 @@ nv40_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.memtype_valid = nv04_fb_memtype_valid;
        priv->base.tile.regions = 8;
        priv->base.tile.init = nv30_fb_tile_init;
+       priv->base.tile.comp = nv40_fb_tile_comp;
        priv->base.tile.fini = nv30_fb_tile_fini;
-       priv->base.tile.prog = nv10_fb_tile_prog;
+       priv->base.tile.prog = nv20_fb_tile_prog;
        return nouveau_fb_created(&priv->base);
 }
 
index b4a3243631e3c7232f174a164351d343b23f9cbd..a6a10665cf385262808dfd113eba69d360f245ee 100644 (file)
@@ -36,9 +36,9 @@ nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
        nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit);
        nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch);
        nv_wr32(pfb, 0x100600 + (i * 0x10), tile->addr);
+       nv_wr32(pfb, 0x100700 + (i * 0x04), tile->zcomp);
 }
 
-
 int
 nv41_fb_init(struct nouveau_object *object)
 {
index d0804fdb9dbbf33d565537b053733d1c703a1889..c62a07781fe9f8fc8bc7bc5b1c7ead7dd1246502 100644 (file)
@@ -40,6 +40,14 @@ nv44_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
        tile->pitch = pitch;
 }
 
+void
+nv44_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
+{
+       nv_wr32(pfb, 0x100604 + (i * 0x10), tile->limit);
+       nv_wr32(pfb, 0x100608 + (i * 0x10), tile->pitch);
+       nv_wr32(pfb, 0x100600 + (i * 0x10), tile->addr);
+}
+
 int
 nv44_fb_init(struct nouveau_object *object)
 {
@@ -84,7 +92,7 @@ nv44_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.tile.regions = 12;
        priv->base.tile.init = nv44_fb_tile_init;
        priv->base.tile.fini = nv30_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
+       priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_created(&priv->base);
 }
 
index 005f8a3df830889b16327fe8cd345eb05225c68c..57b6ff28db01e784a5807db6741347df7475eee8 100644 (file)
@@ -73,7 +73,7 @@ nv46_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.tile.regions = 15;
        priv->base.tile.init = nv46_fb_tile_init;
        priv->base.tile.fini = nv30_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
+       priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_created(&priv->base);
 }
 
index f839ba02e5325687d0d60b875753659ee3ead0c1..fab8b19df4ee5e4d5171d8a800eb9bb70b7abcdd 100644 (file)
@@ -50,7 +50,7 @@ nv4e_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.tile.regions = 12;
        priv->base.tile.init = nv46_fb_tile_init;
        priv->base.tile.fini = nv30_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
+       priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_created(&priv->base);
 }