Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345384
b: refs/heads/master
c: fd3a522
h: refs/heads/master
v: v3
  • Loading branch information
Ben Skeggs committed Nov 28, 2012
1 parent 9d0ad33 commit e1e793b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fafa0cb37eaa0632bc4c29fc4e02e18d7a73bebf
refs/heads/master: fd3a5225864cfa51633c0b4eff145b92e8b4ba1c
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/include/subdev/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ struct nouveau_fb {
} type;
u64 stolen;
u64 size;

int ranks;
int parts;

int (*init)(struct nouveau_fb *);
int (*get)(struct nouveau_fb *, u64 size, u32 align,
Expand Down
24 changes: 9 additions & 15 deletions trunk/drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ nv20_fb_vram_init(struct nouveau_fb *pfb)
case 0x00000200: pfb->ram.type = NV_MEM_TYPE_GDDR3; break;
case 0x00000300: pfb->ram.type = NV_MEM_TYPE_GDDR2; break;
}
pfb->ram.size = nv_rd32(pfb, 0x10020c) & 0xff000000;
pfb->ram.size = (nv_rd32(pfb, 0x10020c) & 0xff000000);
pfb->ram.parts = (nv_rd32(pfb, 0x100200) & 0x00000003) + 1;

return nv_rd32(pfb, 0x100320);
}
Expand All @@ -63,20 +64,13 @@ static void
nv20_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile)
{
int bpp = (flags & 2) ? 32 : 16;

/* Allocate some of the on-die tag memory, used to store Z
* compression meta-data (most likely just a bitmap determining
* if a given tile is compressed or not).
*/
size /= 256;

if (!nouveau_mm_head(&pfb->tags, 1, size, size, 1, &tile->tag)) {
/* Enable Z compression */
tile->zcomp = tile->tag->offset;
tile->zcomp |= 0x80000000;
if (bpp != 16)
tile->zcomp |= 0x04000000;
u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram.parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 1, tags, tags, 1, &tile->tag)) {
if (!(flags & 2)) tile->zcomp = 0x00000000; /* Z16 */
else tile->zcomp = 0x04000000; /* Z24S8 */
tile->zcomp |= tile->tag->offset;
tile->zcomp |= 0x80000000; /* enable */
#ifdef __BIG_ENDIAN
tile->zcomp |= 0x08000000;
#endif
Expand Down
21 changes: 6 additions & 15 deletions trunk/drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,12 @@ static void
nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
struct nouveau_fb_tile *tile)
{
int bpp = (flags & 2) ? 32 : 16;

/* Allocate some of the on-die tag memory, used to store Z
* compression meta-data (most likely just a bitmap determining
* if a given tile is compressed or not).
*/
size /= 256;

if (!nouveau_mm_head(&pfb->tags, 1, size, size, 1, &tile->tag)) {
/* Enable Z compression */
tile->zcomp = tile->tag->offset;
if (bpp == 16)
tile->zcomp |= 0x00100000;
else
tile->zcomp |= 0x00200000;
u32 tiles = DIV_ROUND_UP(size, 0x40);
u32 tags = round_up(tiles / pfb->ram.parts, 0x40);
if (!nouveau_mm_head(&pfb->tags, 1, tags, tags, 1, &tile->tag)) {
if (!(flags & 2)) tile->zcomp = 0x00100000; /* Z16 */
else tile->zcomp = 0x00200000; /* Z24S8 */
tile->zcomp |= tile->tag->offset;
#ifdef __BIG_ENDIAN
tile->zcomp |= 0x01000000;
#endif
Expand Down

0 comments on commit e1e793b

Please sign in to comment.