aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvc0_graph.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-11-11 11:17:43 +0000
committerDave Airlie <airlied@redhat.com>2011-11-11 11:17:43 +0000
commit0007fa2416f350621709880357d2fc50c5233984 (patch)
treea83f90df4b1a8dda7dc1c666071fea8f78b23df7 /drivers/gpu/drm/nouveau/nvc0_graph.c
parenta6778e9e7fb57603f15344ceb30098a3f6b7caf4 (diff)
parent5c79507b2c50ddab8f51bc692e3c0a39e3da2ad6 (diff)
Merge branch 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes
* 'drm-nouveau-fixes' of git://git.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau: Fix bandwidth calculation for DisplayPort drm/nouveau: by default use low bpp framebuffer on low memory cards drm/nv10: Change the BO size threshold determining the memory placement range. drm/nvc0: enable acceleration for nvc1 by default drm/nvc0/gr: fixup the mmio list register writes for 0xc1 drm/nvc1: hacky workaround to fix accel issues drm/nvc0/gr: fix some bugs in grctx generation drm/nvc0: enable acceleration on 0xc8 by default drm/nvc0/vram: skip disabled PBFB subunits drm/nv40/pm: fix issues on igp chipsets, which don't have memory drm/nouveau: testing the wrong variable drm/nvc0/vram: storage type 0xc3 is not compressed drm/nv50: fix stability issue on NV86. drm/nouveau: initialize chan->fence.lock before use drm/nv50/vram: fix incorrect detection of bank count on newer chipsets drm/nv50/gr: typo fix, how about we not reset fifo during graph init? drm/nv50/bios: fixup mpll programming from the init table parser drm/nouveau: fix oops if i2c bus not found in nouveau_i2c_identify() drm: make sure drm_vblank_init() has been called before touching vbl_lock
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_graph.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_graph.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c
index bbdbc51830c..a74e501afd2 100644
--- a/drivers/gpu/drm/nouveau/nvc0_graph.c
+++ b/drivers/gpu/drm/nouveau/nvc0_graph.c
@@ -157,8 +157,8 @@ nvc0_graph_create_context_mmio_list(struct nouveau_channel *chan)
struct nvc0_graph_priv *priv = nv_engine(chan->dev, NVOBJ_ENGINE_GR);
struct nvc0_graph_chan *grch = chan->engctx[NVOBJ_ENGINE_GR];
struct drm_device *dev = chan->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
int i = 0, gpc, tp, ret;
- u32 magic;
ret = nouveau_gpuobj_new(dev, chan, 0x2000, 256, NVOBJ_FLAG_VM,
&grch->unk408004);
@@ -207,14 +207,37 @@ nvc0_graph_create_context_mmio_list(struct nouveau_channel *chan)
nv_wo32(grch->mmio, i++ * 4, 0x0041880c);
nv_wo32(grch->mmio, i++ * 4, 0x80000018);
- magic = 0x02180000;
- nv_wo32(grch->mmio, i++ * 4, 0x00405830);
- nv_wo32(grch->mmio, i++ * 4, magic);
- for (gpc = 0; gpc < priv->gpc_nr; gpc++) {
- for (tp = 0; tp < priv->tp_nr[gpc]; tp++, magic += 0x0324) {
- u32 reg = 0x504520 + (gpc * 0x8000) + (tp * 0x0800);
- nv_wo32(grch->mmio, i++ * 4, reg);
- nv_wo32(grch->mmio, i++ * 4, magic);
+ if (dev_priv->chipset != 0xc1) {
+ u32 magic = 0x02180000;
+ nv_wo32(grch->mmio, i++ * 4, 0x00405830);
+ nv_wo32(grch->mmio, i++ * 4, magic);
+ for (gpc = 0; gpc < priv->gpc_nr; gpc++) {
+ for (tp = 0; tp < priv->tp_nr[gpc]; tp++) {
+ u32 reg = TP_UNIT(gpc, tp, 0x520);
+ nv_wo32(grch->mmio, i++ * 4, reg);
+ nv_wo32(grch->mmio, i++ * 4, magic);
+ magic += 0x0324;
+ }
+ }
+ } else {
+ u32 magic = 0x02180000;
+ nv_wo32(grch->mmio, i++ * 4, 0x00405830);
+ nv_wo32(grch->mmio, i++ * 4, magic | 0x0000218);
+ nv_wo32(grch->mmio, i++ * 4, 0x004064c4);
+ nv_wo32(grch->mmio, i++ * 4, 0x0086ffff);
+ for (gpc = 0; gpc < priv->gpc_nr; gpc++) {
+ for (tp = 0; tp < priv->tp_nr[gpc]; tp++) {
+ u32 reg = TP_UNIT(gpc, tp, 0x520);
+ nv_wo32(grch->mmio, i++ * 4, reg);
+ nv_wo32(grch->mmio, i++ * 4, (1 << 28) | magic);
+ magic += 0x0324;
+ }
+ for (tp = 0; tp < priv->tp_nr[gpc]; tp++) {
+ u32 reg = TP_UNIT(gpc, tp, 0x544);
+ nv_wo32(grch->mmio, i++ * 4, reg);
+ nv_wo32(grch->mmio, i++ * 4, magic);
+ magic += 0x0324;
+ }
}
}