mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
kdrive: add OS/platform callback for screen enable/disable
New OS/platform callbacks that are called when screens are enabled or disabled. This allows individual Kdrive implementations to take specific action, eg. configure/reset graphics hardware. Signed-off-by: stefan11111 <stefan11111@shitposting.expert> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
889dc612cf
commit
b75dfe3d58
@@ -154,6 +154,8 @@ static void
|
||||
KdDisableScreens(void)
|
||||
{
|
||||
KdSuspend();
|
||||
if (kdEnabled && (kdOsFuncs->Disable))
|
||||
kdOsFuncs->Disable();
|
||||
kdEnabled = FALSE;
|
||||
}
|
||||
|
||||
@@ -604,6 +606,8 @@ Bool KdCloseScreen(ScreenPtr pScreen)
|
||||
* Clean up OS when last card is closed
|
||||
*/
|
||||
if (card == kdCardInfo) {
|
||||
if (kdEnabled && (kdOsFuncs->Disable))
|
||||
kdOsFuncs->Disable();
|
||||
kdEnabled = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -818,6 +822,8 @@ KdScreenInit(ScreenPtr pScreen, int argc, char **argv)
|
||||
/*
|
||||
* Enable the hardware
|
||||
*/
|
||||
if ((!kdEnabled) && (kdOsFuncs->Enable))
|
||||
kdOsFuncs->Enable();
|
||||
kdEnabled = TRUE;
|
||||
|
||||
if (screen->mynum == card->selected) {
|
||||
|
||||
@@ -280,9 +280,9 @@ void KdRemoveKeyboard(KdKeyboardInfo * ki);
|
||||
|
||||
typedef struct _KdOsFuncs {
|
||||
int (*Init) (void); /* Only called when the X server is started, when serverGeneration == 1 */
|
||||
void (*Enable) (void);
|
||||
void (*Enable) (void); /* called when screen is enabled */
|
||||
void (*Disable) (void); /* called when screen is disabled */
|
||||
Bool (*SpecialKey) (KeySym);
|
||||
void (*Disable) (void);
|
||||
void (*Fini) (void);
|
||||
void (*pollEvents) (void);
|
||||
void (*Bell) (int, int, int); /* if not NULL called instead of the keyboard driver's function */
|
||||
|
||||
Reference in New Issue
Block a user