summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfaith <faith>2000-10-25 20:35:22 +0000
committerfaith <faith>2000-10-25 20:35:22 +0000
commita8399aa72fc49ffed18541f3dd9a4ec4850b9324 (patch)
tree8b87b05a00a0f398d3633d9fb4e8b10f77621a22
parent7aaab2720edd097ae034dca9f253ba48b84a9298 (diff)
Added infrastructure for automatic fullscreen mode driver callbacks
Added examples of call backs to mga and tdfx ddx drivers
-rw-r--r--xc/programs/Xserver/hw/xfree86/common/xf86str.h12
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c38
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c23
3 files changed, 59 insertions, 14 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86str.h b/xc/programs/Xserver/hw/xfree86/common/xf86str.h
index 2743415b6..bc022d793 100644
--- a/xc/programs/Xserver/hw/xfree86/common/xf86str.h
+++ b/xc/programs/Xserver/hw/xfree86/common/xf86str.h
@@ -419,11 +419,15 @@ typedef struct _confdrirec {
int bufs_count;
confDRIBufferRec *bufs;
} confDRIRec, *confDRIPtr;
+
+typedef struct _xf86fullscreenrec {
+ Bool isFullScreen;
+} xf86FullScreenRec, *xf86FullScreenPtr;
/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS 16
-#define NUM_RESERVED_POINTERS 15
-#define NUM_RESERVED_FUNCS 16
+#define NUM_RESERVED_POINTERS 14
+#define NUM_RESERVED_FUNCS 15
typedef pointer (*funcPointer)(void);
@@ -816,7 +820,8 @@ typedef struct _ScrnInfoRec {
*/
int reservedInt[NUM_RESERVED_INTS];
- int * entityInstanceList;
+ int * entityInstanceList;
+ xf86FullScreenPtr fullscreen;
pointer reservedPtr[NUM_RESERVED_POINTERS];
/*
@@ -842,6 +847,7 @@ typedef struct _ScrnInfoRec {
int (*ChangeGamma)(int scrnIndex, Gamma newGamma);
void (*PointerMoved)(int scrnIndex, int x, int y);
Bool (*PMEvent)(int scrnIndex, pmEvent event);
+ Bool (*FullScreenMode)(int scrnIndex, Bool fullscreen);
/*
* This can be used when the minor ABI version is incremented.
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
index e00eb4158..7c2c714cb 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c
@@ -125,6 +125,10 @@ static void VgaIORestore(int i, void *arg);
static void MGAFreeScreen(int scrnIndex, int flags);
static int MGAValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose,
int flags);
+#ifdef XF86DRI
+static Bool MGASetFullScreenMode(int scrnIndex, Bool fullscreen);
+#endif
+
#ifdef DPMSExtension
static void MGADisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagementMode,
@@ -327,6 +331,9 @@ static const char *driSymbols[] = {
"DRIGetSAREAPrivate",
"DRIGetContext",
"DRIQueryVersion",
+ "DRIAdjustFrame",
+ "DRIOpenFullScreen",
+ "DRICloseFullScreen",
"GlxSetVisualConfigs",
NULL
};
@@ -616,6 +623,9 @@ MGAProbe(DriverPtr drv, int flags)
pScrn->LeaveVT = MGALeaveVT;
pScrn->FreeScreen = MGAFreeScreen;
pScrn->ValidMode = MGAValidMode;
+#ifdef XF86DRI
+ pScrn->FullScreenMode = MGASetFullScreenMode;
+#endif
foundScreen = TRUE;
}
@@ -2925,6 +2935,16 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DPMSInit(pScreen, MGADisplayPowerManagementSet, 0);
#endif
+ pScrn->memPhysBase = pMga->FbAddress;
+ pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
+
+ if(pMga->SecondCrtc == TRUE) {
+ pScreen->SaveScreen = MGASaveScreenCrtc2;
+ } else {
+ pScreen->SaveScreen = MGASaveScreen;
+ MGAInitVideo(pScreen);
+ }
+
#ifdef XF86DRI
/* Initialize the Warp engine */
if (pMga->directRenderingEnabled) {
@@ -2946,16 +2966,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pMga->have_quiescense = 1;
#endif
- pScrn->memPhysBase = pMga->FbAddress;
- pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8);
-
- if(pMga->SecondCrtc == TRUE) {
- pScreen->SaveScreen = MGASaveScreenCrtc2;
- } else {
- pScreen->SaveScreen = MGASaveScreen;
- MGAInitVideo(pScreen);
- }
-
/* Wrap the current CloseScreen function */
pMga->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = MGACloseScreen;
@@ -3341,6 +3351,14 @@ MGASaveScreen(ScreenPtr pScreen, int mode)
return vgaHWSaveScreen(pScreen, mode);
}
+#ifdef XF86DRI
+static Bool
+MGASetFullScreenMode(int scrnIndex, Bool fullscreen)
+{
+ xf86DrvMsg(scrnIndex, X_INFO, "Fullscreen = %d\n", fullscreen);
+ return TRUE;
+}
+#endif
/*
* MGADisplayPowerManagementSet --
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
index 3f0aee798..0fd6a16ba 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c
@@ -131,6 +131,11 @@ static void TDFXFreeScreen(int scrnIndex, int flags);
static int TDFXValidMode(int scrnIndex, DisplayModePtr mode, Bool
verbose, int flags);
+#ifdef XF86DRI
+/* Enter or leave automatic fullscreen mode (for DRI only) */
+static Bool TDFXSetFullScreenMode(int scrnIndex, Bool fullscreen);
+#endif
+
#ifdef DPMSExtension
/* Switch to various Display Power Management System levels */
static void TDFXDisplayPowerManagementSet(ScrnInfoPtr pScrn,
@@ -274,6 +279,9 @@ static const char *driSymbols[] = {
"DRIGetSAREAPrivate",
"DRIGetContext",
"DRIQueryVersion",
+ "DRIAdjustFrame",
+ "DRIOpenFullScreen",
+ "DRICloseFullScreen",
"GlxSetVisualConfigs",
NULL
};
@@ -454,6 +462,9 @@ TDFXProbe(DriverPtr drv, int flags) {
pScrn->LeaveVT = TDFXLeaveVT;
pScrn->FreeScreen = TDFXFreeScreen;
pScrn->ValidMode = TDFXValidMode;
+#ifdef XF86DRI
+ pScrn->FullScreenMode = TDFXSetFullScreenMode;
+#endif
foundScreen = TRUE;
}
}
@@ -2061,7 +2072,17 @@ TDFXSaveScreen(ScreenPtr pScreen, int mode)
TDFXBlankScreen(pScrn, unblank);
}
return TRUE;
-}
+}
+
+#ifdef XF86DRI
+static Bool
+TDFXSetFullScreenMode(int scrnIndex, Bool fullscreen)
+{
+ xf86DrvMsg(scrnIndex, X_INFO, "Fullscreen = %d\n", fullscreen);
+ return TRUE;
+}
+#endif
+
#ifdef DPMSExtension
static void