drm/nv30-nv40/fb: call zcomp setup hook from tiling setup
authorBen Skeggs <bskeggs@redhat.com>
Wed, 10 Oct 2012 02:52:00 +0000 (12:52 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 28 Nov 2012 23:56:31 +0000 (09:56 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/include/subdev/fb.h
drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
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/nv47.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv49.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv4e.c

index 9f3e82976ec726412dbe05a3b491455fd9831006..863709371861f4e25263bd52523cfa129488739b 100644 (file)
@@ -148,7 +148,6 @@ void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
 int  nv30_fb_init(struct nouveau_object *);
 void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
                       u32 pitch, u32 flags, struct nouveau_fb_tile *);
-void nv30_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
 
 int  nv41_fb_vram_init(struct nouveau_fb *);
 int  nv41_fb_init(struct nouveau_object *);
index c4ab975ac83f2104112c0e75db6c3e1481aee468..b002902966801cc28d63233ab44f835c33ff169e 100644 (file)
@@ -35,8 +35,13 @@ nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
                  u32 flags, struct nouveau_fb_tile *tile)
 {
        /* for performance, select alternate bank offset for zeta */
-       if (!(flags & 4)) tile->addr = (0 << 4);
-       else              tile->addr = (1 << 4);
+       if (!(flags & 4)) {
+               tile->addr = (0 << 4);
+       } else {
+               if (pfb->tile.comp) /* z compression */
+                       pfb->tile.comp(pfb, i, size, flags, tile);
+               tile->addr = (1 << 4);
+       }
 
        tile->addr |= 0x00000001; /* enable */
        tile->addr |= addr;
@@ -51,14 +56,6 @@ nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
        tile->zcomp = 0x00000000;
 }
 
-void
-nv30_fb_tile_fini(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
-{
-       tile->addr  = 0;
-       tile->limit = 0;
-       tile->pitch = 0;
-}
-
 static int
 calc_bias(struct nv30_fb_priv *priv, int k, int i, int j)
 {
@@ -135,7 +132,7 @@ nv30_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.tile.regions = 8;
        priv->base.tile.init = nv30_fb_tile_init;
        priv->base.tile.comp = nv30_fb_tile_comp;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv20_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index e87086af2311c2c132d480d25716e438f21fc06c..60d1fcb585fe25a00f4940d68f907a7babcbc2d9 100644 (file)
@@ -55,7 +55,7 @@ nv35_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.tile.regions = 8;
        priv->base.tile.init = nv30_fb_tile_init;
        priv->base.tile.comp = nv35_fb_tile_comp;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv20_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index e942e5b9d66d3aa5418eceb1a34b3b400d9ed542..37c5e4c2c3f7854cbb469a2ba96a23f638493e75 100644 (file)
@@ -84,7 +84,7 @@ nv40_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        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.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv20_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index 6ddf82ab038aec2fc00b5d37f4be1ef6dfec830b..cc2cff65fcc9afb31e84f82087e4e30142932ee9 100644 (file)
@@ -86,7 +86,7 @@ nv41_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv41_fb_vram_init;
        priv->base.tile.regions = 12;
        priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv41_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index 46d6518c1a80ebc7dd0f669d30cc04a335987f34..ae89b5006f7a4ac933c41e0e7b0d5a5c218575b7 100644 (file)
@@ -96,7 +96,7 @@ nv44_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv44_fb_vram_init;
        priv->base.tile.regions = 12;
        priv->base.tile.init = nv44_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index b8fcbd6f80b4a6572cd56eba298014daa5f826f0..589b93ea29948bb8583840c39d5738b42f5d6d4b 100644 (file)
@@ -61,7 +61,7 @@ nv46_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv44_fb_vram_init;
        priv->base.tile.regions = 15;
        priv->base.tile.init = nv46_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index bfe1962df50bcad024dd3fb8e3d9046d1f4ae4f6..a2ca3c8e4007d054d33c3ecf85ef44b1fc1c2f88 100644 (file)
@@ -47,7 +47,7 @@ nv47_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv41_fb_vram_init;
        priv->base.tile.regions = 15;
        priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv41_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }
index 3d64195b737fbf2668b1a2ece857d017ea9ce66b..aaec1e3e1d98a701d39ae6d543bf253eef8ebecd 100644 (file)
@@ -63,7 +63,7 @@ nv49_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv49_fb_vram_init;
        priv->base.tile.regions = 15;
        priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv41_fb_tile_prog;
 
        return nouveau_fb_preinit(&priv->base);
index 9b79994159f4e3508aac0973e0d34444dfa35d0f..797fd558170be614dfab6874ed6802ed5cfdd2f0 100644 (file)
@@ -55,7 +55,7 @@ nv4e_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        priv->base.ram.init = nv4e_fb_vram_init;
        priv->base.tile.regions = 12;
        priv->base.tile.init = nv46_fb_tile_init;
-       priv->base.tile.fini = nv30_fb_tile_fini;
+       priv->base.tile.fini = nv20_fb_tile_fini;
        priv->base.tile.prog = nv44_fb_tile_prog;
        return nouveau_fb_preinit(&priv->base);
 }