1bf215546Sopenharmony_ci/**************************************************************************
2bf215546Sopenharmony_ci *
3bf215546Sopenharmony_ci * Copyright (C) 2009 VMware, Inc.
4bf215546Sopenharmony_ci * All Rights Reserved.
5bf215546Sopenharmony_ci *
6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the
8bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including
9bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish,
10bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to
11bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to
12bf215546Sopenharmony_ci * the following conditions:
13bf215546Sopenharmony_ci *
14bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the
15bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions
16bf215546Sopenharmony_ci * of the Software.
17bf215546Sopenharmony_ci *
18bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20bf215546Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21bf215546Sopenharmony_ci * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22bf215546Sopenharmony_ci * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23bf215546Sopenharmony_ci * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24bf215546Sopenharmony_ci * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25bf215546Sopenharmony_ci *
26bf215546Sopenharmony_ci **************************************************************************/
27bf215546Sopenharmony_ci/*
28bf215546Sopenharmony_ci * Author: Keith Whitwell <keithw@vmware.com>
29bf215546Sopenharmony_ci * Author: Jakob Bornecrantz <wallbraker@gmail.com>
30bf215546Sopenharmony_ci */
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci#ifndef DRI_CONTEXT_H
33bf215546Sopenharmony_ci#define DRI_CONTEXT_H
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci#include "dri_util.h"
36bf215546Sopenharmony_ci#include "pipe/p_compiler.h"
37bf215546Sopenharmony_ci#include "hud/hud_context.h"
38bf215546Sopenharmony_ci
39bf215546Sopenharmony_cistruct pipe_context;
40bf215546Sopenharmony_cistruct pipe_fence;
41bf215546Sopenharmony_cistruct st_api;
42bf215546Sopenharmony_cistruct st_context_iface;
43bf215546Sopenharmony_cistruct dri_drawable;
44bf215546Sopenharmony_ci
45bf215546Sopenharmony_cistruct dri_context
46bf215546Sopenharmony_ci{
47bf215546Sopenharmony_ci   /* dri */
48bf215546Sopenharmony_ci   __DRIscreen *sPriv;
49bf215546Sopenharmony_ci   __DRIcontext *cPriv;
50bf215546Sopenharmony_ci   __DRIdrawable *dPriv;
51bf215546Sopenharmony_ci   __DRIdrawable *rPriv;
52bf215546Sopenharmony_ci
53bf215546Sopenharmony_ci   /**
54bf215546Sopenharmony_ci    * True if the __DRIdrawable's current __DRIimageBufferMask is
55bf215546Sopenharmony_ci    * __DRI_IMAGE_BUFFER_SHARED.
56bf215546Sopenharmony_ci    */
57bf215546Sopenharmony_ci   bool is_shared_buffer_bound;
58bf215546Sopenharmony_ci
59bf215546Sopenharmony_ci   /* gallium */
60bf215546Sopenharmony_ci   struct st_api *stapi;
61bf215546Sopenharmony_ci   struct st_context_iface *st;
62bf215546Sopenharmony_ci   struct pp_queue_t *pp;
63bf215546Sopenharmony_ci   struct hud_context *hud;
64bf215546Sopenharmony_ci};
65bf215546Sopenharmony_ci
66bf215546Sopenharmony_cistatic inline struct dri_context *
67bf215546Sopenharmony_cidri_context(__DRIcontext * driContextPriv)
68bf215546Sopenharmony_ci{
69bf215546Sopenharmony_ci   if (!driContextPriv)
70bf215546Sopenharmony_ci     return NULL;
71bf215546Sopenharmony_ci   return (struct dri_context *)driContextPriv->driverPrivate;
72bf215546Sopenharmony_ci}
73bf215546Sopenharmony_ci
74bf215546Sopenharmony_ci/***********************************************************************
75bf215546Sopenharmony_ci * dri_context.c
76bf215546Sopenharmony_ci */
77bf215546Sopenharmony_civoid dri_destroy_context(__DRIcontext * driContextPriv);
78bf215546Sopenharmony_ci
79bf215546Sopenharmony_ciboolean dri_unbind_context(__DRIcontext * driContextPriv);
80bf215546Sopenharmony_ci
81bf215546Sopenharmony_ciboolean
82bf215546Sopenharmony_cidri_make_current(__DRIcontext * driContextPriv,
83bf215546Sopenharmony_ci		 __DRIdrawable * driDrawPriv,
84bf215546Sopenharmony_ci		 __DRIdrawable * driReadPriv);
85bf215546Sopenharmony_ci
86bf215546Sopenharmony_cistruct dri_context *
87bf215546Sopenharmony_cidri_get_current(__DRIscreen * driScreenPriv);
88bf215546Sopenharmony_ci
89bf215546Sopenharmony_ciboolean
90bf215546Sopenharmony_cidri_create_context(gl_api api,
91bf215546Sopenharmony_ci                   const struct gl_config * visual,
92bf215546Sopenharmony_ci                   __DRIcontext * driContextPriv,
93bf215546Sopenharmony_ci                   const struct __DriverContextConfig *ctx_config,
94bf215546Sopenharmony_ci                   unsigned *error,
95bf215546Sopenharmony_ci                   void *sharedContextPrivate);
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_ci#endif
98bf215546Sopenharmony_ci
99bf215546Sopenharmony_ci/* vim: set sw=3 ts=8 sts=3 expandtab: */
100