62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste/*
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Copyright © 2006 Intel Corporation
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste *
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Permission is hereby granted, free of charge, to any person obtaining a
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * copy of this software and associated documentation files (the "Software"),
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * to deal in the Software without restriction, including without limitation
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * the rights to use, copy, modify, merge, publish, distribute, sublicense,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * and/or sell copies of the Software, and to permit persons to whom the
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Software is furnished to do so, subject to the following conditions:
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste *
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * The above copyright notice and this permission notice (including the next
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * paragraph) shall be included in all copies or substantial portions of the
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Software.
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste *
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * SOFTWARE.
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste *
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Authors:
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste * Eric Anholt <eric@anholt.net>
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste *
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste */
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#ifndef _XF86MODES_H_
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#define _XF86MODES_H_
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include <stddef.h>
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include <string.h>
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include <stdio.h>
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include "xf86.h"
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include "xorgVersion.h"
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include "edid.h"
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste#include "xf86Parser.h"
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT double xf86ModeHSync(const DisplayModeRec * mode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT double xf86ModeVRefresh(const DisplayModeRec * mode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT int
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste xf86ModeWidth(const DisplayModeRec * mode, Rotation rotation);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT int
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste xf86ModeHeight(const DisplayModeRec * mode, Rotation rotation);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec * pMode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste DisplayModePtr modeList);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT Bool xf86ModesEqual(const DisplayModeRec * pMode1,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste const DisplayModeRec * pMode2);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT void xf86PrintModeline(int scrnIndex, DisplayModePtr mode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste DisplayModePtr new);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste float VRefresh, Bool Reduced,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste Bool Interlaced);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT DisplayModePtr xf86GTFMode(int h_pixels, int v_lines,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste float freq, int interlaced,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste int margins);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT Bool
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste xf86ModeIsReduced(const DisplayModeRec * mode);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT void
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, int flags);
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joosteextern _X_EXPORT void
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste
62639ee1329be2d687701dfa01fc006314440bf7Jaco Joostexf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList,
62639ee1329be2d687701dfa01fc006314440bf7Jaco Jooste int *min, int *max, int n_ranges);
extern _X_EXPORT void
xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
int maxX, int maxY, int maxPitch);
extern _X_EXPORT void
xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, MonPtr mon);
extern _X_EXPORT void
xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
unsigned int bandwidth, int depth);
extern _X_EXPORT void
xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList);
extern _X_EXPORT void
xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr * modeList,
Bool verbose);
extern _X_EXPORT DisplayModePtr xf86PruneDuplicateModes(DisplayModePtr modes);
extern _X_EXPORT void
xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList);
extern _X_EXPORT DisplayModePtr
xf86GetMonitorModes(ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor);
extern _X_EXPORT DisplayModePtr xf86GetDefaultModes(void);
extern _X_EXPORT void
xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode);
extern _X_EXPORT void
xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC);
#endif /* _XF86MODES_H_ */