diff --git a/Xext/vidmode.c b/Xext/vidmode.c index 8b72e5de2..12dbe71f3 100644 --- a/Xext/vidmode.c +++ b/Xext/vidmode.c @@ -435,6 +435,8 @@ ProcVidModeGetAllModeLines(ClientPtr client) && VidModeGetModeValue(mode, VIDMODE_V_TOTAL) == stuff->vtotal \ && VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags ) +static int VidModeAddModeLine(ClientPtr client, xXF86VidModeAddModeLineReq* stuff); + static int ProcVidModeAddModeLine(ClientPtr client) { @@ -442,11 +444,7 @@ ProcVidModeAddModeLine(ClientPtr client) xXF86OldVidModeAddModeLineReq *oldstuff = (xXF86OldVidModeAddModeLineReq *) client->requestBuffer; xXF86VidModeAddModeLineReq newstuff; - ScreenPtr pScreen; - VidModePtr pVidMode; - DisplayModePtr mode; int len; - int dotClock; int ver; /* limited to local-only connections */ @@ -503,6 +501,16 @@ ProcVidModeAddModeLine(ClientPtr client) stuff->after_vtotal = oldstuff->after_vtotal; stuff->after_flags = oldstuff->after_flags; } + return VidModeAddModeLine(client, stuff); +} + +static int VidModeAddModeLine(ClientPtr client, xXF86VidModeAddModeLineReq* stuff) +{ + ScreenPtr pScreen; + DisplayModePtr mode; + VidModePtr pVidMode; + int dotClock; + DebugF("AddModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); DebugF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -611,6 +619,9 @@ ProcVidModeAddModeLine(ClientPtr client) return Success; } +static int +VidModeDeleteModeLine(ClientPtr client, xXF86VidModeDeleteModeLineReq* stuff); + static int ProcVidModeDeleteModeLine(ClientPtr client) { @@ -618,10 +629,7 @@ ProcVidModeDeleteModeLine(ClientPtr client) xXF86OldVidModeDeleteModeLineReq *oldstuff = (xXF86OldVidModeDeleteModeLineReq *) client->requestBuffer; xXF86VidModeDeleteModeLineReq newstuff; - ScreenPtr pScreen; - VidModePtr pVidMode; - DisplayModePtr mode; - int len, dotClock; + int len; int ver; /* limited to local-only connections */ @@ -679,6 +687,17 @@ ProcVidModeDeleteModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } + return VidModeDeleteModeLine(client, stuff); +} + +static int +VidModeDeleteModeLine(ClientPtr client, xXF86VidModeDeleteModeLineReq* stuff) +{ + int dotClock; + DisplayModePtr mode; + VidModePtr pVidMode; + ScreenPtr pScreen; + DebugF("DeleteModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); DebugF(" hdsp: %d hbeg: %d hend: %d httl: %d\n", @@ -746,6 +765,9 @@ ProcVidModeDeleteModeLine(ClientPtr client) return BadValue; } +static int +VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff); + static int ProcVidModeModModeLine(ClientPtr client) { @@ -753,10 +775,7 @@ ProcVidModeModModeLine(ClientPtr client) xXF86OldVidModeModModeLineReq *oldstuff = (xXF86OldVidModeModModeLineReq *) client->requestBuffer; xXF86VidModeModModeLineReq newstuff; - ScreenPtr pScreen; - VidModePtr pVidMode; - DisplayModePtr mode, modetmp; - int len, dotClock; + int len; int ver; /* limited to local-only connections */ @@ -801,6 +820,17 @@ ProcVidModeModModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } + return VidModeModModeLine(client, stuff); +} + +static int +VidModeModModeLine(ClientPtr client, xXF86VidModeModModeLineReq *stuff) +{ + ScreenPtr pScreen; + VidModePtr pVidMode; + DisplayModePtr mode, modetmp; + int dotClock; + DebugF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n", (int) stuff->screen, stuff->hdisplay, stuff->hsyncstart, stuff->hsyncend, stuff->htotal); @@ -885,6 +915,9 @@ ProcVidModeModModeLine(ClientPtr client) return Success; } +static int +VidModeValidateModeLine(ClientPtr client, xXF86VidModeValidateModeLineReq *stuff); + static int ProcVidModeValidateModeLine(ClientPtr client) { @@ -892,11 +925,7 @@ ProcVidModeValidateModeLine(ClientPtr client) xXF86OldVidModeValidateModeLineReq *oldstuff = (xXF86OldVidModeValidateModeLineReq *) client->requestBuffer; xXF86VidModeValidateModeLineReq newstuff; - xXF86VidModeValidateModeLineReply rep; - ScreenPtr pScreen; - VidModePtr pVidMode; - DisplayModePtr mode, modetmp = NULL; - int len, status, dotClock; + int len; int ver; DEBUG_P("XF86VidModeValidateModeline"); @@ -937,6 +966,17 @@ ProcVidModeValidateModeLine(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } + return VidModeValidateModeLine(client, stuff); +} + +static int +VidModeValidateModeLine(ClientPtr client, xXF86VidModeValidateModeLineReq *stuff) +{ + ScreenPtr pScreen; + VidModePtr pVidMode; + DisplayModePtr mode, modetmp = NULL; + int status, dotClock; + xXF86VidModeValidateModeLineReply rep = { 0 }; DebugF("ValidateModeLine - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock); @@ -947,9 +987,6 @@ ProcVidModeValidateModeLine(ClientPtr client) stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend, stuff->vtotal, (unsigned long) stuff->flags); - if (len != stuff->privsize) - return BadLength; - if (stuff->screen >= screenInfo.numScreens) return BadValue; pScreen = screenInfo.screens[stuff->screen]; @@ -1046,6 +1083,9 @@ ProcVidModeSwitchMode(ClientPtr client) return Success; } +static int +VidModeSwitchToMode(ClientPtr client, xXF86VidModeSwitchToModeReq *stuff); + static int ProcVidModeSwitchToMode(ClientPtr client) { @@ -1053,10 +1093,7 @@ ProcVidModeSwitchToMode(ClientPtr client) xXF86OldVidModeSwitchToModeReq *oldstuff = (xXF86OldVidModeSwitchToModeReq *) client->requestBuffer; xXF86VidModeSwitchToModeReq newstuff; - ScreenPtr pScreen; - VidModePtr pVidMode; - DisplayModePtr mode; - int len, dotClock; + int len; int ver; DEBUG_P("XF86VidModeSwitchToMode"); @@ -1102,6 +1139,16 @@ ProcVidModeSwitchToMode(ClientPtr client) stuff->flags = oldstuff->flags; stuff->privsize = oldstuff->privsize; } + return VidModeSwitchToMode(client, stuff); +} + +static int +VidModeSwitchToMode(ClientPtr client, xXF86VidModeSwitchToModeReq *stuff) +{ + ScreenPtr pScreen; + VidModePtr pVidMode; + DisplayModePtr mode; + int dotClock; DebugF("SwitchToMode - scrn: %d clock: %ld\n", (int) stuff->screen, (unsigned long) stuff->dotclock);