Subversion Repositories Kolibri OS

Rev

Rev 4358 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4358 Rev 4401
Line 31... Line 31...
31
 
31
 
32
#include 
32
#include 
Line 33... Line 33...
33
#include 
33
#include 
-
 
34
 
34
 
35
#include "pipe/p_format.h"
35
#include "pipe/p_format.h"
36
#include "pipe/p_state.h"
-
 
37
#include "util/u_debug.h"
Line 36... Line 38...
36
#include "util/u_debug.h"
38
#include "util/u_math.h"
37
#include "util/u_math.h"
39
#include "util/u_half.h"
Line 38... Line 40...
38
 
40
 
Line 45... Line 47...
45
enum adreno_rb_blend_opcode fd_blend_func(unsigned func);
47
enum adreno_rb_blend_opcode fd_blend_func(unsigned func);
46
enum adreno_pa_su_sc_draw fd_polygon_mode(unsigned mode);
48
enum adreno_pa_su_sc_draw fd_polygon_mode(unsigned mode);
47
enum adreno_stencil_op fd_stencil_op(unsigned op);
49
enum adreno_stencil_op fd_stencil_op(unsigned op);
Line 48... Line 50...
48
 
50
 
49
 
51
 
50
#define FD_DBG_MSGS   0x1
52
#define FD_DBG_MSGS     0x01
51
#define FD_DBG_DISASM 0x2
53
#define FD_DBG_DISASM   0x02
-
 
54
#define FD_DBG_DCLEAR   0x04
52
#define FD_DBG_DCLEAR 0x4
55
#define FD_DBG_DGMEM    0x08
Line 53... Line 56...
53
#define FD_DBG_DGMEM  0x8
56
#define FD_DBG_DSCIS    0x10
54
extern int fd_mesa_debug;
57
extern int fd_mesa_debug;
55
 
58
 
Line 75... Line 78...
75
			((index_size >> 1) << 13) |
78
			((index_size >> 1) << 13) |
76
			(vis_cull_mode     << 9) |
79
			(vis_cull_mode     << 9) |
77
			(1                 << 14);
80
			(1                 << 14);
78
}
81
}
Line -... Line 82...
-
 
82
 
-
 
83
 
-
 
84
static inline enum pipe_format
-
 
85
pipe_surface_format(struct pipe_surface *psurf)
-
 
86
{
-
 
87
	if (!psurf)
-
 
88
		return PIPE_FORMAT_NONE;
-
 
89
	return psurf->format;
-
 
90
}
79
 
91
 
Line 80... Line 92...
80
#define LOG_DWORDS 0
92
#define LOG_DWORDS 0
81
 
93
 
Line 90... Line 102...
90
	*(ring->cur++) = data;
102
	*(ring->cur++) = data;
91
}
103
}
Line 92... Line 104...
92
 
104
 
93
static inline void
105
static inline void
94
OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo,
106
OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo,
95
		uint32_t offset, uint32_t or)
107
		uint32_t offset, uint32_t or, int32_t shift)
96
{
108
{
97
	if (LOG_DWORDS) {
109
	if (LOG_DWORDS) {
98
		DBG("ring[%p]: OUT_RELOC  %04x:  %p+%u", ring,
110
		DBG("ring[%p]: OUT_RELOC   %04x:  %p+%u << %d", ring,
99
				(uint32_t)(ring->cur - ring->last_start), bo, offset);
111
				(uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
100
	}
112
	}
-
 
113
	fd_ringbuffer_reloc(ring, &(struct fd_reloc){
-
 
114
		.bo = bo,
-
 
115
		.flags = FD_RELOC_READ,
-
 
116
		.offset = offset,
-
 
117
		.or = or,
-
 
118
		.shift = shift,
101
	fd_ringbuffer_emit_reloc(ring, bo, offset, or);
119
	});
Line 102... Line -...
102
}
-
 
103
 
120
}
104
/* shifted reloc: */
121
 
105
static inline void
122
static inline void
106
OUT_RELOCS(struct fd_ringbuffer *ring, struct fd_bo *bo,
123
OUT_RELOCW(struct fd_ringbuffer *ring, struct fd_bo *bo,
107
		uint32_t offset, uint32_t or, int32_t shift)
124
		uint32_t offset, uint32_t or, int32_t shift)
108
{
125
{
109
	if (LOG_DWORDS) {
126
	if (LOG_DWORDS) {
110
		DBG("ring[%p]: OUT_RELOCS  %04x:  %p+%u << %d", ring,
127
		DBG("ring[%p]: OUT_RELOC   %04x:  %p+%u << %d", ring,
111
				(uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
128
				(uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
-
 
129
	}
-
 
130
	fd_ringbuffer_reloc(ring, &(struct fd_reloc){
-
 
131
		.bo = bo,
-
 
132
		.flags = FD_RELOC_READ | FD_RELOC_WRITE,
-
 
133
		.offset = offset,
-
 
134
		.or = or,
112
	}
135
		.shift = shift,
Line 113... Line 136...
113
	fd_ringbuffer_emit_reloc_shift(ring, bo, offset, or, shift);
136
	});
114
}
137
}
115
 
138
 
Line 141... Line 164...
141
static inline void
164
static inline void
142
OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
165
OUT_IB(struct fd_ringbuffer *ring, struct fd_ringmarker *start,
143
		struct fd_ringmarker *end)
166
		struct fd_ringmarker *end)
144
{
167
{
145
	OUT_PKT3(ring, CP_INDIRECT_BUFFER_PFD, 2);
168
	OUT_PKT3(ring, CP_INDIRECT_BUFFER_PFD, 2);
146
	fd_ringbuffer_emit_reloc_ring(ring, start);
169
	fd_ringbuffer_emit_reloc_ring(ring, start, end);
147
	OUT_RING(ring, fd_ringmarker_dwords(start, end));
170
	OUT_RING(ring, fd_ringmarker_dwords(start, end));
148
}
171
}
Line 149... Line 172...
149
 
172