3 #include "nouveau_drv.h"
4 #include "nouveau_drm.h"
7 nv40_fb_init(drm_device_t *dev)
9 drm_nouveau_private_t *dev_priv = dev->dev_private;
10 uint32_t fb_bar_size, tmp;
14 switch (dev_priv->chipset) {
17 tmp = NV_READ(NV10_PFB_CLOSE_PAGE2);
18 NV_WRITE(NV10_PFB_CLOSE_PAGE2, tmp & ~(1<<15));
19 num_tiles = NV10_PFB_TILE__SIZE;
25 case 0x4c: /* C51 (G7X version) */
26 num_tiles = NV40_PFB_TILE__SIZE_1;
29 num_tiles = NV40_PFB_TILE__SIZE_0;
33 fb_bar_size = drm_get_resource_len(dev, 0) - 1;
34 switch (dev_priv->chipset) {
36 for (i=0; i<num_tiles; i++) {
37 NV_WRITE(NV10_PFB_TILE(i), 0);
38 NV_WRITE(NV10_PFB_TLIMIT(i), fb_bar_size);
42 for (i=0; i<num_tiles; i++) {
43 NV_WRITE(NV40_PFB_TILE(i), 0);
44 NV_WRITE(NV40_PFB_TLIMIT(i), fb_bar_size);
53 nv40_fb_takedown(drm_device_t *dev)