dri1: Hide the SIGIO details from drivers
Not being used, and not likely to be useful. Signed-off-by: Adam Jackson <ajax@redhat.com> Acked-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
95ce2bccdc
commit
2725dd024d
|
@ -310,6 +310,68 @@ dri_crtc_notify(ScreenPtr pScreen)
|
||||||
xf86_wrap_crtc_notify(pScreen, dri_crtc_notify);
|
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
|
Bool
|
||||||
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
|
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
|
||||||
{
|
{
|
||||||
|
@ -2378,74 +2440,3 @@ DRICreatePCIBusID(const struct pci_device *dev)
|
||||||
|
|
||||||
return busID;
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -332,9 +332,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
|
||||||
|
|
||||||
extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo);
|
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 int DRIMasterFD(ScrnInfoPtr pScrn);
|
||||||
|
|
||||||
extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
|
extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
|
||||||
|
|
Loading…
Reference in New Issue