2 * Copyright © 2014-2018 NVIDIA Corporation
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
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #ifndef TEGRA_CONTEXT_H
25 #define TEGRA_CONTEXT_H
27 #include "pipe/p_context.h"
28 #include "pipe/p_state.h"
32 struct tegra_context
{
33 struct pipe_context base
;
34 struct pipe_context
*gpu
;
37 static inline struct tegra_context
*
38 to_tegra_context(struct pipe_context
*context
)
40 return (struct tegra_context
*)context
;
44 tegra_screen_context_create(struct pipe_screen
*pscreen
, void *priv
,
47 struct tegra_sampler_view
{
48 struct pipe_sampler_view base
;
49 struct pipe_sampler_view
*gpu
;
52 static inline struct tegra_sampler_view
*
53 to_tegra_sampler_view(struct pipe_sampler_view
*view
)
55 return (struct tegra_sampler_view
*)view
;
58 static inline struct pipe_sampler_view
*
59 tegra_sampler_view_unwrap(struct pipe_sampler_view
*view
)
64 return to_tegra_sampler_view(view
)->gpu
;
67 struct tegra_transfer
{
68 struct pipe_transfer base
;
69 struct pipe_transfer
*gpu
;
75 static inline struct tegra_transfer
*
76 to_tegra_transfer(struct pipe_transfer
*transfer
)
78 return (struct tegra_transfer
*)transfer
;
81 #endif /* TEGRA_SCREEN_H */