aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv10_graph.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-24 10:14:41 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 00:11:20 -0500
commita5cf68b04b2b8ea716cf6fd8499c1c54d05fdf5e (patch)
tree87f6007ef18c8d488f590523b90bcd8766537778 /drivers/gpu/drm/nouveau/nv10_graph.c
parente419cf0954901bb3a987f8b76cbc9654ca06121c (diff)
drm/nouveau: Rework tile region handling.
The point is to share more code between the PFB/PGRAPH tile region hooks, and give the hardware specific functions a chance to allocate per-region resources. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv10_graph.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv10_graph.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nv10_graph.c b/drivers/gpu/drm/nouveau/nv10_graph.c
index 3fbb49dfc09c..1cd141edca04 100644
--- a/drivers/gpu/drm/nouveau/nv10_graph.c
+++ b/drivers/gpu/drm/nouveau/nv10_graph.c
@@ -899,17 +899,14 @@ void nv10_graph_destroy_context(struct nouveau_channel *chan)
899} 899}
900 900
901void 901void
902nv10_graph_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, 902nv10_graph_set_tile_region(struct drm_device *dev, int i)
903 uint32_t size, uint32_t pitch)
904{ 903{
905 uint32_t limit = max(1u, addr + size) - 1; 904 struct drm_nouveau_private *dev_priv = dev->dev_private;
906 905 struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
907 if (pitch)
908 addr |= 1 << 31;
909 906
910 nv_wr32(dev, NV10_PGRAPH_TLIMIT(i), limit); 907 nv_wr32(dev, NV10_PGRAPH_TLIMIT(i), tile->limit);
911 nv_wr32(dev, NV10_PGRAPH_TSIZE(i), pitch); 908 nv_wr32(dev, NV10_PGRAPH_TSIZE(i), tile->pitch);
912 nv_wr32(dev, NV10_PGRAPH_TILE(i), addr); 909 nv_wr32(dev, NV10_PGRAPH_TILE(i), tile->addr);
913} 910}
914 911
915int nv10_graph_init(struct drm_device *dev) 912int nv10_graph_init(struct drm_device *dev)
@@ -949,7 +946,7 @@ int nv10_graph_init(struct drm_device *dev)
949 946
950 /* Turn all the tiling regions off. */ 947 /* Turn all the tiling regions off. */
951 for (i = 0; i < NV10_PFB_TILE__SIZE; i++) 948 for (i = 0; i < NV10_PFB_TILE__SIZE; i++)
952 nv10_graph_set_region_tiling(dev, i, 0, 0, 0); 949 nv10_graph_set_tile_region(dev, i);
953 950
954 nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(0), 0x00000000); 951 nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(0), 0x00000000);
955 nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(1), 0x00000000); 952 nv_wr32(dev, NV10_PGRAPH_CTX_SWITCH(1), 0x00000000);