vbeModes.h revision a5e7ae69e440f6816420fc99599f044e79e716b6
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright © 2002 David Dawes
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Permission is hereby granted, free of charge, to any person obtaining a
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * copy of this software and associated documentation files (the "Software"),
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * to deal in the Software without restriction, including without limitation
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * and/or sell copies of the Software, and to permit persons to whom the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Software is furnished to do so, subject to the following conditions:
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * The above copyright notice and this permission notice shall be included in
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * all copies or substantial portions of the Software.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * SOFTWARE.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync *
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Except as contained in this notice, the name of the author(s) shall
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * not be used in advertising or otherwise to promote the sale, use or other
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * dealings in this Software without prior written authorization from
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * the author(s).
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync *
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Authors: David Dawes <dawes@xfree86.org>
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#ifndef _VBE_MODES_H
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This is intended to be stored in the DisplayModeRec's private area.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * It includes all the information necessary to VBE information.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsynctypedef struct _VbeModeInfoData {
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync int mode;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync VbeModeInfoBlock *data;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync VbeCRTCInfoBlock *block;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync} VbeModeInfoData;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_1 0x001
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_4 0x002
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_8 0x004
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_15 0x008
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_16 0x010
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_24_24 0x020
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_24_32 0x040
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_24 (V_DEPTH_24_24 | V_DEPTH_24_32)
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_30 0x080
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define V_DEPTH_32 0x100
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync#define VBE_MODE_SUPPORTED(m) (((m)->ModeAttributes & 0x01) != 0)
#define VBE_MODE_COLOR(m) (((m)->ModeAttributes & 0x08) != 0)
#define VBE_MODE_GRAPHICS(m) (((m)->ModeAttributes & 0x10) != 0)
#define VBE_MODE_VGA(m) (((m)->ModeAttributes & 0x40) == 0)
#define VBE_MODE_LINEAR(m) (((m)->ModeAttributes & 0x80) != 0 && \
((m)->PhysBasePtr != 0))
#define VBE_MODE_USABLE(m, f) (VBE_MODE_SUPPORTED(m) || \
(f & V_MODETYPE_BAD)) && \
VBE_MODE_GRAPHICS(m) && \
(VBE_MODE_VGA(m) || VBE_MODE_LINEAR(m))
#define V_MODETYPE_VBE 0x01
#define V_MODETYPE_VGA 0x02
#define V_MODETYPE_BAD 0x04
extern _X_EXPORT int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock * vbe,
int *flags24, int modeTypes);
extern _X_EXPORT DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn,
vbeInfoPtr pVbe,
VbeInfoBlock * vbe,
int modeTypes);
extern _X_EXPORT void VBESetModeNames(DisplayModePtr pMode);
extern _X_EXPORT void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe);
/*
* Note: These are alternatives to the standard helpers. They should
* usually just wrap the standard helpers.
*/
extern _X_EXPORT int VBEValidateModes(ScrnInfoPtr scrp,
DisplayModePtr availModes,
const char **modeNames,
ClockRangePtr clockRanges,
int *linePitches, int minPitch,
int maxPitch, int pitchInc, int minHeight,
int maxHeight, int virtualX, int virtualY,
int apertureSize,
LookupModeFlags strategy);
extern _X_EXPORT void VBEPrintModes(ScrnInfoPtr scrp);
#endif /* VBE_MODES_H */