2 * Copyright (c) 2012-2015 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>
25 * Christian Gmeiner <christian.gmeiner@gmail.com>
28 #ifndef H_ETNAVIV_SCREEN
29 #define H_ETNAVIV_SCREEN
31 #include "etnaviv_internal.h"
33 #include "os/os_thread.h"
34 #include "pipe/p_screen.h"
35 #include "renderonly/renderonly.h"
36 #include "util/slab.h"
40 /* Enum with indices for each of the feature words */
41 enum viv_features_word
{
43 viv_chipMinorFeatures0
= 1,
44 viv_chipMinorFeatures1
= 2,
45 viv_chipMinorFeatures2
= 3,
46 viv_chipMinorFeatures3
= 4,
47 VIV_FEATURES_WORD_COUNT
/* Must be last */
50 /** Convenience macro to probe features from state.xml.h:
51 * VIV_FEATURE(chipFeatures, FAST_CLEAR)
52 * VIV_FEATURE(chipMinorFeatures1, AUTO_DISABLE)
54 #define VIV_FEATURE(screen, word, feature) \
55 ((screen->features[viv_ ## word] & (word ## _ ## feature)) != 0)
58 struct pipe_screen base
;
63 struct etna_device
*dev
;
65 struct etna_pipe
*pipe
;
66 struct renderonly
*ro
;
68 struct slab_parent_pool transfer_pool
;
74 struct etna_specs specs
;
77 static inline struct etna_screen
*
78 etna_screen(struct pipe_screen
*pscreen
)
80 return (struct etna_screen
*)pscreen
;
84 etna_screen_bo_get_handle(struct pipe_screen
*pscreen
, struct etna_bo
*bo
,
85 unsigned stride
, struct winsys_handle
*whandle
);
88 etna_screen_bo_from_handle(struct pipe_screen
*pscreen
,
89 struct winsys_handle
*whandle
, unsigned *out_stride
);
92 etna_screen_create(struct etna_device
*dev
, struct etna_gpu
*gpu
,
93 struct renderonly
*ro
);