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