Index: include/GL/internal/dri_interface.h =================================================================== RCS file: /cvs/mesa/Mesa/include/GL/internal/dri_interface.h,v retrieving revision 1.17 diff -u -r1.17 dri_interface.h --- include/GL/internal/dri_interface.h 29 Nov 2005 23:01:43 -0000 1.17 +++ include/GL/internal/dri_interface.h 16 Feb 2006 02:27:38 -0000 @@ -48,13 +48,13 @@ * side library and the DRI (direct rendering infrastructure). */ /*@{*/ -typedef struct __DRIdisplayRec __DRIdisplay; -typedef struct __DRIscreenRec __DRIscreen; -typedef struct __DRIcontextRec __DRIcontext; -typedef struct __DRIdrawableRec __DRIdrawable; -typedef struct __DRIdriverRec __DRIdriver; -typedef struct __DRIframebufferRec __DRIframebuffer; -typedef struct __DRIversionRec __DRIversion; +typedef struct __DRIdisplayRec __DRIdisplay; +typedef struct __DRIscreenRec __DRIscreen; +typedef struct __DRIcontextRec __DRIcontext; +typedef struct __DRIdrawableRec __DRIdrawable; +typedef struct __DRIdriverRec __DRIdriver; +typedef struct __DRIprivateRec __DRIprivate; +typedef struct __DRIversionRec __DRIversion; typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods; typedef unsigned long __DRIid; typedef void __DRInativeDisplay; @@ -101,12 +101,12 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, - const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, + const __DRIversion * drm_version, const __DRIprivate * private, void * pSAREA, int fd, int internal_api_version, const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes); typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC; -extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727; +extern CREATENEWSCREENFUNC __driCreateNewScreen_20060227; /** @@ -241,33 +241,14 @@ /** - * Framebuffer information record. Used by libGL to communicate information - * about the framebuffer to the driver's \c __driCreateNewScreen function. - * - * In XFree86, most of this information is derrived from data returned by - * calling \c XF86DRIGetDeviceInfo. - * - * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen - * __driUtilCreateNewScreen CallCreateNewScreen - * - * \bug This structure could be better named. + * Private information record. Used by libGL to communicate information + * about the driver's private records \c __driCreateNewScreen function. */ -struct __DRIframebufferRec { - unsigned char *base; /**< Framebuffer base address in the CPU's - * address space. This value is calculated by - * calling \c drmMap on the framebuffer handle - * returned by \c XF86DRIGetDeviceInfo (or a - * similar function). - */ - int size; /**< Framebuffer size, in bytes. */ - int stride; /**< Number of bytes from one line to the next. */ - int width; /**< Pixel width of the framebuffer. */ - int height; /**< Pixel height of the framebuffer. */ +struct __DRIprivateRec { int dev_priv_size; /**< Size of the driver's dev-priv structure. */ void *dev_priv; /**< Pointer to the driver's dev-priv structure. */ }; - /** * Screen dependent methods. This structure is initialized during the * \c __DRIdisplayRec::createScreen call. Index: src/glx/x11/XF86dri.c =================================================================== RCS file: /cvs/mesa/Mesa/src/glx/x11/XF86dri.c,v retrieving revision 1.6 diff -u -r1.6 XF86dri.c --- src/glx/x11/XF86dri.c 2 Dec 2005 18:17:11 -0000 1.6 +++ src/glx/x11/XF86dri.c 16 Feb 2006 02:27:39 -0000 @@ -562,15 +562,6 @@ return False; } - *hFrameBuffer = rep.hFrameBufferLow; - if (sizeof(drm_handle_t) == 8) { - const int shift = 32; /* var to prevent warning on next line */ - *hFrameBuffer |= ((drm_handle_t) rep.hFrameBufferHigh) << shift; - } - - *fbOrigin = rep.framebufferOrigin; - *fbSize = rep.framebufferSize; - *fbStride = rep.framebufferStride; *devPrivateSize = rep.devPrivateSize; if (rep.length) { Index: src/glx/x11/dri_glx.c =================================================================== RCS file: /cvs/mesa/Mesa/src/glx/x11/dri_glx.c,v retrieving revision 1.8 diff -u -r1.8 dri_glx.c --- src/glx/x11/dri_glx.c 11 Aug 2005 14:18:53 -0000 1.8 +++ src/glx/x11/dri_glx.c 16 Feb 2006 02:27:39 -0000 @@ -166,7 +166,7 @@ * \todo * Create a macro or something so that this is automatically updated. */ -static const char createNewScreenName[] = "__driCreateNewScreen_20050727"; +static const char createNewScreenName[] = "__driCreateNewScreen_20060227"; /** Index: src/glx/x11/glxext.c =================================================================== RCS file: /cvs/mesa/Mesa/src/glx/x11/glxext.c,v retrieving revision 1.19 diff -u -r1.19 glxext.c --- src/glx/x11/glxext.c 11 Aug 2005 14:18:53 -0000 1.19 +++ src/glx/x11/glxext.c 16 Feb 2006 02:27:40 -0000 @@ -733,7 +733,7 @@ __DRIversion ddx_version; __DRIversion dri_version; __DRIversion drm_version; - __DRIframebuffer framebuffer; + __DRIprivate private; int fd = -1; int status; const char * err_msg; @@ -749,8 +749,7 @@ err_msg = "XF86DRIOpenConnection"; err_extra = NULL; - framebuffer.base = MAP_FAILED; - framebuffer.dev_priv = NULL; + private.dev_priv = NULL; if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { fd = drmOpen(NULL,BusID); @@ -794,7 +793,6 @@ &ddx_version.minor, &ddx_version.patch, &driverName)) { - drm_handle_t hFB; int junk; /* No longer needed. */ @@ -809,59 +807,45 @@ */ err_msg = "XF86DRIGetDeviceInfo"; if (XF86DRIGetDeviceInfo(dpy, scrn, - &hFB, &junk, - &framebuffer.size, - &framebuffer.stride, - &framebuffer.dev_priv_size, - &framebuffer.dev_priv)) { - framebuffer.width = DisplayWidth(dpy, scrn); - framebuffer.height = DisplayHeight(dpy, scrn); - + &junk, + &junk, + &junk, + &private.dev_priv_size, + &private.dev_priv)) { /* - * Map the framebuffer region. + * Map the SAREA region. Further mmap regions + * may be setup in each DRI driver's + * "createNewScreen" function. */ - status = drmMap(fd, hFB, framebuffer.size, - (drmAddressPtr)&framebuffer.base); + status = drmMap(fd, hSAREA, SAREA_MAX, + &pSAREA); - err_msg = "drmMap of framebuffer"; + err_msg = "drmMap of sarea"; err_extra = strerror( -status ); if ( status == 0 ) { - /* - * Map the SAREA region. Further mmap regions - * may be setup in each DRI driver's - * "createNewScreen" function. - */ - status = drmMap(fd, hSAREA, SAREA_MAX, - &pSAREA); - - err_msg = "drmMap of sarea"; - err_extra = strerror( -status ); + __GLcontextModes * driver_modes = NULL; + __GLXscreenConfigs *configs = psc->screenConfigs; - if ( status == 0 ) { - __GLcontextModes * driver_modes = NULL; - __GLXscreenConfigs *configs = psc->screenConfigs; - - err_msg = "InitDriver"; - err_extra = NULL; - psp = (*createNewScreen)(dpy, scrn, + err_msg = "InitDriver"; + err_extra = NULL; + psp = (*createNewScreen)(dpy, scrn, psc, configs->configs, & ddx_version, & dri_version, & drm_version, - & framebuffer, + & private, pSAREA, fd, api_ver, & interface_methods, & driver_modes ); - filter_modes( & configs->configs, + filter_modes( & configs->configs, driver_modes ); - _gl_context_modes_destroy( driver_modes ); - } + _gl_context_modes_destroy( driver_modes ); } } } @@ -875,12 +859,8 @@ (void)drmUnmap(pSAREA, SAREA_MAX); } - if ( framebuffer.base != MAP_FAILED ) { - (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size); - } - - if ( framebuffer.dev_priv != NULL ) { - Xfree(framebuffer.dev_priv); + if ( private.dev_priv != NULL ) { + Xfree(private.dev_priv); } if ( fd >= 0 ) { Index: src/glx/x11/xf86dristr.h =================================================================== RCS file: /cvs/mesa/Mesa/src/glx/x11/xf86dristr.h,v retrieving revision 1.1 diff -u -r1.1 xf86dristr.h --- src/glx/x11/xf86dristr.h 25 Oct 2004 21:09:16 -0000 1.1 +++ src/glx/x11/xf86dristr.h 16 Feb 2006 02:27:41 -0000 @@ -50,9 +50,10 @@ * 4.0.0: Original * 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02 * 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02 + * 5.0.0: remove front buffer mapping. */ -#define XF86DRI_MAJOR_VERSION 4 -#define XF86DRI_MINOR_VERSION 1 +#define XF86DRI_MAJOR_VERSION 5 +#define XF86DRI_MINOR_VERSION 0 #define XF86DRI_PATCH_VERSION 0 typedef struct _XF86DRIQueryVersion { @@ -284,11 +285,11 @@ BOOL pad1; CARD16 sequenceNumber B16; CARD32 length B32; - CARD32 hFrameBufferLow B32; - CARD32 hFrameBufferHigh B32; - CARD32 framebufferOrigin B32; - CARD32 framebufferSize B32; - CARD32 framebufferStride B32; + CARD32 hFrameBufferLow B32; /* obsolete */ + CARD32 hFrameBufferHigh B32; /* obsolete */ + CARD32 framebufferOrigin B32; /* obsolete */ + CARD32 framebufferSize B32; /* obsolete */ + CARD32 framebufferStride B32; /* obsolete */ CARD32 devPrivateSize B32; } xXF86DRIGetDeviceInfoReply; #define sz_xXF86DRIGetDeviceInfoReply 32