2 * Copyright (c) 2012-2013 Etnaviv Project
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Wladimir J. van der Laan <laanwj@gmail.com>
30 #include "etnaviv_context.h"
34 uint8_t downsample_x
: 1; /* Downsample in x direction */
35 uint8_t downsample_y
: 1; /* Downsample in y direction */
36 uint8_t source_ts_valid
: 1;
38 uint8_t source_format
; /* RS_FORMAT_XXX */
39 uint8_t source_tiling
; /* ETNA_LAYOUT_XXX */
40 uint8_t dest_tiling
; /* ETNA_LAYOUT_XXX */
41 uint8_t dest_format
; /* RS_FORMAT_XXX */
44 struct etna_bo
*source
;
45 uint32_t source_offset
;
46 uint32_t source_stride
;
47 uint32_t source_padded_width
; /* total padded width (only needed for source) */
48 uint32_t source_padded_height
; /* total padded height */
52 uint32_t dest_padded_height
; /* total padded height */
53 uint16_t width
; /* source width */
54 uint16_t height
; /* source height */
57 uint32_t clear_mode
; /* VIVS_RS_CLEAR_CONTROL_MODE_XXX */
58 uint32_t clear_value
[4];
61 uint8_t endian_mode
; /* ENDIAN_MODE_XXX */
64 /* treat this as opaque structure */
65 struct compiled_rs_state
{
66 uint8_t source_ts_valid
: 1;
68 uint32_t RS_SOURCE_STRIDE
;
69 uint32_t RS_DEST_STRIDE
;
70 uint32_t RS_WINDOW_SIZE
;
71 uint32_t RS_DITHER
[2];
72 uint32_t RS_CLEAR_CONTROL
;
73 uint32_t RS_FILL_VALUE
[4];
74 uint32_t RS_EXTRA_CONFIG
;
75 uint32_t RS_PIPE_OFFSET
[2];
76 uint32_t RS_KICKER_INPLACE
; /* Set if source is destination */
78 struct etna_reloc source
[2];
79 struct etna_reloc dest
[2];
82 /* compile RS state struct */
84 etna_compile_rs_state(struct etna_context
*ctx
, struct compiled_rs_state
*cs
,
85 const struct rs_state
*rs
);
87 /* Context initialization for RS clear_blit functions. */
89 etna_clear_blit_rs_init(struct pipe_context
*pctx
);