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 68... Line 68...
68
			A2XX_RB_COLOR_INFO_FORMAT(fd2_pipe2color(psurf->format)));
68
			A2XX_RB_COLOR_INFO_FORMAT(fd2_pipe2color(psurf->format)));
Line 69... Line 69...
69
 
69
 
70
	OUT_PKT3(ring, CP_SET_CONSTANT, 5);
70
	OUT_PKT3(ring, CP_SET_CONSTANT, 5);
71
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COPY_CONTROL));
71
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COPY_CONTROL));
72
	OUT_RING(ring, 0x00000000);             /* RB_COPY_CONTROL */
72
	OUT_RING(ring, 0x00000000);             /* RB_COPY_CONTROL */
73
	OUT_RELOC(ring, rsc->bo, 0, 0);         /* RB_COPY_DEST_BASE */
73
	OUT_RELOCW(ring, rsc->bo, 0, 0, 0);     /* RB_COPY_DEST_BASE */
74
	OUT_RING(ring, rsc->pitch >> 5);        /* RB_COPY_DEST_PITCH */
74
	OUT_RING(ring, rsc->pitch >> 5);        /* RB_COPY_DEST_PITCH */
75
	OUT_RING(ring,                          /* RB_COPY_DEST_INFO */
75
	OUT_RING(ring,                          /* RB_COPY_DEST_INFO */
76
			A2XX_RB_COPY_DEST_INFO_FORMAT(fd2_pipe2color(psurf->format)) |
76
			A2XX_RB_COPY_DEST_INFO_FORMAT(fd2_pipe2color(psurf->format)) |
77
			A2XX_RB_COPY_DEST_INFO_LINEAR |
77
			A2XX_RB_COPY_DEST_INFO_LINEAR |
Line 197... Line 197...
197
	OUT_RING(ring, A2XX_SQ_TEX_0_CLAMP_X(SQ_TEX_WRAP) |
197
	OUT_RING(ring, A2XX_SQ_TEX_0_CLAMP_X(SQ_TEX_WRAP) |
198
			A2XX_SQ_TEX_0_CLAMP_Y(SQ_TEX_WRAP) |
198
			A2XX_SQ_TEX_0_CLAMP_Y(SQ_TEX_WRAP) |
199
			A2XX_SQ_TEX_0_CLAMP_Z(SQ_TEX_WRAP) |
199
			A2XX_SQ_TEX_0_CLAMP_Z(SQ_TEX_WRAP) |
200
			A2XX_SQ_TEX_0_PITCH(rsc->pitch));
200
			A2XX_SQ_TEX_0_PITCH(rsc->pitch));
201
	OUT_RELOC(ring, rsc->bo, 0,
201
	OUT_RELOC(ring, rsc->bo, 0,
202
			fd2_pipe2surface(psurf->format) | 0x800);
202
			fd2_pipe2surface(psurf->format) | 0x800, 0);
203
	OUT_RING(ring, A2XX_SQ_TEX_2_WIDTH(psurf->width - 1) |
203
	OUT_RING(ring, A2XX_SQ_TEX_2_WIDTH(psurf->width - 1) |
204
			A2XX_SQ_TEX_2_HEIGHT(psurf->height - 1));
204
			A2XX_SQ_TEX_2_HEIGHT(psurf->height - 1));
205
	OUT_RING(ring, 0x01000000 | // XXX
205
	OUT_RING(ring, 0x01000000 | // XXX
206
			swiz |
206
			swiz |
207
			A2XX_SQ_TEX_3_XY_MAG_FILTER(SQ_TEX_FILTER_POINT) |
207
			A2XX_SQ_TEX_3_XY_MAG_FILTER(SQ_TEX_FILTER_POINT) |
Line 239... Line 239...
239
	x0 = ((float)xoff) / ((float)pfb->width);
239
	x0 = ((float)xoff) / ((float)pfb->width);
240
	x1 = ((float)xoff + bin_w) / ((float)pfb->width);
240
	x1 = ((float)xoff + bin_w) / ((float)pfb->width);
241
	y0 = ((float)yoff) / ((float)pfb->height);
241
	y0 = ((float)yoff) / ((float)pfb->height);
242
	y1 = ((float)yoff + bin_h) / ((float)pfb->height);
242
	y1 = ((float)yoff + bin_h) / ((float)pfb->height);
243
	OUT_PKT3(ring, CP_MEM_WRITE, 9);
243
	OUT_PKT3(ring, CP_MEM_WRITE, 9);
244
	OUT_RELOC(ring, fd_resource(fd2_ctx->solid_vertexbuf)->bo, 0x60, 0);
244
	OUT_RELOC(ring, fd_resource(fd2_ctx->solid_vertexbuf)->bo, 0x60, 0, 0);
245
	OUT_RING(ring, fui(x0));
245
	OUT_RING(ring, fui(x0));
246
	OUT_RING(ring, fui(y0));
246
	OUT_RING(ring, fui(y0));
247
	OUT_RING(ring, fui(x1));
247
	OUT_RING(ring, fui(x1));
248
	OUT_RING(ring, fui(y0));
248
	OUT_RING(ring, fui(y0));
249
	OUT_RING(ring, fui(x0));
249
	OUT_RING(ring, fui(x0));
Line 335... Line 335...
335
fd2_emit_tile_init(struct fd_context *ctx)
335
fd2_emit_tile_init(struct fd_context *ctx)
336
{
336
{
337
	struct fd_ringbuffer *ring = ctx->ring;
337
	struct fd_ringbuffer *ring = ctx->ring;
338
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
338
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
339
	struct fd_gmem_stateobj *gmem = &ctx->gmem;
339
	struct fd_gmem_stateobj *gmem = &ctx->gmem;
340
	enum pipe_format format = pfb->cbufs[0]->format;
340
	enum pipe_format format = pipe_surface_format(pfb->cbufs[0]);
341
	uint32_t reg;
341
	uint32_t reg;
Line 342... Line 342...
342
 
342
 
343
	OUT_PKT3(ring, CP_SET_CONSTANT, 4);
343
	OUT_PKT3(ring, CP_SET_CONSTANT, 4);
344
	OUT_RING(ring, CP_REG(REG_A2XX_RB_SURFACE_INFO));
344
	OUT_RING(ring, CP_REG(REG_A2XX_RB_SURFACE_INFO));
Line 356... Line 356...
356
fd2_emit_tile_prep(struct fd_context *ctx, uint32_t xoff, uint32_t yoff,
356
fd2_emit_tile_prep(struct fd_context *ctx, uint32_t xoff, uint32_t yoff,
357
		uint32_t bin_w, uint32_t bin_h)
357
		uint32_t bin_w, uint32_t bin_h)
358
{
358
{
359
	struct fd_ringbuffer *ring = ctx->ring;
359
	struct fd_ringbuffer *ring = ctx->ring;
360
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
360
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
361
	enum pipe_format format = pfb->cbufs[0]->format;
361
	enum pipe_format format = pipe_surface_format(pfb->cbufs[0]);
Line 362... Line 362...
362
 
362
 
363
	OUT_PKT3(ring, CP_SET_CONSTANT, 2);
363
	OUT_PKT3(ring, CP_SET_CONSTANT, 2);
364
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
364
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
365
	OUT_RING(ring, A2XX_RB_COLOR_INFO_SWAP(1) | /* RB_COLOR_INFO */
365
	OUT_RING(ring, A2XX_RB_COLOR_INFO_SWAP(1) | /* RB_COLOR_INFO */
Line 377... Line 377...
377
fd2_emit_tile_renderprep(struct fd_context *ctx, uint32_t xoff, uint32_t yoff,
377
fd2_emit_tile_renderprep(struct fd_context *ctx, uint32_t xoff, uint32_t yoff,
378
		uint32_t bin_w, uint32_t bin_h)
378
		uint32_t bin_w, uint32_t bin_h)
379
{
379
{
380
	struct fd_ringbuffer *ring = ctx->ring;
380
	struct fd_ringbuffer *ring = ctx->ring;
381
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
381
	struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
382
	enum pipe_format format = pfb->cbufs[0]->format;
382
	enum pipe_format format = pipe_surface_format(pfb->cbufs[0]);
Line 383... Line 383...
383
 
383
 
384
	OUT_PKT3(ring, CP_SET_CONSTANT, 2);
384
	OUT_PKT3(ring, CP_SET_CONSTANT, 2);
385
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
385
	OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
386
	OUT_RING(ring, A2XX_RB_COLOR_INFO_SWAP(fmt2swap(format)) |
386
	OUT_RING(ring, A2XX_RB_COLOR_INFO_SWAP(fmt2swap(format)) |