diff options
author | root <root@gdp.(none)> | 2008-05-06 23:04:55 +0100 |
---|---|---|
committer | Stuart Bennett <sb476@cam.ac.uk> | 2008-08-19 02:01:14 +0100 |
commit | 0da66c27fa2aabdbaf4c003ba3712a61253d7ffe (patch) | |
tree | d2984ea68dbf90e535b56740ae48c90a3b149d31 /shared-core/nv20_graph.c | |
parent | 41b83a99583486ad4f8760a6537d34783769bfc3 (diff) |
nouveau: fifo and graphics engine suspend and resume for nv04-nv4x
Corresponding DDX patch at http://people.freedesktop.org/~stuart/nv0x-nv4x_suspend/
Diffstat (limited to 'shared-core/nv20_graph.c')
-rw-r--r-- | shared-core/nv20_graph.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/shared-core/nv20_graph.c b/shared-core/nv20_graph.c index ad73ea91..d862debb 100644 --- a/shared-core/nv20_graph.c +++ b/shared-core/nv20_graph.c @@ -694,13 +694,15 @@ int nv20_graph_init(struct drm_device *dev) { NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) | NV_PMC_ENABLE_PGRAPH); - /* Create Context Pointer Table */ - dev_priv->ctx_table_size = 32 * 4; - if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, - dev_priv->ctx_table_size, 16, - NVOBJ_FLAG_ZERO_ALLOC, - &dev_priv->ctx_table))) - return ret; + if (!dev_priv->ctx_table) { + /* Create Context Pointer Table */ + dev_priv->ctx_table_size = 32 * 4; + if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, + dev_priv->ctx_table_size, 16, + NVOBJ_FLAG_ZERO_ALLOC, + &dev_priv->ctx_table))) + return ret; + } NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE, dev_priv->ctx_table->instance >> 4); @@ -812,13 +814,15 @@ int nv30_graph_init(struct drm_device *dev) NV_WRITE(NV03_PMC_ENABLE, NV_READ(NV03_PMC_ENABLE) | NV_PMC_ENABLE_PGRAPH); - /* Create Context Pointer Table */ - dev_priv->ctx_table_size = 32 * 4; - if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, - dev_priv->ctx_table_size, 16, - NVOBJ_FLAG_ZERO_ALLOC, - &dev_priv->ctx_table))) - return ret; + if (!dev_priv->ctx_table) { + /* Create Context Pointer Table */ + dev_priv->ctx_table_size = 32 * 4; + if ((ret = nouveau_gpuobj_new_ref(dev, NULL, NULL, 0, + dev_priv->ctx_table_size, 16, + NVOBJ_FLAG_ZERO_ALLOC, + &dev_priv->ctx_table))) + return ret; + } NV_WRITE(NV20_PGRAPH_CHANNEL_CTX_TABLE, dev_priv->ctx_table->instance >> 4); |