diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv20_graph.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv20_graph.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nv20_graph.c b/drivers/gpu/drm/nouveau/nv20_graph.c index 51b9dd12949d..a71871b91c69 100644 --- a/drivers/gpu/drm/nouveau/nv20_graph.c +++ b/drivers/gpu/drm/nouveau/nv20_graph.c | |||
@@ -511,24 +511,21 @@ nv20_graph_rdi(struct drm_device *dev) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | void | 513 | void |
514 | nv20_graph_set_region_tiling(struct drm_device *dev, int i, uint32_t addr, | 514 | nv20_graph_set_tile_region(struct drm_device *dev, int i) |
515 | uint32_t size, uint32_t pitch) | ||
516 | { | 515 | { |
517 | uint32_t limit = max(1u, addr + size) - 1; | 516 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
518 | 517 | struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i]; | |
519 | if (pitch) | ||
520 | addr |= 1; | ||
521 | 518 | ||
522 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), limit); | 519 | nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit); |
523 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), pitch); | 520 | nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch); |
524 | nv_wr32(dev, NV20_PGRAPH_TILE(i), addr); | 521 | nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr); |
525 | 522 | ||
526 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0030 + 4 * i); | 523 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0030 + 4 * i); |
527 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, limit); | 524 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->limit); |
528 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0050 + 4 * i); | 525 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0050 + 4 * i); |
529 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, pitch); | 526 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->pitch); |
530 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0010 + 4 * i); | 527 | nv_wr32(dev, NV10_PGRAPH_RDI_INDEX, 0x00EA0010 + 4 * i); |
531 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, addr); | 528 | nv_wr32(dev, NV10_PGRAPH_RDI_DATA, tile->addr); |
532 | } | 529 | } |
533 | 530 | ||
534 | int | 531 | int |
@@ -612,7 +609,7 @@ nv20_graph_init(struct drm_device *dev) | |||
612 | 609 | ||
613 | /* Turn all the tiling regions off. */ | 610 | /* Turn all the tiling regions off. */ |
614 | for (i = 0; i < NV10_PFB_TILE__SIZE; i++) | 611 | for (i = 0; i < NV10_PFB_TILE__SIZE; i++) |
615 | nv20_graph_set_region_tiling(dev, i, 0, 0, 0); | 612 | nv20_graph_set_tile_region(dev, i); |
616 | 613 | ||
617 | for (i = 0; i < 8; i++) { | 614 | for (i = 0; i < 8; i++) { |
618 | nv_wr32(dev, 0x400980 + i * 4, nv_rd32(dev, 0x100300 + i * 4)); | 615 | nv_wr32(dev, 0x400980 + i * 4, nv_rd32(dev, 0x100300 + i * 4)); |
@@ -751,7 +748,7 @@ nv30_graph_init(struct drm_device *dev) | |||
751 | 748 | ||
752 | /* Turn all the tiling regions off. */ | 749 | /* Turn all the tiling regions off. */ |
753 | for (i = 0; i < NV10_PFB_TILE__SIZE; i++) | 750 | for (i = 0; i < NV10_PFB_TILE__SIZE; i++) |
754 | nv20_graph_set_region_tiling(dev, i, 0, 0, 0); | 751 | nv20_graph_set_tile_region(dev, i); |
755 | 752 | ||
756 | nv_wr32(dev, NV10_PGRAPH_CTX_CONTROL, 0x10000100); | 753 | nv_wr32(dev, NV10_PGRAPH_CTX_CONTROL, 0x10000100); |
757 | nv_wr32(dev, NV10_PGRAPH_STATE , 0xFFFFFFFF); | 754 | nv_wr32(dev, NV10_PGRAPH_STATE , 0xFFFFFFFF); |