summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nouveau_object.c
blob: 9003fb1eaeea852bea5b1b35d03948283bd3d674 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
}