diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2016-02-10 09:34:34 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-03-11 13:14:32 -0500 |
commit | 349b71a37e4a87e3650b5c0df9651b2ce967293e (patch) | |
tree | 531ecde897487b9192e48027583b81e5b4872de1 /include | |
parent | 860669b1867178fe46df9da98591ea5a47f427f1 (diff) |
vidmode: move to a separate library of its own
XVidMode extension might be useful to non hardware servers as well (e.g.
Xwayand) so that applications that rely on it (e.g. lot of older games)
can at least have read access to XVidMode.
But the implementation is very XFree86 centric, so the idea is to add
a bunch of vfunc that other non-XFree86 servers can hook up into to
provide a similar functionality.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit f175cf45aebcdda53f3ae49c0eaf27da1f194e92)
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 1 | ||||
-rw-r--r-- | include/vidmodestr.h | 140 |
2 files changed, 141 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 4c8ea6a2a..b9cf584cb 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -76,4 +76,5 @@ EXTRA_DIST = \ swaprep.h \ swapreq.h \ systemd-logind.h \ + vidmodestr.h \ xsha1.h diff --git a/include/vidmodestr.h b/include/vidmodestr.h new file mode 100644 index 000000000..3a4418501 --- /dev/null +++ b/include/vidmodestr.h @@ -0,0 +1,140 @@ +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +#ifndef _VIDMODEPROC_H_ +#define _VIDMODEPROC_H_ + +#include "displaymode.h" + +typedef enum { + VIDMODE_H_DISPLAY, + VIDMODE_H_SYNCSTART, + VIDMODE_H_SYNCEND, + VIDMODE_H_TOTAL, + VIDMODE_H_SKEW, + VIDMODE_V_DISPLAY, + VIDMODE_V_SYNCSTART, + VIDMODE_V_SYNCEND, + VIDMODE_V_TOTAL, + VIDMODE_FLAGS, + VIDMODE_CLOCK +} VidModeSelectMode; + +typedef enum { + VIDMODE_MON_VENDOR, + VIDMODE_MON_MODEL, + VIDMODE_MON_NHSYNC, + VIDMODE_MON_NVREFRESH, + VIDMODE_MON_HSYNC_LO, + VIDMODE_MON_HSYNC_HI, + VIDMODE_MON_VREFRESH_LO, + VIDMODE_MON_VREFRESH_HI +} VidModeSelectMonitor; + +typedef union { + const void *ptr; + int i; + float f; +} vidMonitorValue; + +typedef Bool (*VidModeExtensionInitProcPtr) (ScreenPtr pScreen); +typedef vidMonitorValue (*VidModeGetMonitorValueProcPtr) (ScreenPtr pScreen, + int valtyp, + int indx); +typedef Bool (*VidModeGetEnabledProcPtr) (void); +typedef Bool (*VidModeGetAllowNonLocalProcPtr) (void); +typedef Bool (*VidModeGetCurrentModelineProcPtr) (ScreenPtr pScreen, + DisplayModePtr *mode, + int *dotClock); +typedef Bool (*VidModeGetFirstModelineProcPtr) (ScreenPtr pScreen, + DisplayModePtr *mode, + int *dotClock); +typedef Bool (*VidModeGetNextModelineProcPtr) (ScreenPtr pScreen, + DisplayModePtr *mode, + int *dotClock); +typedef Bool (*VidModeDeleteModelineProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef Bool (*VidModeZoomViewportProcPtr) (ScreenPtr pScreen, + int zoom); +typedef Bool (*VidModeGetViewPortProcPtr) (ScreenPtr pScreen, + int *x, + int *y); +typedef Bool (*VidModeSetViewPortProcPtr) (ScreenPtr pScreen, + int x, + int y); +typedef Bool (*VidModeSwitchModeProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef Bool (*VidModeLockZoomProcPtr) (ScreenPtr pScreen, + Bool lock); +typedef int (*VidModeGetNumOfClocksProcPtr) (ScreenPtr pScreen, + Bool *progClock); +typedef Bool (*VidModeGetClocksProcPtr) (ScreenPtr pScreen, + int *Clocks); +typedef ModeStatus (*VidModeCheckModeForMonitorProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef ModeStatus (*VidModeCheckModeForDriverProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef void (*VidModeSetCrtcForModeProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef Bool (*VidModeAddModelineProcPtr) (ScreenPtr pScreen, + DisplayModePtr mode); +typedef int (*VidModeGetDotClockProcPtr) (ScreenPtr pScreen, + int Clock); +typedef int (*VidModeGetNumOfModesProcPtr) (ScreenPtr pScreen); +typedef Bool (*VidModeSetGammaProcPtr) (ScreenPtr pScreen, + float red, + float green, + float blue); +typedef Bool (*VidModeGetGammaProcPtr) (ScreenPtr pScreen, + float *red, + float *green, + float *blue); +typedef Bool (*VidModeSetGammaRampProcPtr) (ScreenPtr pScreen, + int size, + CARD16 *red, + CARD16 *green, + CARD16 *blue); +typedef Bool (*VidModeGetGammaRampProcPtr) (ScreenPtr pScreen, + int size, + CARD16 *red, + CARD16 *green, + CARD16 *blue); +typedef int (*VidModeGetGammaRampSizeProcPtr) (ScreenPtr pScreen); + +typedef struct { + DisplayModePtr First; + DisplayModePtr Next; + int Flags; + + VidModeExtensionInitProcPtr ExtensionInit; + VidModeGetMonitorValueProcPtr GetMonitorValue; + VidModeGetCurrentModelineProcPtr GetCurrentModeline; + VidModeGetFirstModelineProcPtr GetFirstModeline; + VidModeGetNextModelineProcPtr GetNextModeline; + VidModeDeleteModelineProcPtr DeleteModeline; + VidModeZoomViewportProcPtr ZoomViewport; + VidModeGetViewPortProcPtr GetViewPort; + VidModeSetViewPortProcPtr SetViewPort; + VidModeSwitchModeProcPtr SwitchMode; + VidModeLockZoomProcPtr LockZoom; + VidModeGetNumOfClocksProcPtr GetNumOfClocks; + VidModeGetClocksProcPtr GetClocks; + VidModeCheckModeForMonitorProcPtr CheckModeForMonitor; + VidModeCheckModeForDriverProcPtr CheckModeForDriver; + VidModeSetCrtcForModeProcPtr SetCrtcForMode; + VidModeAddModelineProcPtr AddModeline; + VidModeGetDotClockProcPtr GetDotClock; + VidModeGetNumOfModesProcPtr GetNumOfModes; + VidModeSetGammaProcPtr SetGamma; + VidModeGetGammaProcPtr GetGamma; + VidModeSetGammaRampProcPtr SetGammaRamp; + VidModeGetGammaRampProcPtr GetGammaRamp; + VidModeGetGammaRampSizeProcPtr GetGammaRampSize; +} VidModeRec, *VidModePtr; + +void VidModeAddExtension(Bool allow_non_local); +VidModePtr VidModeGetPtr(ScreenPtr pScreen); +VidModePtr VidModeInit(ScreenPtr pScreen); + +#endif |