summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86vmode.c
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-02-05 09:48:18 +0100
committerAdam Jackson <ajax@redhat.com>2016-02-29 16:28:52 -0500
commit12f714fd95dc9d912c0bf2524005a73ec6e8ee4f (patch)
tree4cc7a3ff968f45e791672ea2f3befcc8ed24cf10 /hw/xfree86/common/xf86vmode.c
parentf6f7e21133c13c34f306a191137d566e83b40929 (diff)
vidmode: remove VidModeGetMonitor()
VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to get a untyped monitor pointer that is passed back straight again to VidModeGetMonitorValue(). This is actually useless as VidModeGetMonitorValue() could as well get the monitor from the ScreenPtr just like VidModeGetMonitor() does. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Diffstat (limited to 'hw/xfree86/common/xf86vmode.c')
-rw-r--r--hw/xfree86/common/xf86vmode.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/hw/xfree86/common/xf86vmode.c b/hw/xfree86/common/xf86vmode.c
index 3a2df590b..d4f023409 100644
--- a/hw/xfree86/common/xf86vmode.c
+++ b/hw/xfree86/common/xf86vmode.c
@@ -1029,7 +1029,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
};
CARD32 *hsyncdata, *vsyncdata;
int i, nHsync, nVrefresh;
- void *monitor;
ScreenPtr pScreen;
DEBUG_P("XF86VidModeGetMonitor");
@@ -1040,20 +1039,17 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
return BadValue;
pScreen = screenInfo.screens[stuff->screen];
- if (!VidModeGetMonitor(pScreen, &monitor))
- return BadValue;
-
- nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
- nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
+ nHsync = VidModeGetMonitorValue(pScreen, VIDMODE_MON_NHSYNC, 0).i;
+ nVrefresh = VidModeGetMonitorValue(pScreen, VIDMODE_MON_NVREFRESH, 0).i;
- if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
- rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(monitor,
+ if ((char *) (VidModeGetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr)
+ rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(pScreen,
VIDMODE_MON_VENDOR,
0)).ptr);
else
rep.vendorLength = 0;
- if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr)
- rep.modelLength = strlen((char *) (VidModeGetMonitorValue(monitor,
+ if ((char *) (VidModeGetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr)
+ rep.modelLength = strlen((char *) (VidModeGetMonitorValue(pScreen,
VIDMODE_MON_MODEL,
0)).ptr);
else
@@ -1078,19 +1074,19 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
}
for (i = 0; i < nHsync; i++) {
- hsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
+ hsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(pScreen,
VIDMODE_MON_HSYNC_LO,
i)).f |
(unsigned
- short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_HSYNC_HI,
+ short) (VidModeGetMonitorValue(pScreen, VIDMODE_MON_HSYNC_HI,
i)).f << 16;
}
for (i = 0; i < nVrefresh; i++) {
- vsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(monitor,
+ vsyncdata[i] = (unsigned short) (VidModeGetMonitorValue(pScreen,
VIDMODE_MON_VREFRESH_LO,
i)).f |
(unsigned
- short) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VREFRESH_HI,
+ short) (VidModeGetMonitorValue(pScreen, VIDMODE_MON_VREFRESH_HI,
i)).f << 16;
}
@@ -1104,10 +1100,10 @@ ProcXF86VidModeGetMonitor(ClientPtr client)
WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32), vsyncdata);
if (rep.vendorLength)
WriteToClient(client, rep.vendorLength,
- (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
+ (VidModeGetMonitorValue(pScreen, VIDMODE_MON_VENDOR, 0)).ptr);
if (rep.modelLength)
WriteToClient(client, rep.modelLength,
- (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
+ (VidModeGetMonitorValue(pScreen, VIDMODE_MON_MODEL, 0)).ptr);
free(hsyncdata);
free(vsyncdata);