diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-08-25 09:46:10 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-08-25 09:48:10 -0700 |
commit | 1fc3f467ab3edd405adc569ac7f629077e6ffb9d (patch) | |
tree | fd911840f307db28bc773e161c85e8092e12b200 /src/i810_driver.c | |
parent | 5dccd1be3ab80b642ef2022446f5bdc1656ed943 (diff) |
Add KMS only build flag
Rather than refactoring all our init code only to have it go away when
we remove UMS, this patch adds a build time flag to allow the driver to
assume KMS support.
With this flag active, the driver will not request that I/O or MEM be
enabled at probe time, which can allow the server (if other drivers also
cooperate) to run as a non-root user.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'src/i810_driver.c')
-rw-r--r-- | src/i810_driver.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/i810_driver.c b/src/i810_driver.c index 03669016..a08a500f 100644 --- a/src/i810_driver.c +++ b/src/i810_driver.c @@ -79,7 +79,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Required Functions: */ static void I810Identify(int flags); - +static Bool I810DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr); static Bool intel_pci_probe (DriverPtr drv, int entity_num, struct pci_device *dev, @@ -150,7 +150,7 @@ _X_EXPORT DriverRec I810 = { I810AvailableOptions, NULL, 0, - NULL, + I810DriverFunc, intel_device_match, intel_pci_probe }; @@ -394,6 +394,26 @@ I810AvailableOptions(int chipid, int busid) #endif } +static Bool +I810DriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr) +{ + xorgHWFlags *flag; + + switch (op) { + case GET_REQUIRED_HW_INTERFACES: + flag = (CARD32*)ptr; +#ifdef KMS_ONLY + (*flag) = 0; +#else + (*flag) = HW_IO | HW_MMIO; +#endif + return TRUE; + default: + /* Unknown or deprecated function */ + return FALSE; + } +} + struct pci_device * intel_host_bridge (void) { |