Path: blob/21.2-virgl/src/gallium/drivers/tegra/tegra_context.h
4570 views
/*1* Copyright © 2014-2018 NVIDIA Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef TEGRA_CONTEXT_H24#define TEGRA_CONTEXT_H2526#include "pipe/p_context.h"27#include "pipe/p_state.h"2829struct tegra_screen;3031struct tegra_context {32struct pipe_context base;33struct pipe_context *gpu;34};3536static inline struct tegra_context *37to_tegra_context(struct pipe_context *context)38{39return (struct tegra_context *)context;40}4142struct pipe_context *43tegra_screen_context_create(struct pipe_screen *pscreen, void *priv,44unsigned int flags);4546struct tegra_sampler_view {47struct pipe_sampler_view base;48struct pipe_sampler_view *gpu;49};5051static inline struct tegra_sampler_view *52to_tegra_sampler_view(struct pipe_sampler_view *view)53{54return (struct tegra_sampler_view *)view;55}5657static inline struct pipe_sampler_view *58tegra_sampler_view_unwrap(struct pipe_sampler_view *view)59{60if (!view)61return NULL;6263return to_tegra_sampler_view(view)->gpu;64}6566struct tegra_transfer {67struct pipe_transfer base;68struct pipe_transfer *gpu;6970unsigned int count;71void *map;72};7374static inline struct tegra_transfer *75to_tegra_transfer(struct pipe_transfer *transfer)76{77return (struct tegra_transfer *)transfer;78}7980#endif /* TEGRA_SCREEN_H */818283