[PATCH xserver 3/5] dri1: Hide the SIGIO details from drivers
Adam Jackson
ajax at redhat.com
Tue Jun 7 19:52:13 UTC 2016
Not being used, and not likely to be useful.
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
hw/xfree86/dri/dri.c | 133 ++++++++++++++++++++++++---------------------------
hw/xfree86/dri/dri.h | 3 --
2 files changed, 62 insertions(+), 74 deletions(-)
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 0046e52..dbad12f 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -310,6 +310,68 @@ dri_crtc_notify(ScreenPtr pScreen)
xf86_wrap_crtc_notify(pScreen, dri_crtc_notify);
}
+static void
+drmSIGIOHandler(int interrupt, void *closure)
+{
+ unsigned long key;
+ void *value;
+ ssize_t count;
+ drm_ctx_t ctx;
+ typedef void (*_drmCallback) (int, void *, void *);
+ char buf[256];
+ drm_context_t old;
+ drm_context_t new;
+ void *oldctx;
+ void *newctx;
+ char *pt;
+ drmHashEntry *entry;
+ void *hash_table;
+
+ hash_table = drmGetHashTable();
+
+ if (!hash_table)
+ return;
+ if (drmHashFirst(hash_table, &key, &value)) {
+ entry = value;
+ do {
+ if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) {
+ buf[count] = '\0';
+
+ for (pt = buf; *pt != ' '; ++pt); /* Find first space */
+ ++pt;
+ old = strtol(pt, &pt, 0);
+ new = strtol(pt, NULL, 0);
+ oldctx = drmGetContextTag(entry->fd, old);
+ newctx = drmGetContextTag(entry->fd, new);
+ ((_drmCallback) entry->f) (entry->fd, oldctx, newctx);
+ ctx.handle = new;
+ ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx);
+ }
+ } while (drmHashNext(hash_table, &key, &value));
+ }
+}
+
+static int
+drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *))
+{
+ drmHashEntry *entry;
+
+ entry = drmGetEntry(fd);
+ entry->f = f;
+
+ return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0);
+}
+
+static int
+drmRemoveSIGIOHandler(int fd)
+{
+ drmHashEntry *entry = drmGetEntry(fd);
+
+ entry->f = NULL;
+
+ return xf86RemoveSIGIOHandler(fd);
+}
+
Bool
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
{
@@ -2378,74 +2440,3 @@ DRICreatePCIBusID(const struct pci_device *dev)
return busID;
}
-
-static void
-drmSIGIOHandler(int interrupt, void *closure)
-{
- unsigned long key;
- void *value;
- ssize_t count;
- drm_ctx_t ctx;
- typedef void (*_drmCallback) (int, void *, void *);
- char buf[256];
- drm_context_t old;
- drm_context_t new;
- void *oldctx;
- void *newctx;
- char *pt;
- drmHashEntry *entry;
- void *hash_table;
-
- hash_table = drmGetHashTable();
-
- if (!hash_table)
- return;
- if (drmHashFirst(hash_table, &key, &value)) {
- entry = value;
- do {
-#if 0
- fprintf(stderr, "Trying %d\n", entry->fd);
-#endif
- if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) {
- buf[count] = '\0';
-#if 0
- fprintf(stderr, "Got %s\n", buf);
-#endif
-
- for (pt = buf; *pt != ' '; ++pt); /* Find first space */
- ++pt;
- old = strtol(pt, &pt, 0);
- new = strtol(pt, NULL, 0);
- oldctx = drmGetContextTag(entry->fd, old);
- newctx = drmGetContextTag(entry->fd, new);
-#if 0
- fprintf(stderr, "%d %d %p %p\n", old, new, oldctx, newctx);
-#endif
- ((_drmCallback) entry->f) (entry->fd, oldctx, newctx);
- ctx.handle = new;
- ioctl(entry->fd, DRM_IOCTL_NEW_CTX, &ctx);
- }
- } while (drmHashNext(hash_table, &key, &value));
- }
-}
-
-int
-drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *))
-{
- drmHashEntry *entry;
-
- entry = drmGetEntry(fd);
- entry->f = f;
-
- return xf86InstallSIGIOHandler(fd, drmSIGIOHandler, 0);
-}
-
-int
-drmRemoveSIGIOHandler(int fd)
-{
- drmHashEntry *entry = drmGetEntry(fd);
-
- entry->f = NULL;
-
- return xf86RemoveSIGIOHandler(fd);
-}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index 1ce0970..7e0337f 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -332,9 +332,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo);
-extern _X_EXPORT int drmInstallSIGIOHandler(int fd,
- void (*f) (int, void *, void *));
-extern _X_EXPORT int drmRemoveSIGIOHandler(int fd);
extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn);
extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
--
2.7.4
More information about the xorg-devel
mailing list