Path: blob/21.2-virgl/src/gallium/frontends/dri/dri_context.h
4565 views
/**************************************************************************1*2* Copyright (C) 2009 VMware, Inc.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**************************************************************************/26/*27* Author: Keith Whitwell <[email protected]>28* Author: Jakob Bornecrantz <[email protected]>29*/3031#ifndef DRI_CONTEXT_H32#define DRI_CONTEXT_H3334#include "dri_util.h"35#include "pipe/p_compiler.h"36#include "hud/hud_context.h"3738struct pipe_context;39struct pipe_fence;40struct st_api;41struct st_context_iface;42struct dri_drawable;4344struct dri_context45{46/* dri */47__DRIscreen *sPriv;48__DRIcontext *cPriv;49__DRIdrawable *dPriv;50__DRIdrawable *rPriv;5152unsigned int bind_count;5354/**55* True if the __DRIdrawable's current __DRIimageBufferMask is56* __DRI_IMAGE_BUFFER_SHARED.57*/58bool is_shared_buffer_bound;5960/* gallium */61struct st_api *stapi;62struct st_context_iface *st;63struct pp_queue_t *pp;64struct hud_context *hud;65};6667static inline struct dri_context *68dri_context(__DRIcontext * driContextPriv)69{70if (!driContextPriv)71return NULL;72return (struct dri_context *)driContextPriv->driverPrivate;73}7475/***********************************************************************76* dri_context.c77*/78void dri_destroy_context(__DRIcontext * driContextPriv);7980boolean dri_unbind_context(__DRIcontext * driContextPriv);8182boolean83dri_make_current(__DRIcontext * driContextPriv,84__DRIdrawable * driDrawPriv,85__DRIdrawable * driReadPriv);8687struct dri_context *88dri_get_current(__DRIscreen * driScreenPriv);8990boolean91dri_create_context(gl_api api,92const struct gl_config * visual,93__DRIcontext * driContextPriv,94const struct __DriverContextConfig *ctx_config,95unsigned *error,96void *sharedContextPrivate);9798#endif99100/* vim: set sw=3 ts=8 sts=3 expandtab: */101102103