xserver: Branch 'server-1.3-branch'
Keith Packard
keithp at kemper.freedesktop.org
Wed Mar 7 09:15:15 EET 2007
hw/xfree86/modes/xf86Crtc.c | 54 ++++++++++++++++++++++++++++++++++++++++++
hw/xfree86/modes/xf86Crtc.h | 23 +++--------------
hw/xfree86/modes/xf86Rename.h | 1
3 files changed, 59 insertions(+), 19 deletions(-)
New commits:
diff-tree 558a4f5588ad2ec11254e0b5d6ce9515b137369e (from 3f5cedf00a82f08a433c95ffbb7f8ac69dcf6a50)
Author: Keith Packard <keithp at guitar.keithp.com>
Date: Tue Mar 6 23:15:34 2007 -0800
Add xf86CrtcScreenInit to share initialization across drivers.
xf86CrtcScreenInit performs initialization that needs to happen at
ScreenInit time.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 46515fd..2794496 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -545,6 +545,60 @@ xf86OutputDestroy (xf86OutputPtr output)
xfree (output);
}
+/*
+ * Called during CreateScreenResources to hook up RandR
+ */
+static Bool
+xf86CrtcCreateScreenResources (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
+ screen->CreateScreenResources = config->CreateScreenResources;
+
+ if (!(*screen->CreateScreenResources)(screen))
+ return FALSE;
+
+ if (!xf86RandR12CreateScreenResources (screen))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Called at ScreenInit time to set up
+ */
+Bool
+xf86CrtcScreenInit (ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+ int c;
+
+ /* Rotation */
+ xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n");
+ xf86DisableRandR(); /* Disable old RandR extension support */
+ xf86RandR12Init (screen);
+
+ /* support all rotations if every crtc has the shadow alloc funcs */
+ for (c = 0; c < config->num_crtc; c++)
+ {
+ xf86CrtcPtr crtc = config->crtc[c];
+ if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create)
+ break;
+ }
+ if (c == config->num_crtc)
+ xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 |
+ RR_Rotate_180 | RR_Rotate_270);
+ else
+ xf86RandR12SetRotations (screen, RR_Rotate_0);
+
+ /* Wrap CreateScreenResources so we can initialize the RandR code */
+ config->CreateScreenResources = screen->CreateScreenResources;
+ screen->CreateScreenResources = xf86CrtcCreateScreenResources;
+ return TRUE;
+}
+
static DisplayModePtr
xf86DefaultMode (xf86OutputPtr output, int width, int height)
{
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 062a2db..6152ae4 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -494,6 +494,7 @@ typedef struct _xf86CrtcConfig {
const xf86CrtcConfigFuncsRec *funcs;
+ CreateScreenResourcesProcPtr CreateScreenResources;
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern int xf86CrtcConfigPrivateIndex;
@@ -525,25 +526,6 @@ xf86CrtcDestroy (xf86CrtcPtr crtc);
/**
- * Allocate a crtc for the specified output
- *
- * Find a currently unused CRTC which is suitable for
- * the specified output
- */
-
-xf86CrtcPtr
-xf86AllocCrtc (xf86OutputPtr output);
-
-/**
- * Free a crtc
- *
- * Mark the crtc as unused by any outputs
- */
-
-void
-xf86FreeCrtc (xf86CrtcPtr crtc);
-
-/**
* Sets the given video mode on the given crtc
*/
Bool
@@ -583,6 +565,9 @@ void
xf86SetScrnInfoModes (ScrnInfoPtr pScrn);
Bool
+xf86CrtcScreenInit (ScreenPtr pScreen);
+
+Bool
xf86InitialConfiguration (ScrnInfoPtr pScrn, Bool canGrow);
void
diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h
index eae6d64..9dcfef5 100644
--- a/hw/xfree86/modes/xf86Rename.h
+++ b/hw/xfree86/modes/xf86Rename.h
@@ -31,6 +31,7 @@
#define xf86CrtcDestroy XF86NAME(xf86CrtcDestroy)
#define xf86CrtcInUse XF86NAME(xf86CrtcInUse)
#define xf86CrtcRotate XF86NAME(xf86CrtcRotate)
+#define xf86CrtcScreenInit XF86NAME(xf86CrtcScreenInit)
#define xf86CrtcSetMode XF86NAME(xf86CrtcSetMode)
#define xf86CrtcSetSizeRange XF86NAME(xf86CrtcSetSizeRange)
#define xf86CVTMode XF86NAME(xf86CVTMode)
More information about the xorg-commit
mailing list