From 73816949f2a28a0b8fe39108a8e493f9e47f7718 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Fri, 28 Jan 2005 16:12:59 +0000 Subject: Modifying X.Org Xserver DDX to allow to run X with ordinary user permissions when no access to HW registers is required. For API changes which mostly involve the modifications to make the RRFunc (introduced with 6.8) more flexible please check Bugzilla #2407. NOTE: This patch applies changes to OS specific files for other OSes which I cannot test. --- src/dummy_driver.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/dummy_driver.c b/src/dummy_driver.c index e36ecda..0760f1b 100644 --- a/src/dummy_driver.c +++ b/src/dummy_driver.c @@ -69,6 +69,9 @@ static Bool DUMMYSaveScreen(ScreenPtr pScreen, int mode); static Bool dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void dummySave(ScrnInfoPtr pScrn); static void dummyRestore(ScrnInfoPtr pScrn, Bool restoreText); +static Bool dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, + pointer ptr); + /* static void DUMMYDisplayPowerManagementSet(ScrnInfoPtr pScrn, */ /* int PowerManagementMode, int flags); */ @@ -103,7 +106,8 @@ DriverRec DUMMY = { DUMMYProbe, DUMMYAvailableOptions, NULL, - 0 + 0, + dummyDriverFunc }; static SymTabRec DUMMYChipsets[] = { @@ -175,7 +179,7 @@ dummySetup(pointer module, pointer opts, int *errmaj, int *errmin) if (!setupDone) { setupDone = TRUE; - xf86AddDriver(&DUMMY, module, 0); + xf86AddDriver(&DUMMY, module, HaveDriverFuncs); /* * Modules that this driver always requires can be loaded here @@ -817,3 +821,19 @@ DUMMYCreateWindow(WindowPtr pWin) } return TRUE; } + + +static Bool +dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr) +{ + CARD32 *flag; + + switch (op) { + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32*)ptr; + (*flag) = 0; + return TRUE; + default: + return FALSE; + } +} -- cgit v1.2.3