diff options
author | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2006-11-05 13:46:48 +0000 |
---|---|---|
committer | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2006-11-05 13:46:48 +0000 |
commit | e2b4d9b317104ff3c56a9bf108aa79084d49eba5 (patch) | |
tree | fdeefd50bfae06298ed943674b69aba088f464fd /src/mesa/drivers/dri/nouveau/nouveau_object.c | |
parent | 1ebe921228ef896804384002d8a3acd0885afc98 (diff) |
Architect the DRI :
- make use of the autogenerated nouveau_reg.h file
- add object creation to the DRI
- some work on screen and context creation
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_object.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_object.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.c b/src/mesa/drivers/dri/nouveau/nouveau_object.c new file mode 100644 index 0000000000..9003fb1eae --- /dev/null +++ b/src/mesa/drivers/dri/nouveau/nouveau_object.c @@ -0,0 +1,36 @@ + +#include "nouveau_fifo.h" +#include "nouveau_object.h" + + +static GLboolean NVDmaCreateContextObject(nouveauContextPtr nmesa, int handle, int class, uint32_t flags, + uint32_t dma_in, uint32_t dma_out, uint32_t dma_notifier) +{ + drm_nouveau_object_init_t cto; + int ret; + + cto.handle = handle; + cto.class = class; + cto.flags = flags; + cto.dma0= dma_in; + cto.dma1= dma_out; + cto.dma_notifier = dma_notifier; + ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_OBJECT_INIT, &cto, sizeof(cto)); + + return ret == 0; +} + +static void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int handle, int subchannel) +{ + BEGIN_RING_SIZE(subchannel, 0, 1); + OUT_RING(handle); +} + +void nouveauObjectInit(nouveauContextPtr nmesa) +{ + NVDmaCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d, 0, 0, 0, 0); + nouveauObjectOnSubchannel(nmesa, NvSub3D, Nv3D); +} + + + |