nvfx_screen.h 1.48 KB
Newer Older
1
2
#ifndef __NVFX_SCREEN_H__
#define __NVFX_SCREEN_H__
Ben Skeggs's avatar
Ben Skeggs committed
3

4
#include "pipe/p_compiler.h"
5
#include "util/u_double_list.h"
6
#include "nouveau/nouveau_screen.h"
Vinson Lee's avatar
Vinson Lee committed
7

8
struct pipe_screen;
Ben Skeggs's avatar
Ben Skeggs committed
9

10
struct nvfx_screen {
11
	struct nouveau_screen base;
12
13

	struct nouveau_winsys *nvws;
14

15
	struct nvfx_context *cur_ctx;
16

17
	unsigned is_nv4x; /* either 0 or ~0 */
18
	boolean force_swtnl;
19
	boolean trace_draw;
20
21
	unsigned vertex_buffer_reloc_flags;
	unsigned index_buffer_reloc_flags;
22

23
	/* HW graphics objects */
24
	struct nouveau_grobj *eng3d;
25
26
27
28
29
	struct nouveau_notifier *sync;

	/* Query object resources */
	struct nouveau_notifier *query;
	struct nouveau_resource *query_heap;
30
	struct list_head query_list;
31
32
33
34

	/* Vtxprog resources */
	struct nouveau_resource *vp_exec_heap;
	struct nouveau_resource *vp_data_heap;
35
36

	struct nv04_2d_context* eng2d;
37
38
39
40
41
42
43
44
45
46
47
48

	/* Once the amount of bytes drawn from the buffer reaches the updated size times this value,
	 * we will assume that the buffer will be drawn an huge number of times before the
	 * next modification
	 */
	float static_reuse_threshold;

	/* Cost of allocating a buffer in terms of the cost of copying a byte to an hardware buffer */
	unsigned buffer_allocation_cost;

	/* inline_cost/hardware_cost conversion ration */
	float inline_cost_per_hardware_cost;
Ben Skeggs's avatar
Ben Skeggs committed
49
50
};

51
52
static INLINE struct nvfx_screen *
nvfx_screen(struct pipe_screen *screen)
Ben Skeggs's avatar
Ben Skeggs committed
53
{
54
	return (struct nvfx_screen *)screen;
Ben Skeggs's avatar
Ben Skeggs committed
55
56
}

57
58
59
int nvfx_screen_surface_init(struct pipe_screen *pscreen);
void nvfx_screen_surface_takedown(struct pipe_screen *pscreen);

Ben Skeggs's avatar
Ben Skeggs committed
60
#endif