aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-12-15 07:02:47 -0500
committerBen Skeggs <bskeggs@redhat.com>2009-12-16 02:05:39 -0500
commit054b93e444550a72aef17115363cdef253b9ee7c (patch)
tree667d10b686c62d64e0b998115209c65884bcc6de /drivers/gpu/drm/nouveau/nouveau_drv.h
parent15bee69ee1532a29e13124b298027ee6ef54bac8 (diff)
drm/nv40: implement ctxprog/state generation
The context programs are *very* simple compared to the ones used by the binary driver. There's notes in nv40_grctx.c explaining most of the things we don't implement. If we discover if/why any of it is required further down the track, we'll handle it then. The PGRAPH state generated for each chipset should match what NVIDIA do almost exactly (there's a couple of exceptions). If someone has a lot of time on their hands, they could figure out the mapping of object/method to PGRAPH register and demagic the initial state a little, it's not terribly important however. At time of commit, confirmed to be working at least well enough for accelerated X (and where tested, for 3D apps) on NV40, NV43, NV44, NV46, NV49, NV4A, NV4B and NV4E. A module option has been added to force the use of external firmware blobs if it becomes required. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index bc6ffa5eeac7..5f8cbb79c499 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -54,6 +54,7 @@ struct nouveau_fpriv {
54#include "nouveau_drm.h" 54#include "nouveau_drm.h"
55#include "nouveau_reg.h" 55#include "nouveau_reg.h"
56#include "nouveau_bios.h" 56#include "nouveau_bios.h"
57struct nouveau_grctx;
57 58
58#define MAX_NUM_DCB_ENTRIES 16 59#define MAX_NUM_DCB_ENTRIES 16
59 60
@@ -317,6 +318,7 @@ struct nouveau_pgraph_engine {
317 bool accel_blocked; 318 bool accel_blocked;
318 void *ctxprog; 319 void *ctxprog;
319 void *ctxvals; 320 void *ctxvals;
321 int grctx_size;
320 322
321 int (*init)(struct drm_device *); 323 int (*init)(struct drm_device *);
322 void (*takedown)(struct drm_device *); 324 void (*takedown)(struct drm_device *);
@@ -647,6 +649,7 @@ extern int nouveau_fbpercrtc;
647extern char *nouveau_tv_norm; 649extern char *nouveau_tv_norm;
648extern int nouveau_reg_debug; 650extern int nouveau_reg_debug;
649extern char *nouveau_vbios; 651extern char *nouveau_vbios;
652extern int nouveau_ctxfw;
650 653
651/* nouveau_state.c */ 654/* nouveau_state.c */
652extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); 655extern void nouveau_preclose(struct drm_device *dev, struct drm_file *);
@@ -959,9 +962,7 @@ extern int nv40_graph_create_context(struct nouveau_channel *);
959extern void nv40_graph_destroy_context(struct nouveau_channel *); 962extern void nv40_graph_destroy_context(struct nouveau_channel *);
960extern int nv40_graph_load_context(struct nouveau_channel *); 963extern int nv40_graph_load_context(struct nouveau_channel *);
961extern int nv40_graph_unload_context(struct drm_device *); 964extern int nv40_graph_unload_context(struct drm_device *);
962extern int nv40_grctx_init(struct drm_device *); 965extern void nv40_grctx_init(struct nouveau_grctx *);
963extern void nv40_grctx_fini(struct drm_device *);
964extern void nv40_grctx_vals_load(struct drm_device *, struct nouveau_gpuobj *);
965 966
966/* nv50_graph.c */ 967/* nv50_graph.c */
967extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; 968extern struct nouveau_pgraph_object_class nv50_graph_grclass[];
@@ -975,6 +976,12 @@ extern int nv50_graph_load_context(struct nouveau_channel *);
975extern int nv50_graph_unload_context(struct drm_device *); 976extern int nv50_graph_unload_context(struct drm_device *);
976extern void nv50_graph_context_switch(struct drm_device *); 977extern void nv50_graph_context_switch(struct drm_device *);
977 978
979/* nouveau_grctx.c */
980extern int nouveau_grctx_prog_load(struct drm_device *);
981extern void nouveau_grctx_vals_load(struct drm_device *,
982 struct nouveau_gpuobj *);
983extern void nouveau_grctx_fini(struct drm_device *);
984
978/* nv04_instmem.c */ 985/* nv04_instmem.c */
979extern int nv04_instmem_init(struct drm_device *); 986extern int nv04_instmem_init(struct drm_device *);
980extern void nv04_instmem_takedown(struct drm_device *); 987extern void nv04_instmem_takedown(struct drm_device *);