diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2009-12-15 07:02:47 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2009-12-16 02:05:39 -0500 |
commit | 054b93e444550a72aef17115363cdef253b9ee7c (patch) | |
tree | 667d10b686c62d64e0b998115209c65884bcc6de /drivers/gpu/drm/nouveau/nouveau_drv.h | |
parent | 15bee69ee1532a29e13124b298027ee6ef54bac8 (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.h | 13 |
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" |
57 | struct 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; | |||
647 | extern char *nouveau_tv_norm; | 649 | extern char *nouveau_tv_norm; |
648 | extern int nouveau_reg_debug; | 650 | extern int nouveau_reg_debug; |
649 | extern char *nouveau_vbios; | 651 | extern char *nouveau_vbios; |
652 | extern int nouveau_ctxfw; | ||
650 | 653 | ||
651 | /* nouveau_state.c */ | 654 | /* nouveau_state.c */ |
652 | extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); | 655 | extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); |
@@ -959,9 +962,7 @@ extern int nv40_graph_create_context(struct nouveau_channel *); | |||
959 | extern void nv40_graph_destroy_context(struct nouveau_channel *); | 962 | extern void nv40_graph_destroy_context(struct nouveau_channel *); |
960 | extern int nv40_graph_load_context(struct nouveau_channel *); | 963 | extern int nv40_graph_load_context(struct nouveau_channel *); |
961 | extern int nv40_graph_unload_context(struct drm_device *); | 964 | extern int nv40_graph_unload_context(struct drm_device *); |
962 | extern int nv40_grctx_init(struct drm_device *); | 965 | extern void nv40_grctx_init(struct nouveau_grctx *); |
963 | extern void nv40_grctx_fini(struct drm_device *); | ||
964 | extern void nv40_grctx_vals_load(struct drm_device *, struct nouveau_gpuobj *); | ||
965 | 966 | ||
966 | /* nv50_graph.c */ | 967 | /* nv50_graph.c */ |
967 | extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; | 968 | extern struct nouveau_pgraph_object_class nv50_graph_grclass[]; |
@@ -975,6 +976,12 @@ extern int nv50_graph_load_context(struct nouveau_channel *); | |||
975 | extern int nv50_graph_unload_context(struct drm_device *); | 976 | extern int nv50_graph_unload_context(struct drm_device *); |
976 | extern void nv50_graph_context_switch(struct drm_device *); | 977 | extern void nv50_graph_context_switch(struct drm_device *); |
977 | 978 | ||
979 | /* nouveau_grctx.c */ | ||
980 | extern int nouveau_grctx_prog_load(struct drm_device *); | ||
981 | extern void nouveau_grctx_vals_load(struct drm_device *, | ||
982 | struct nouveau_gpuobj *); | ||
983 | extern void nouveau_grctx_fini(struct drm_device *); | ||
984 | |||
978 | /* nv04_instmem.c */ | 985 | /* nv04_instmem.c */ |
979 | extern int nv04_instmem_init(struct drm_device *); | 986 | extern int nv04_instmem_init(struct drm_device *); |
980 | extern void nv04_instmem_takedown(struct drm_device *); | 987 | extern void nv04_instmem_takedown(struct drm_device *); |