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