xfree86: Remove xf86CheckMTRR

Die die die die die.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2014-05-02 12:58:23 -04:00
parent 8686463de7
commit c42712ab4d
2 changed files with 0 additions and 83 deletions

View File

@ -42,72 +42,7 @@
* This file contains the common part of the video memory mapping functions
*/
/*
* Get a piece of the ScrnInfoRec. At the moment, this is only used to hold
* the MTRR option information, but it is likely to be expanded if we do
* auto unmapping of memory at VT switch.
*
*/
typedef struct {
Bool mtrrEnabled;
MessageType mtrrFrom;
Bool mtrrOptChecked;
ScrnInfoPtr pScrn;
} VidMapRec, *VidMapPtr;
static int vidMapIndex = -1;
#define VIDMAPPTR(p) ((VidMapPtr)((p)->privates[vidMapIndex].ptr))
static VidMemInfo vidMemInfo = { FALSE, };
static VidMapRec vidMapRec = { TRUE, X_DEFAULT, FALSE, NULL };
static VidMapPtr
getVidMapRec(int scrnIndex)
{
VidMapPtr vp;
ScrnInfoPtr pScrn;
if ((scrnIndex < 0) || !(pScrn = xf86Screens[scrnIndex]))
return &vidMapRec;
if (vidMapIndex < 0)
vidMapIndex = xf86AllocateScrnInfoPrivateIndex();
if (VIDMAPPTR(pScrn) != NULL)
return VIDMAPPTR(pScrn);
vp = pScrn->privates[vidMapIndex].ptr = xnfcalloc(sizeof(VidMapRec), 1);
vp->mtrrEnabled = TRUE; /* default to enabled */
vp->mtrrFrom = X_DEFAULT;
vp->mtrrOptChecked = FALSE;
vp->pScrn = pScrn;
return vp;
}
enum { OPTION_MTRR };
static const OptionInfoRec opts[] = {
{OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE},
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
static void
checkMtrrOption(VidMapPtr vp)
{
if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) {
OptionInfoPtr options;
options = xnfalloc(sizeof(opts));
(void) memcpy(options, opts, sizeof(opts));
xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options, options);
if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled))
vp->mtrrFrom = X_CONFIG;
free(options);
vp->mtrrOptChecked = TRUE;
}
}
void
xf86InitVidMem(void)
@ -117,20 +52,3 @@ xf86InitVidMem(void)
xf86OSInitVidMem(&vidMemInfo);
}
}
Bool
xf86CheckMTRR(int ScreenNum)
{
VidMapPtr vp = getVidMapRec(ScreenNum);
/*
* Check the "mtrr" option even when MTRR isn't supported to avoid
* warnings about unrecognised options.
*/
checkMtrrOption(vp);
if (vp->mtrrEnabled)
return TRUE;
return FALSE;
}

View File

@ -112,7 +112,6 @@
_XFUNCPROTOBEGIN
/* public functions */
extern _X_EXPORT _X_DEPRECATED Bool xf86CheckMTRR(int);
extern _X_EXPORT Bool xf86EnableIO(void);
extern _X_EXPORT void xf86DisableIO(void);