1cdc920a0Smrg/*
2cdc920a0Smrg * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
3cdc920a0Smrg * Copyright © 2008 Red Hat, Inc.
4cdc920a0Smrg *
5cdc920a0Smrg * Permission is hereby granted, free of charge, to any person obtaining a
6cdc920a0Smrg * copy of this software and associated documentation files (the "Soft-
7cdc920a0Smrg * ware"), to deal in the Software without restriction, including without
8cdc920a0Smrg * limitation the rights to use, copy, modify, merge, publish, distribute,
9cdc920a0Smrg * and/or sell copies of the Software, and to permit persons to whom the
10cdc920a0Smrg * Software is furnished to do so, provided that the above copyright
11cdc920a0Smrg * notice(s) and this permission notice appear in all copies of the Soft-
12cdc920a0Smrg * ware and that both the above copyright notice(s) and this permission
13cdc920a0Smrg * notice appear in supporting documentation.
14cdc920a0Smrg *
15cdc920a0Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16cdc920a0Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
17cdc920a0Smrg * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
18cdc920a0Smrg * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
19cdc920a0Smrg * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
20cdc920a0Smrg * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21cdc920a0Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22cdc920a0Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
23cdc920a0Smrg * MANCE OF THIS SOFTWARE.
24cdc920a0Smrg *
25cdc920a0Smrg * Except as contained in this notice, the name of a copyright holder shall
26cdc920a0Smrg * not be used in advertising or otherwise to promote the sale, use or
27cdc920a0Smrg * other dealings in this Software without prior written authorization of
28cdc920a0Smrg * the copyright holder.
29cdc920a0Smrg *
30cdc920a0Smrg * Authors:
31cdc920a0Smrg *   Kevin E. Martin <kevin@precisioninsight.com>
32cdc920a0Smrg *   Brian Paul <brian@precisioninsight.com>
33cdc920a0Smrg *   Kristian Høgsberg (krh@redhat.com)
34cdc920a0Smrg */
35cdc920a0Smrg
36cdc920a0Smrg#ifndef _DRI_COMMON_H
37cdc920a0Smrg#define _DRI_COMMON_H
38cdc920a0Smrg
397ec681f3Smrg#ifdef GLX_DIRECT_RENDERING
407ec681f3Smrg
413464ebd5Sriastradh#include <GL/internal/dri_interface.h>
42af69d88dSmrg#include <stdbool.h>
43af69d88dSmrg#include "loader.h"
4401e04c3fSmrg#include "util/macros.h" /* for PRINTFLIKE */
453464ebd5Sriastradh
46cdc920a0Smrgtypedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate;
47cdc920a0Smrg
48cdc920a0Smrgstruct __GLXDRIconfigPrivateRec
49cdc920a0Smrg{
503464ebd5Sriastradh   struct glx_config base;
51cdc920a0Smrg   const __DRIconfig *driConfig;
52cdc920a0Smrg};
53cdc920a0Smrg
543464ebd5Sriastradhextern struct glx_config *driConvertConfigs(const __DRIcoreExtension * core,
553464ebd5Sriastradh                                           struct glx_config * modes,
56cdc920a0Smrg                                           const __DRIconfig ** configs);
57cdc920a0Smrg
583464ebd5Sriastradhextern void driDestroyConfigs(const __DRIconfig **configs);
593464ebd5Sriastradh
603464ebd5Sriastradhextern __GLXDRIdrawable *
613464ebd5SriastradhdriFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable);
623464ebd5Sriastradh
633464ebd5Sriastradhextern void
643464ebd5SriastradhdriReleaseDrawables(struct glx_context *gc);
653464ebd5Sriastradh
669f464c52Smayaextern const __DRIextension **driOpenDriver(const char *driverName,
679f464c52Smaya                                            void **out_driver_handle);
68af69d88dSmrg
697ec681f3Smrgstruct dri_ctx_attribs {
707ec681f3Smrg   unsigned major_ver;
717ec681f3Smrg   unsigned minor_ver;
727ec681f3Smrg   uint32_t render_type;
737ec681f3Smrg   uint32_t flags;
747ec681f3Smrg   unsigned api;
757ec681f3Smrg   int reset;
767ec681f3Smrg   int release;
777ec681f3Smrg};
787ec681f3Smrg
797ec681f3Smrgextern int
807ec681f3Smrgdri_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs,
817ec681f3Smrg                        struct dri_ctx_attribs *dca);
82af69d88dSmrg
839f464c52Smayaextern bool
849f464c52Smayadri2_check_no_error(uint32_t flags, struct glx_context *share_context,
859f464c52Smaya                    int major, unsigned *error);
869f464c52Smaya
879f464c52Smaya
887ec681f3Smrgextern struct glx_context *
897ec681f3Smrgdri_common_create_context(struct glx_screen *base,
907ec681f3Smrg                          struct glx_config *config_base,
917ec681f3Smrg                          struct glx_context *shareList,
927ec681f3Smrg                          int renderType);
937ec681f3Smrg
947ec681f3Smrg#endif /* GLX_DIRECT_RENDERING */
957ec681f3Smrg
96cdc920a0Smrg#endif /* _DRI_COMMON_H */
97