Path: blob/21.2-virgl/src/gallium/auxiliary/vl/vl_winsys.h
4565 views
/**************************************************************************1*2* Copyright 2009 Younes Manton.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/*28* Target makefiles directly refer to vl_winsys_dri.c to avoid DRI dependency29*/3031#ifndef vl_winsys_h32#define vl_winsys_h3334#ifdef HAVE_X11_PLATFORM35#include <X11/Xlib.h>36#endif37#include "pipe/p_defines.h"38#include "pipe/p_format.h"3940struct pipe_screen;41struct pipe_surface;42struct pipe_loader_device;4344struct vl_screen45{46void (*destroy)(struct vl_screen *vscreen);4748struct pipe_resource *49(*texture_from_drawable)(struct vl_screen *vscreen, void *drawable);5051struct u_rect *52(*get_dirty_area)(struct vl_screen *vscreen);5354uint64_t55(*get_timestamp)(struct vl_screen *vscreen, void *drawable);5657void58(*set_next_timestamp)(struct vl_screen *vscreen, uint64_t stamp);5960void *61(*get_private)(struct vl_screen *vscreen);6263void64(*set_back_texture_from_output)(struct vl_screen *vscreen,65struct pipe_resource *buffer,66uint32_t width, uint32_t height);6768struct pipe_screen *pscreen;69struct pipe_loader_device *dev;7071void *xcb_screen;72uint32_t color_depth;73};7475#ifdef HAVE_X11_PLATFORM76uint32_t77vl_dri2_format_for_depth(struct vl_screen *vscreen, int depth);7879struct vl_screen *80vl_dri2_screen_create(Display *display, int screen);81#else82static inline struct vl_screen *83vl_dri2_screen_create(void *display, int screen) { return NULL; };84#endif8586#if defined(HAVE_X11_PLATFORM) && defined(HAVE_DRI3)87struct vl_screen *88vl_dri3_screen_create(Display *display, int screen);89#else90static inline struct vl_screen *91vl_dri3_screen_create(void *display, int screen) { return NULL; };92#endif9394/* Always enable the DRM vl winsys */95struct vl_screen *96vl_drm_screen_create(int fd);9798#endif99100101