3 * \brief DRI utility functions definitions.
5 * This module acts as glue between GLX and the actual hardware driver. A DRI
6 * driver doesn't really \e have to use any of this - it's optional. But, some
7 * useful stuff is done here that otherwise would have to be duplicated in most
10 * Basically, these utility functions take care of some of the dirty details of
11 * screen initialization, context creation, context binding, DRM setup, etc.
13 * These functions are compiled into each DRI driver so libGL.so knows nothing
16 * Look for more comments in the dri_util.c file.
18 * \author Kevin E. Martin <kevin@precisioninsight.com>
19 * \author Brian Paul <brian@precisioninsight.com>
23 * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
24 * All Rights Reserved.
26 * Permission is hereby granted, free of charge, to any person obtaining a
27 * copy of this software and associated documentation files (the
28 * "Software"), to deal in the Software without restriction, including
29 * without limitation the rights to use, copy, modify, merge, publish,
30 * distribute, sub license, and/or sell copies of the Software, and to
31 * permit persons to whom the Software is furnished to do so, subject to
32 * the following conditions:
34 * The above copyright notice and this permission notice (including the
35 * next paragraph) shall be included in all copies or substantial portions
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
39 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
41 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
42 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
43 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
44 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 #define CAPI /* XXX this should be globally defined somewhere */
53 #include "GL/internal/glcore.h"
56 #include "drm_sarea.h"
59 * \brief DRIDriverContext type.
61 typedef struct DRIDriverContextRec
{
72 int colorTiling
; /**< \brief color tiling is enabled */
74 unsigned long FBStart
; /**< \brief physical address of the framebuffer */
75 unsigned long MMIOStart
; /**< \brief physical address of the MMIO region */
77 int FBSize
; /**< \brief size of the mmap'd framebuffer in bytes */
78 int MMIOSize
; /**< \brief size of the mmap'd MMIO region in bytes */
80 void *FBAddress
; /**< \brief start of the mmap'd framebuffer */
81 void *MMIOAddress
; /**< \brief start of the mmap'd MMIO region */
84 * \brief Client configuration details
86 * These are computed on the server and sent to clients as part of
87 * the initial handshaking.
92 drm_handle_t hFrameBuffer
;
101 * \name From DRIInfoRec
104 int drmFD
; /**< \brief DRM device file descriptor */
106 unsigned int serverContext
; /**< \brief DRM context only active on server */
111 * \name Driver private
113 * Populated by __driInitFBDev()
117 void *driverClientMsg
;
118 int driverClientMsgSize
;
123 * \brief Interface to the DRI driver.
125 * This structure is retrieved from the loadable driver by the \e
126 * __driDriver symbol to access the Mini GLX specific hardware
127 * initialization and take down routines.
129 typedef struct DRIDriverRec
{
131 * \brief Validate the framebuffer device mode
133 int (*validateMode
)( const DRIDriverContext
*context
);
136 * \brief Examine mode returned by fbdev (may differ from the one
137 * requested), restore any hw regs clobbered by fbdev.
139 int (*postValidateMode
)( const DRIDriverContext
*context
);
142 * \brief Initialize the framebuffer device.
144 int (*initFBDev
)( DRIDriverContext
*context
);
147 * \brief Halt the framebuffer device.
149 void (*haltFBDev
)( DRIDriverContext
*context
);
153 * \brief Idle and shutdown hardware in preparation for a VT switch.
155 int (*shutdownHardware
)( const DRIDriverContext
*context
);
158 * \brief Restore hardware state after regaining the VT.
160 int (*restoreHardware
)( const DRIDriverContext
*context
);
163 * \brief Notify hardware driver of gain/loose focus. May be zero
164 * as this is of limited utility for most drivers.
166 void (*notifyFocus
)( int have_focus
);
169 #endif /* _driver_H_ */