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