Path: blob/21.2-virgl/src/gallium/drivers/virgl/virgl_screen.h
4570 views
/*1* Copyright 2014, 2015 Red Hat.2*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* on the rights to use, copy, modify, merge, publish, distribute, sub7* license, and/or sell copies of the Software, and to permit persons to whom8* the 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 NON-INFRINGEMENT. IN NO EVENT SHALL17* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,18* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR19* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE20* USE OR OTHER DEALINGS IN THE SOFTWARE.21*/22#ifndef VIRGL_H23#define VIRGL_H2425#include "pipe/p_screen.h"26#include "util/slab.h"27#include "util/disk_cache.h"28#include "virgl_winsys.h"2930enum virgl_debug_flags {31VIRGL_DEBUG_VERBOSE = 1 << 0,32VIRGL_DEBUG_TGSI = 1 << 1,33VIRGL_DEBUG_NO_EMULATE_BGRA = 1 << 2,34VIRGL_DEBUG_NO_BGRA_DEST_SWIZZLE = 1 << 3,35VIRGL_DEBUG_SYNC = 1 << 4,36VIRGL_DEBUG_XFER = 1 << 5,37};3839extern int virgl_debug;4041struct virgl_screen {42struct pipe_screen base;4344int refcnt;4546/* place for winsys to stash it's own stuff: */47void *winsys_priv;4849struct virgl_winsys *vws;5051struct virgl_drm_caps caps;5253struct slab_parent_pool transfer_pool;5455uint32_t sub_ctx_id;56bool tweak_gles_emulate_bgra;57bool tweak_gles_apply_bgra_dest_swizzle;58int32_t tweak_gles_tf3_value;5960struct disk_cache *disk_cache;61};626364static inline struct virgl_screen *65virgl_screen(struct pipe_screen *pipe)66{67return (struct virgl_screen *)pipe;68}6970bool71virgl_has_readback_format(struct pipe_screen *screen, enum virgl_formats fmt);7273/* GL_ARB_map_buffer_alignment requires 64 as the minimum alignment value. In74* addition to complying with the extension, a high enough alignment value is75* expected by various external GL clients. For example, wined3d doesn't like76* maps that don't have a 16 byte alignment.77*/78#define VIRGL_MAP_BUFFER_ALIGNMENT 647980#endif818283