diff options
Diffstat (limited to 'src/XF86DGA2.c')
-rw-r--r-- | src/XF86DGA2.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/XF86DGA2.c b/src/XF86DGA2.c index d241ff7..fbc84cb 100644 --- a/src/XF86DGA2.c +++ b/src/XF86DGA2.c @@ -30,7 +30,7 @@ char *xdga_extension_name = XF86DGANAME; static XExtensionInfo _xdga_info_data; static XExtensionInfo *xdga_info = &_xdga_info_data; - + Bool XDGAMapFramebuffer(int, char *, unsigned char*, CARD32, CARD32, CARD32); void XDGAUnmapFramebuffer(int); unsigned char* XDGAGetMappedMemory(int); @@ -66,9 +66,9 @@ static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info) XExtDisplayInfo* xdga_find_display(Display*); -XEXT_GENERATE_FIND_DISPLAY (xdga_find_display, xdga_info, - "XFree86-DGA", - &xdga_extension_hooks, +XEXT_GENERATE_FIND_DISPLAY (xdga_find_display, xdga_info, + "XFree86-DGA", + &xdga_extension_hooks, 0, NULL) @@ -154,7 +154,7 @@ Bool XDGAQueryExtension ( Bool XDGAQueryVersion( Display *dpy, - int *majorVersion, + int *majorVersion, int *minorVersion ){ XExtDisplayInfo *info = xdga_find_display (dpy); @@ -182,7 +182,7 @@ Bool XDGAQueryVersion( for (i = 0, j = info->codes->first_event; i < XF86DGANumberEvents; - i++, j++) + i++, j++) { XESetWireToEvent (dpy, j, xdga_wire_to_event); XESetEventToWire (dpy, j, xdga_event_to_wire); @@ -240,11 +240,11 @@ Bool XDGAOpenFramebuffer( } ret = XDGAMapFramebuffer(screen, deviceName, - (unsigned char*)(long)rep.mem1, + (unsigned char*)(long)rep.mem1, rep.size, rep.offset, rep.extra); if(deviceName) - Xfree(deviceName); + Xfree(deviceName); UnlockDisplay(dpy); SyncHandle(); @@ -305,12 +305,12 @@ XDGAMode* XDGAQueryModes( offset = (char*)(&modes[rep.number]); /* start of text */ - if(modes) { + if(modes) { for(i = 0; i < rep.number; i++) { _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo); modes[i].num = info.num; - modes[i].verticalRefresh = + modes[i].verticalRefresh = (float)info.vsync_num / (float)info.vsync_den; modes[i].flags = info.flags; modes[i].imageWidth = info.image_width; @@ -333,7 +333,7 @@ XDGAMode* XDGAQueryModes( modes[i].maxViewportY = info.viewport_ymax; modes[i].viewportFlags = info.viewport_flags; modes[i].reserved1 = info.reserved1; - modes[i].reserved2 = info.reserved2; + modes[i].reserved2 = info.reserved2; _XRead(dpy, offset, info.name_size); modes[i].name = offset; @@ -352,7 +352,7 @@ XDGAMode* XDGAQueryModes( } -XDGADevice * +XDGADevice * XDGASetMode( Display *dpy, int screen, @@ -373,7 +373,7 @@ XDGASetMode( req->screen = screen; req->mode = mode; req->pid = pid = XAllocID(dpy); - + if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) { if(rep.length) { xXDGAModeInfo info; @@ -383,12 +383,12 @@ XDGASetMode( size -= sz_xXDGAModeInfo; /* get text size */ dev = (XDGADevice*)Xmalloc(sizeof(XDGADevice) + size); - + if(dev) { _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo); dev->mode.num = info.num; - dev->mode.verticalRefresh = + dev->mode.verticalRefresh = (float)info.vsync_num / (float)info.vsync_den; dev->mode.flags = info.flags; dev->mode.imageWidth = info.image_width; @@ -413,7 +413,7 @@ XDGASetMode( dev->mode.reserved1 = info.reserved1; dev->mode.reserved2 = info.reserved2; - dev->mode.name = (char*)(&dev[1]); + dev->mode.name = (char*)(&dev[1]); _XRead(dpy, dev->mode.name, info.name_size); dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0; @@ -421,7 +421,7 @@ XDGASetMode( if(dev->data) dev->data += rep.offset; - } + } /* not sure what to do if the allocation fails */ } } @@ -591,7 +591,7 @@ void XDGACopyTransparentArea( int XDGAGetViewportStatus( Display *dpy, - int screen + int screen ){ XExtDisplayInfo *info = xdga_find_display (dpy); xXDGAGetViewportStatusReply rep; @@ -614,7 +614,7 @@ int XDGAGetViewportStatus( void XDGASync( Display *dpy, - int screen + int screen ){ XExtDisplayInfo *info = xdga_find_display (dpy); xXDGASyncReply rep; @@ -638,7 +638,7 @@ void XDGAChangePixmapMode( int screen, int *x, int *y, - int mode + int mode ){ XExtDisplayInfo *info = xdga_find_display (dpy); xXDGAChangePixmapModeReq *req; @@ -689,7 +689,7 @@ Colormap XDGACreateColormap( void XDGAKeyEventToXKeyEvent( - XDGAKeyEvent* dk, + XDGAKeyEvent* dk, XKeyEvent* xk ){ xk->type = dk->type; @@ -710,7 +710,7 @@ void XDGAKeyEventToXKeyEvent( #include <stdlib.h> #include <stdio.h> #include <fcntl.h> -#if defined(ISC) +#if defined(ISC) # define HAS_SVR3_MMAP # include <sys/types.h> # include <errno.h> @@ -760,7 +760,7 @@ typedef struct _DGAMapRec{ } DGAMapRec, *DGAMapPtr; static Bool -DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr); +DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr); static void DGAUnmapPhysical(DGAMapPtr); static DGAMapPtr _Maps = NULL; @@ -794,7 +794,7 @@ XDGAMapFramebuffer( ){ DGAMapPtr pMap = _Maps; Bool result; - + /* is it already mapped ? */ while(pMap != NULL) { if(pMap->screen == screen) @@ -815,9 +815,9 @@ XDGAMapFramebuffer( if(result) { pMap->next = _Maps; _Maps = pMap; - } else + } else Xfree(pMap); - + return result; } @@ -866,7 +866,7 @@ DGAMapPhysical( ULONG action; HFILE hfd; #endif - + base += offset; pMap->screen = screen; @@ -927,7 +927,7 @@ DGAMapPhysical( name = DEV_MEM; if ((pMap->fd = open(name, O_RDWR)) < 0) return False; - pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE, + pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base); if (pMap->virtual == (void *)-1) return False; |