nouveau_winsys.h 3.17 KB
Newer Older
1 2 3 4
#ifndef NOUVEAU_WINSYS_H
#define NOUVEAU_WINSYS_H

#include <stdint.h>
Zack Rusin's avatar
Zack Rusin committed
5
#include "pipe/internal/p_winsys_screen.h"
6
#include "pipe/p_defines.h"
7

8 9 10
#include "nouveau/nouveau_bo.h"
#include "nouveau/nouveau_channel.h"
#include "nouveau/nouveau_class.h"
11
#include "nouveau/nouveau_device.h"
12 13 14 15
#include "nouveau/nouveau_grobj.h"
#include "nouveau/nouveau_notifier.h"
#include "nouveau/nouveau_resource.h"
#include "nouveau/nouveau_pushbuf.h"
16

17 18 19
#define NOUVEAU_CAP_HW_VTXBUF (0xbeef0000)
#define NOUVEAU_CAP_HW_IDXBUF (0xbeef0001)

20 21
#define NOUVEAU_TEXTURE_USAGE_LINEAR (1 << 16)

22
#define NOUVEAU_BUFFER_USAGE_TEXTURE (1 << 16)
23
#define NOUVEAU_BUFFER_USAGE_ZETA    (1 << 17)
24

25 26 27 28 29
struct nouveau_winsys {
	struct nouveau_context *nv;

	struct nouveau_channel *channel;

30 31
	int  (*res_init)(struct nouveau_resource **heap, unsigned start,
			 unsigned size);
32 33 34 35
	int  (*res_alloc)(struct nouveau_resource *heap, int size, void *priv,
			  struct nouveau_resource **);
	void (*res_free)(struct nouveau_resource **);

36
	int  (*push_reloc)(struct nouveau_winsys *, void *ptr,
37
			   struct pipe_buffer *, uint32_t data,
Ben Skeggs's avatar
Ben Skeggs committed
38
			   uint32_t flags, uint32_t vor, uint32_t tor);
39 40
	int  (*push_flush)(struct nouveau_winsys *, unsigned size,
			   struct pipe_fence_handle **fence);
41 42 43 44 45 46 47 48 49 50 51 52 53 54
			       
	int       (*grobj_alloc)(struct nouveau_winsys *, int grclass,
				 struct nouveau_grobj **);
	void      (*grobj_free)(struct nouveau_grobj **);

	int       (*notifier_alloc)(struct nouveau_winsys *, int count,
				    struct nouveau_notifier **);
	void      (*notifier_free)(struct nouveau_notifier **);
	void      (*notifier_reset)(struct nouveau_notifier *, int id);
	uint32_t  (*notifier_status)(struct nouveau_notifier *, int id);
	uint32_t  (*notifier_retval)(struct nouveau_notifier *, int id);
	int       (*notifier_wait)(struct nouveau_notifier *, int id,
				   int status, int timeout);

55 56 57 58 59
	int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *,
			    unsigned, unsigned, struct pipe_surface *,
			    unsigned, unsigned, unsigned, unsigned);
	int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *,
			    unsigned, unsigned, unsigned, unsigned, unsigned);
60 61
};

Stéphane Marchesin's avatar
nv04.  
Stéphane Marchesin committed
62 63 64 65 66 67
extern struct pipe_screen *
nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);

extern struct pipe_context *
nv04_create(struct pipe_screen *, unsigned pctx_id);

Stéphane Marchesin's avatar
nv10.  
Stéphane Marchesin committed
68
extern struct pipe_screen *
69
nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
Stéphane Marchesin's avatar
nv10.  
Stéphane Marchesin committed
70 71 72 73

extern struct pipe_context *
nv10_create(struct pipe_screen *, unsigned pctx_id);

74 75 76 77 78 79
extern struct pipe_screen *
nv20_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);

extern struct pipe_context *
nv20_create(struct pipe_screen *, unsigned pctx_id);

Ben Skeggs's avatar
Ben Skeggs committed
80
extern struct pipe_screen *
81
nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
Ben Skeggs's avatar
Ben Skeggs committed
82

Stéphane Marchesin's avatar
Stéphane Marchesin committed
83
extern struct pipe_context *
84
nv30_create(struct pipe_screen *, unsigned pctx_id);
Ben Skeggs's avatar
Ben Skeggs committed
85 86

extern struct pipe_screen *
87
nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
Stéphane Marchesin's avatar
Stéphane Marchesin committed
88

89
extern struct pipe_context *
90
nv40_create(struct pipe_screen *, unsigned pctx_id);
Ben Skeggs's avatar
Ben Skeggs committed
91 92

extern struct pipe_screen *
93
nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
94

Ben Skeggs's avatar
Ben Skeggs committed
95
extern struct pipe_context *
96
nv50_create(struct pipe_screen *, unsigned pctx_id);
Ben Skeggs's avatar
Ben Skeggs committed
97

98
#endif