2 * Copyright (C) 2012 Rob Clark <robclark@freedesktop.org>
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, sublicense,
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 next
12 * paragraph) shall be included in all copies or substantial portions of the
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 NONINFRINGEMENT. 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 FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * Rob Clark <robclark@freedesktop.org>
27 #ifndef FREEDRENO_GMEM_H_
28 #define FREEDRENO_GMEM_H_
30 #include "pipe/p_context.h"
32 #include "freedreno_util.h"
34 /* per-pipe configuration for hw binning: */
36 uint8_t x
, y
, w
, h
; /* VSC_PIPE[p].CONFIG */
39 /* per-tile configuration for hw binning: */
41 uint8_t p
; /* index into vsc_pipe[]s */
42 uint8_t n
; /* slot within pipe */
43 uint16_t bin_w
, bin_h
;
47 struct fd_gmem_stateobj
{
48 struct pipe_scissor_state scissor
;
49 uint32_t cbuf_base
[MAX_RENDER_TARGETS
];
50 uint32_t zsbuf_base
[2];
51 uint8_t cbuf_cpp
[MAX_RENDER_TARGETS
];
53 uint16_t bin_h
, nbins_y
;
54 uint16_t bin_w
, nbins_x
;
56 uint16_t width
, height
;
57 uint16_t maxpw
, maxph
; /* maximum pipe width/height */
58 uint8_t num_vsc_pipes
; /* number of pipes for a20x */
60 struct fd_vsc_pipe vsc_pipe
[32];
61 struct fd_tile tile
[512];
66 void fd_gmem_render_tiles(struct fd_batch
*batch
);
68 bool fd_gmem_needs_restore(struct fd_batch
*batch
, const struct fd_tile
*tile
,
71 #endif /* FREEDRENO_GMEM_H_ */