From 4297a83b48664b2b6a6dc0a72a4d11b043f34778 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 12 Jan 2007 00:13:05 -0500 Subject: nouveau: get nv30 context switching to work. * Pulled in some registers from nv10reg.h. Needed for context switching. * Filled in nv30 graphics context (based on nv40_graph.c). * Figure out nv30 context table, set up on context creation. Allows the cards automatic switching to work. --- shared-core/nouveau_drv.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'shared-core/nouveau_drv.h') diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index 6b09046c..219ba123 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -142,6 +142,10 @@ typedef struct drm_nouveau_private { struct mem_block *fb_nomap_heap; struct mem_block *ramin_heap; + /* context table pointed to be NV_PGRAPH_CHANNEL_CTX_TABLE (0x400780) */ + uint32_t ctx_table_size; + struct mem_block *ctx_table; + struct nouveau_config config; } drm_nouveau_private_t; @@ -198,6 +202,10 @@ extern void nouveau_irq_preinstall(drm_device_t*); extern void nouveau_irq_postinstall(drm_device_t*); extern void nouveau_irq_uninstall(drm_device_t*); +/* nv30_graph.c */ +extern int nv30_graph_init(drm_device_t *dev); +extern int nv30_graph_context_create(drm_device_t *dev, int channel); + /* nv40_graph.c */ extern int nv40_graph_init(drm_device_t *dev); extern int nv40_graph_context_create(drm_device_t *dev, int channel); -- cgit v1.2.3 From cd5f543b2f3d6dd4c45f676c6fb9848b4d8a1c33 Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sat, 13 Jan 2007 21:43:47 +0100 Subject: nouveau: first step to make graph ctx works It is still not working, but now we could use some 3D commands without needed to run nvidia blob before. --- shared-core/nouveau_drv.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'shared-core/nouveau_drv.h') diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index 219ba123..9466cdcd 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -90,8 +90,8 @@ struct nouveau_fifo /* objects belonging to this fifo */ struct nouveau_object *objs; - /* XXX move this in PGRAPH struct */ - uint32_t pgraph_ctx_user; + /* XXX dynamic alloc ? */ + uint32_t nv10_pgraph_ctx [340]; }; struct nouveau_config { @@ -202,6 +202,11 @@ extern void nouveau_irq_preinstall(drm_device_t*); extern void nouveau_irq_postinstall(drm_device_t*); extern void nouveau_irq_uninstall(drm_device_t*); +/* nv10_graph.c */ +extern void nouveau_nv10_context_switch(drm_device_t *dev); +extern int nv10_graph_init(drm_device_t *dev); +extern int nv10_graph_context_create(drm_device_t *dev, int channel); + /* nv30_graph.c */ extern int nv30_graph_init(drm_device_t *dev); extern int nv30_graph_context_create(drm_device_t *dev, int channel); -- cgit v1.2.3 From f04347f371c6c9c3a47550c6b7d26b7bd5629c85 Mon Sep 17 00:00:00 2001 From: Matthieu Castet Date: Sat, 13 Jan 2007 23:19:41 +0100 Subject: nouveau: nv20 graph ctx switch. Untested... --- shared-core/nouveau_drv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'shared-core/nouveau_drv.h') diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h index 9466cdcd..4978c476 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -207,6 +207,11 @@ extern void nouveau_nv10_context_switch(drm_device_t *dev); extern int nv10_graph_init(drm_device_t *dev); extern int nv10_graph_context_create(drm_device_t *dev, int channel); +/* nv20_graph.c */ +extern void nouveau_nv20_context_switch(drm_device_t *dev); +extern int nv20_graph_init(drm_device_t *dev); +extern int nv20_graph_context_create(drm_device_t *dev, int channel); + /* nv30_graph.c */ extern int nv30_graph_init(drm_device_t *dev); extern int nv30_graph_context_create(drm_device_t *dev, int channel); -- cgit v1.2.3