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>
This commit is contained in:
Ville Syrjälä 2010-10-28 18:13:02 +03:00
parent a942534ca3
commit 640c8716e0
2 changed files with 11 additions and 1 deletions

View File

@ -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.

View File

@ -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