[PATCH 07/19] xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
Dave Airlie
airlied at gmail.com
Mon May 14 09:41:00 PDT 2012
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
hw/xfree86/common/xf86Mode.c | 4 ++--
hw/xfree86/common/xf86str.h | 2 +-
hw/xfree86/doc/ddxDesign.xml | 2 +-
hw/xfree86/fbdevhw/fbdevhw.c | 4 +---
hw/xfree86/fbdevhw/fbdevhw.h | 2 +-
hw/xfree86/fbdevhw/fbdevhwstub.c | 2 +-
6 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index ab4d595..d80dec8 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -950,7 +950,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
mode->SynthClock /= 2;
}
- status = (*scrp->ValidMode) (scrp->scrnIndex, mode, FALSE,
+ status = (*scrp->ValidMode) (scrp, mode, FALSE,
MODECHECK_INITIAL);
if (status != MODE_OK)
return status;
@@ -1840,7 +1840,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
scrp->virtualX = newVirtX;
scrp->virtualY = newVirtY;
scrp->displayWidth = newLinePitch;
- p->status = (scrp->ValidMode) (scrp->scrnIndex, p, FALSE,
+ p->status = (scrp->ValidMode) (scrp, p, FALSE,
MODECHECK_FINAL);
if (p->status != MODE_OK) {
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 2f9d1c7..41b3c0c 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -651,7 +651,7 @@ typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int, int);
typedef Bool xf86EnterVTProc(ScrnInfoPtr, int);
typedef void xf86LeaveVTProc(ScrnInfoPtr, int);
typedef void xf86FreeScreenProc(ScrnInfoPtr, int);
-typedef ModeStatus xf86ValidModeProc(int, DisplayModePtr, Bool, int);
+typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int);
typedef void xf86EnableDisableFBAccessProc(int, Bool);
typedef int xf86SetDGAModeProc(int, int, DGADevicePtr);
typedef int xf86ChangeGammaProc(int, Gamma);
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 1bafaf3..53aebd3 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -1696,7 +1696,7 @@ but their presence is optional.
<blockquote><para>
<programlisting>
- ModeStatus ChipValidMode(int index, DisplayModePtr mode,
+ ModeStatus ChipValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
Bool verbose, int flags);
</programlisting>
<blockquote><para>
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 44ef9fe..1861099 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -775,10 +775,8 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
/* these can be hooked directly into ScrnInfoRec */
ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-
if (!fbdevHWSetMode(pScrn, mode, TRUE))
return MODE_BAD;
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index 19f1b30..7975ffb 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -44,7 +44,7 @@ extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors,
int *indices, LOCO * colors,
VisualPtr pVisual);
-extern _X_EXPORT ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode,
+extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
Bool verbose, int flags);
extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
int flags);
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
index 5bfb921..122f4b3 100644
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -131,7 +131,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
}
ModeStatus
-fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags)
{
return MODE_ERROR;
}
--
1.7.6
More information about the xorg-devel
mailing list