summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@nokia.com>2010-10-28 18:13:02 +0300
committerVille Syrjälä <ville.syrjala@nokia.com>2010-11-26 18:01:06 +0200
commit640c8716e0400e35afd7e91efc826fc447ea6745 (patch)
treec0f993d51b3a6873e98b777dff875a963683f90e
parenta942534ca3908418c407115c6393263c2fe05931 (diff)
xfree86/modes: Provide a ModeSet hook in ScrnInfo
Add a new hook ModeSet that will be called after display mode is changed, or after the display has been panned. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
-rw-r--r--hw/xfree86/common/xf86str.h4
-rw-r--r--hw/xfree86/modes/xf86Crtc.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index ce6b07f08..a65237a5b 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -498,7 +498,7 @@ typedef struct _confdrirec {
/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS 16
#define NUM_RESERVED_POINTERS 14
-#define NUM_RESERVED_FUNCS 11
+#define NUM_RESERVED_FUNCS 10
typedef pointer (*funcPointer)(void);
@@ -652,6 +652,7 @@ typedef Bool xf86PMEventProc (int, pmEvent, Bool);
typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
+typedef void xf86ModeSetProc (ScrnInfoPtr);
/*
@@ -802,6 +803,7 @@ typedef struct _ScrnInfoRec {
xf86LoadPaletteProc *LoadPalette;
xf86SetOverscanProc *SetOverscan;
xorgDriverFuncProc *DriverFunc;
+ xf86ModeSetProc *ModeSet;
/*
* This can be used when the minor ABI version is incremented.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 7fc2a60f7..74d91ed60 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -371,6 +371,8 @@ done:
crtc->active = TRUE;
if (scrn->pScreen)
xf86CrtcSetScreenSubpixelOrder (scrn->pScreen);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
} else {
crtc->x = saved_x;
crtc->y = saved_y;
@@ -407,12 +409,16 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
void
xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y)
{
+ ScrnInfoPtr scrn = crtc->scrn;
+
crtc->x = x;
crtc->y = y;
if (crtc->funcs->set_origin) {
if (!xf86CrtcRotate (crtc))
return;
crtc->funcs->set_origin (crtc, x, y);
+ if (scrn->ModeSet)
+ scrn->ModeSet(scrn);
}
else
xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y);
@@ -2894,6 +2900,8 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn)
}
if (pScrn->pScreen)
xf86_crtc_notify(pScrn->pScreen);
+ if (pScrn->ModeSet)
+ pScrn->ModeSet(pScrn);
}
#ifdef RANDR_12_INTERFACE