1#include "drmP.h" 2#include "drm.h" 3#include "nouveau_drv.h" 4#include "nouveau_drm.h" 5 6void 7nv10_fb_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, 8 uint32_t size, uint32_t pitch) 9{ 10 struct drm_nouveau_private *dev_priv = dev->dev_private; 11 uint32_t limit = max(1u, addr + size) - 1; 12 13 if (pitch) { 14 if (dev_priv->card_type >= NV_20) 15 addr |= 1; 16 else 17 addr |= 1 << 31; 18 } 19 20 nv_wr32(dev, NV10_PFB_TLIMIT(i), limit); 21 nv_wr32(dev, NV10_PFB_TSIZE(i), pitch); 22 nv_wr32(dev, NV10_PFB_TILE(i), addr); 23} 24 25int 26nv10_fb_init(struct drm_device *dev) 27{ 28 struct drm_nouveau_private *dev_priv = dev->dev_private; 29 struct nouveau_fb_engine *pfb = &dev_priv->engine.fb; 30 int i; 31 32 pfb->num_tiles = NV10_PFB_TILE__SIZE; 33 34 /* Turn all the tiling regions off. */ 35 for (i = 0; i < pfb->num_tiles; i++) 36 pfb->set_region_tiling(dev, i, 0, 0, 0); 37 38 return 0; 39} 40 41void 42nv10_fb_takedown(struct drm_device *dev) 43{ 44} 45