[PATCH] XFree86: fbdevhw: Add helper function to get fd

Daniel Stone daniel at fooishbar.org
Mon Jan 5 01:38:04 PST 2009


Most drivers need to do custom weird ioctls, so let them know what the
fd is.

Signed-off-by: Daniel Stone <daniel.stone at collabora.co.uk>
---
 hw/xfree86/fbdevhw/fbdevhw.c |    8 ++++++++
 hw/xfree86/fbdevhw/fbdevhw.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 5269277..495d88b 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -152,6 +152,14 @@ fbdevHWFreeRec(ScrnInfoPtr pScrn)
 	FBDEVHWPTRLVAL(pScrn) = NULL;
 }
 
+int
+fbdevHWGetFD(ScrnInfoPtr pScrn)
+{
+    fbdevHWPtr fPtr = fbdevHWGetRec(pScrn);
+
+    return fPtr->fd;
+}
+
 /* -------------------------------------------------------------------- */
 /* some helpers for printing debug informations                         */
 
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index 41c3e33..bc46b9c 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -16,6 +16,8 @@
 extern _X_EXPORT Bool  fbdevHWGetRec(ScrnInfoPtr pScrn);
 extern _X_EXPORT void  fbdevHWFreeRec(ScrnInfoPtr pScrn);
 
+extern _X_EXPORT int   fbdevHWGetFD(ScrnInfoPtr pScrn);
+
 extern _X_EXPORT Bool  fbdevHWProbe(struct pci_device * pPci, char *device, char **namep);
 extern _X_EXPORT Bool  fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device * pPci, char *device);
 
-- 
1.5.6.5




More information about the xorg mailing list