mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 19:53:59 +08:00
drm/nv40: fix tiling-related setup for a number of chipsets
Due to the default case handling the older chipsets, a bunch of the newer ones ended up having the wrong tiling regs used. This commit switches the default case to handle the newest chipsets. This also makes nv4e touch the "extra" tiling regs. "nv" doesn't touch them for C51 but traces of the NVIDIA binary driver show it being done there. I couldn't find NV41/NV45 traces to confirm the behaviour there, but an educated guess was taken at each of them. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
0d9b6193bc
commit
1dc32671d8
@ -211,30 +211,35 @@ nv40_graph_set_tile_region(struct drm_device *dev, int i)
|
||||
struct nouveau_tile_reg *tile = &dev_priv->tile.reg[i];
|
||||
|
||||
switch (dev_priv->chipset) {
|
||||
case 0x44:
|
||||
case 0x4a:
|
||||
case 0x40:
|
||||
case 0x41: /* guess */
|
||||
case 0x42:
|
||||
case 0x43:
|
||||
case 0x45: /* guess */
|
||||
case 0x4e:
|
||||
nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
|
||||
break;
|
||||
|
||||
case 0x46:
|
||||
case 0x47:
|
||||
case 0x49:
|
||||
case 0x4b:
|
||||
nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr);
|
||||
nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
|
||||
nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
|
||||
nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
|
||||
break;
|
||||
|
||||
default:
|
||||
case 0x44:
|
||||
case 0x4a:
|
||||
nv_wr32(dev, NV20_PGRAPH_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV20_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV20_PGRAPH_TILE(i), tile->addr);
|
||||
break;
|
||||
case 0x46:
|
||||
case 0x47:
|
||||
case 0x49:
|
||||
case 0x4b:
|
||||
case 0x4c:
|
||||
case 0x67:
|
||||
default:
|
||||
nv_wr32(dev, NV47_PGRAPH_TSIZE(i), tile->pitch);
|
||||
nv_wr32(dev, NV47_PGRAPH_TLIMIT(i), tile->limit);
|
||||
nv_wr32(dev, NV47_PGRAPH_TILE(i), tile->addr);
|
||||
nv_wr32(dev, NV40_PGRAPH_TSIZE1(i), tile->pitch);
|
||||
nv_wr32(dev, NV40_PGRAPH_TLIMIT1(i), tile->limit);
|
||||
nv_wr32(dev, NV40_PGRAPH_TILE1(i), tile->addr);
|
||||
@ -396,17 +401,20 @@ nv40_graph_init(struct drm_device *dev)
|
||||
break;
|
||||
default:
|
||||
switch (dev_priv->chipset) {
|
||||
case 0x46:
|
||||
case 0x47:
|
||||
case 0x49:
|
||||
case 0x4b:
|
||||
nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0));
|
||||
nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1));
|
||||
break;
|
||||
default:
|
||||
case 0x41:
|
||||
case 0x42:
|
||||
case 0x43:
|
||||
case 0x45:
|
||||
case 0x4e:
|
||||
case 0x44:
|
||||
case 0x4a:
|
||||
nv_wr32(dev, 0x4009F0, nv_rd32(dev, NV04_PFB_CFG0));
|
||||
nv_wr32(dev, 0x4009F4, nv_rd32(dev, NV04_PFB_CFG1));
|
||||
break;
|
||||
default:
|
||||
nv_wr32(dev, 0x400DF0, nv_rd32(dev, NV04_PFB_CFG0));
|
||||
nv_wr32(dev, 0x400DF4, nv_rd32(dev, NV04_PFB_CFG1));
|
||||
break;
|
||||
}
|
||||
nv_wr32(dev, 0x4069F0, nv_rd32(dev, NV04_PFB_CFG0));
|
||||
nv_wr32(dev, 0x4069F4, nv_rd32(dev, NV04_PFB_CFG1));
|
||||
|
Loading…
Reference in New Issue
Block a user