open-src/lib/mesa/6756412.patch
changeset 606 068c11b419c9
parent 605 e5259db5befc
child 607 261c0d718d67
equal deleted inserted replaced
605:e5259db5befc 606:068c11b419c9
     1 --- include/GL/internal/glcore.h	Thu Jun 19 16:28:49 2008
       
     2 +++ include/GL/internal/glcore.h	Thu Jun 19 16:33:23 2008
       
     3 @@ -38,11 +38,17 @@
       
     4  
       
     5  #include <sys/types.h>
       
     6  
       
     7 +#ifdef CAPI
       
     8 +#undef CAPI
       
     9 +#endif
       
    10 +#define CAPI
       
    11 +
       
    12  #define GL_CORE_SGI  1
       
    13  #define GL_CORE_MESA 2
       
    14  #define GL_CORE_APPLE 4
       
    15  
       
    16  typedef struct __GLcontextRec __GLcontext;
       
    17 +typedef struct __GLinterfaceRec __GLinterface;
       
    18  
       
    19  /*
       
    20  ** This file defines the interface between the GL core and the surrounding
       
    21 @@ -180,4 +186,333 @@
       
    22  #define GLX_TEXTURE_2D_BIT_EXT             0x00000002
       
    23  #define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
       
    24  
       
    25 +/************************************************************************/
       
    26 +
       
    27 +/*
       
    28 +** Structure used for allocating and freeing drawable private memory.
       
    29 +** (like software buffers, for example).
       
    30 +**
       
    31 +** The memory allocation routines are provided by the surrounding
       
    32 +** "operating system" code, and they are to be used for allocating
       
    33 +** software buffers and things which are associated with the drawable,
       
    34 +** and used by any context which draws to that drawable.  There are
       
    35 +** separate memory allocation functions for drawables and contexts
       
    36 +** since drawables and contexts can be created and destroyed independently
       
    37 +** of one another, and the "operating system" may want to use separate
       
    38 +** allocation arenas for each.
       
    39 +**
       
    40 +** The freePrivate function is filled in by the core routines when they
       
    41 +** allocates software buffers, and stick them in "private".  The freePrivate
       
    42 +** function will destroy anything allocated to this drawable (to be called
       
    43 +** when the drawable is destroyed).
       
    44 +*/
       
    45 +typedef struct __GLdrawableRegionRec __GLdrawableRegion;
       
    46 +typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
       
    47 +typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
       
    48 +
       
    49 +typedef struct __GLregionRectRec {
       
    50 +    /* lower left (inside the rectangle) */
       
    51 +    GLint x0, y0;
       
    52 +    /* upper right (outside the rectangle) */
       
    53 +    GLint x1, y1;
       
    54 +} __GLregionRect;
       
    55 +
       
    56 +struct __GLdrawableRegionRec {
       
    57 +    GLint numRects;
       
    58 +    __GLregionRect *rects;
       
    59 +    __GLregionRect boundingRect;
       
    60 +};
       
    61 +
       
    62 +/************************************************************************/
       
    63 +
       
    64 +/* masks for the buffers */
       
    65 +#define __GL_FRONT_BUFFER_MASK		0x00000001
       
    66 +#define	__GL_FRONT_LEFT_BUFFER_MASK	0x00000001
       
    67 +#define	__GL_FRONT_RIGHT_BUFFER_MASK	0x00000002
       
    68 +#define	__GL_BACK_BUFFER_MASK		0x00000004
       
    69 +#define __GL_BACK_LEFT_BUFFER_MASK	0x00000004
       
    70 +#define __GL_BACK_RIGHT_BUFFER_MASK	0x00000008
       
    71 +#define	__GL_ACCUM_BUFFER_MASK		0x00000010
       
    72 +#define	__GL_DEPTH_BUFFER_MASK		0x00000020
       
    73 +#define	__GL_STENCIL_BUFFER_MASK	0x00000040
       
    74 +#define	__GL_AUX_BUFFER_MASK(i)		(0x0000080 << (i))
       
    75 +
       
    76 +#define __GL_ALL_BUFFER_MASK		0xffffffff
       
    77 +
       
    78 +/* what Resize routines return if resize resorted to fallback case */
       
    79 +#define __GL_BUFFER_FALLBACK	0x10
       
    80 +
       
    81 +typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, 
       
    82 +				      __GLdrawablePrivate *glPriv, GLint bits);
       
    83 +typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, 
       
    84 +				  __GLdrawablePrivate *glPriv, GLint bits,
       
    85 +				  __GLbufFallbackInitFn back);
       
    86 +
       
    87 +/*
       
    88 +** A drawable buffer
       
    89 +**
       
    90 +** This data structure describes the context side of a drawable.  
       
    91 +**
       
    92 +** According to the spec there could be multiple contexts bound to the same
       
    93 +** drawable at the same time (from different threads).  In order to avoid
       
    94 +** multiple-access conflicts, locks are used to serialize access.  When a
       
    95 +** thread needs to access (read or write) a member of the drawable, it takes
       
    96 +** a lock first.  Some of the entries in the drawable are treated "mostly
       
    97 +** constant", so we take the freedom of allowing access to them without
       
    98 +** taking a lock (for optimization reasons).
       
    99 +**
       
   100 +** For more details regarding locking, see buffers.h in the GL core
       
   101 +*/
       
   102 +struct __GLdrawableBufferRec {
       
   103 +    /*
       
   104 +    ** Buffer dimensions
       
   105 +    */
       
   106 +    GLint width, height, depth;
       
   107 +
       
   108 +    /*
       
   109 +    ** Framebuffer base address
       
   110 +    */
       
   111 +    void *base;
       
   112 +
       
   113 +    /*
       
   114 +    ** Framebuffer size (in bytes)
       
   115 +    */
       
   116 +    GLuint size;
       
   117 +
       
   118 +    /*
       
   119 +    ** Size (in bytes) of each element in the framebuffer
       
   120 +    */
       
   121 +    GLuint elementSize;
       
   122 +    GLuint elementSizeLog2;
       
   123 +
       
   124 +    /*
       
   125 +    ** Element skip from one scanline to the next.
       
   126 +    ** If the buffer is part of another buffer (for example, fullscreen
       
   127 +    ** front buffer), outerWidth is the width of that buffer.
       
   128 +    */
       
   129 +    GLint outerWidth;
       
   130 +
       
   131 +    /*
       
   132 +    ** outerWidth * elementSize
       
   133 +    */
       
   134 +    GLint byteWidth;
       
   135 +
       
   136 +    /*
       
   137 +    ** Allocation/deallocation is done based on this handle.  A handle
       
   138 +    ** is conceptually different from the framebuffer 'base'.
       
   139 +    */
       
   140 +    void *handle;
       
   141 +
       
   142 +    /* imported */
       
   143 +    GLboolean (*resize)(__GLdrawableBuffer *buf,
       
   144 +			GLint x, GLint y, GLuint width, GLuint height, 
       
   145 +			__GLdrawablePrivate *glPriv, GLuint bufferMask);
       
   146 +    void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
       
   147 +    void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
       
   148 +    void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
       
   149 +    		GLuint val, GLint x, GLint y, GLint w, GLint h);
       
   150 +    void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
       
   151 +
       
   152 +    /* exported */
       
   153 +    void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
       
   154 +#ifdef __cplusplus
       
   155 +    void *privatePtr;
       
   156 +#else
       
   157 +    void *private;
       
   158 +#endif
       
   159 +
       
   160 +    /* private */
       
   161 +    void *other;	/* implementation private data */
       
   162 +    __GLbufMainInitFn mainInit;
       
   163 +    __GLbufFallbackInitFn fallbackInit;
       
   164 +};
       
   165 +
       
   166 +/*
       
   167 +** The context side of the drawable private
       
   168 +*/
       
   169 +struct __GLdrawablePrivateRec {
       
   170 +    /*
       
   171 +    ** Drawable Modes
       
   172 +    */
       
   173 +    __GLcontextModes *modes;
       
   174 +
       
   175 +    /*
       
   176 +    ** Drawable size
       
   177 +    */
       
   178 +    GLuint width, height;
       
   179 +
       
   180 +    /*
       
   181 +    ** Origin in screen coordinates of the drawable
       
   182 +    */
       
   183 +    GLint xOrigin, yOrigin;
       
   184 +#ifdef __GL_ALIGNED_BUFFERS
       
   185 +    /*
       
   186 +    ** Drawable offset from screen origin
       
   187 +    */
       
   188 +    GLint xOffset, yOffset;
       
   189 +
       
   190 +    /*
       
   191 +    ** Alignment restriction
       
   192 +    */
       
   193 +    GLint xAlignment, yAlignment;
       
   194 +#endif
       
   195 +    /*
       
   196 +    ** Should we invert the y axis?
       
   197 +    */
       
   198 +    GLint yInverted;
       
   199 +
       
   200 +    /*
       
   201 +    ** Mask specifying which buffers are renderable by the hw
       
   202 +    */
       
   203 +    GLuint accelBufferMask;
       
   204 +
       
   205 +    /*
       
   206 +    ** the buffers themselves
       
   207 +    */
       
   208 +    __GLdrawableBuffer frontBuffer;
       
   209 +    __GLdrawableBuffer backBuffer;
       
   210 +    __GLdrawableBuffer accumBuffer;
       
   211 +    __GLdrawableBuffer depthBuffer;
       
   212 +    __GLdrawableBuffer stencilBuffer;
       
   213 +#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
       
   214 +    __GLdrawableBuffer *auxBuffer;
       
   215 +#endif
       
   216 +
       
   217 +    __GLdrawableRegion ownershipRegion;
       
   218 +
       
   219 +    /*
       
   220 +    ** Lock for the drawable private structure
       
   221 +    */
       
   222 +    void *lock;
       
   223 +#ifdef DEBUG
       
   224 +    /* lock debugging info */
       
   225 +    int lockRefCount;
       
   226 +    int lockLine[10];
       
   227 +    char *lockFile[10];
       
   228 +#endif
       
   229 +
       
   230 +    /* imported */
       
   231 +    void *(*malloc)(size_t size);
       
   232 +    void *(*calloc)(size_t numElem, size_t elemSize);
       
   233 +    void *(*realloc)(void *oldAddr, size_t newSize);
       
   234 +    void (*free)(void *addr);
       
   235 +
       
   236 +    GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, 
       
   237 +			     GLint x, GLint y, GLsizei width, GLsizei height);
       
   238 +    void (*setClipRect)(__GLdrawablePrivate *glPriv, 
       
   239 +			GLint x, GLint y, GLsizei width, GLsizei height);
       
   240 +    void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
       
   241 +    GLboolean (*resize)(__GLdrawablePrivate *glPriv);
       
   242 +    void (*getDrawableSize)(__GLdrawablePrivate *glPriv, 
       
   243 +			    GLint *x, GLint *y, GLuint *width, GLuint *height);
       
   244 +
       
   245 +    void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
       
   246 +    void (*unlockDP)(__GLdrawablePrivate *glPriv);
       
   247 +
       
   248 +    /* exported */
       
   249 +#ifdef __cplusplus
       
   250 +    void *privatePtr;
       
   251 +#else
       
   252 +    void *private;
       
   253 +#endif
       
   254 +    void (*freePrivate)(__GLdrawablePrivate *);
       
   255 +
       
   256 +    /* client data */
       
   257 +    void *other;
       
   258 +};
       
   259 +
       
   260 +/*
       
   261 +** Macros to lock/unlock the drawable private
       
   262 +*/
       
   263 +#if defined(DEBUG)
       
   264 +#define __GL_LOCK_DP(glPriv,gc) \
       
   265 +    (*(glPriv)->lockDP)(glPriv,gc); \
       
   266 +    (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
       
   267 +    (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
       
   268 +    (glPriv)->lockRefCount++
       
   269 +#define __GL_UNLOCK_DP(glPriv) \
       
   270 +    (glPriv)->lockRefCount--; \
       
   271 +    (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
       
   272 +    (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
       
   273 +    (*(glPriv)->unlockDP)(glPriv)
       
   274 +#else /* DEBUG */
       
   275 +#define __GL_LOCK_DP(glPriv,gc)		(*(glPriv)->lockDP)(glPriv,gc)
       
   276 +#define	__GL_UNLOCK_DP(glPriv)		(*(glPriv)->unlockDP)(glPriv)
       
   277 +#endif /* DEBUG */
       
   278 +
       
   279 +
       
   280 +/*
       
   281 +** Procedures which are imported by the GL from the surrounding
       
   282 +** "operating system".  Math functions are not considered part of the
       
   283 +** "operating system".
       
   284 +*/
       
   285 +typedef struct __GLimportsRec {
       
   286 +    /* Memory management */
       
   287 +    void * (*malloc)(__GLcontext *gc, size_t size);
       
   288 +    void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
       
   289 +    void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
       
   290 +    void (*free)(__GLcontext *gc, void *addr);
       
   291 +
       
   292 +    /* Error handling */
       
   293 +    void (*warning)(__GLcontext *gc, char *fmt);
       
   294 +    void (*fatal)(__GLcontext *gc, char *fmt);
       
   295 +
       
   296 +    /* other system calls */
       
   297 +    char *(CAPI *getenv)(__GLcontext *gc, const char *var);
       
   298 +    int (CAPI *atoi)(__GLcontext *gc, const char *str);
       
   299 +    int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
       
   300 +    void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
       
   301 +    int (CAPI *fclose)(__GLcontext *gc, void *stream);
       
   302 +    int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
       
   303 +
       
   304 +    /* Drawing surface management */
       
   305 +    __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
       
   306 +    __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc);
       
   307 +
       
   308 +    /* Operating system dependent data goes here */
       
   309 +    void *other;
       
   310 +} __GLimports;
       
   311 +
       
   312 +/************************************************************************/
       
   313 +
       
   314 +/*
       
   315 +** Procedures which are exported by the GL to the surrounding "operating
       
   316 +** system" so that it can manage multiple GL context's.
       
   317 +*/
       
   318 +typedef struct __GLexportsRec {
       
   319 +    /* Context management (return GL_FALSE on failure) */
       
   320 +    GLboolean (*destroyContext)(__GLcontext *gc);
       
   321 +    GLboolean (*loseCurrent)(__GLcontext *gc);
       
   322 +    /* oldglPriv isn't used anymore, kept for backwards compatibility */
       
   323 +    GLboolean (*makeCurrent)(__GLcontext *gc);
       
   324 +    GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
       
   325 +    GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
       
   326 +    GLboolean (*forceCurrent)(__GLcontext *gc);
       
   327 +
       
   328 +    /* Drawing surface notification callbacks */
       
   329 +    GLboolean (*notifyResize)(__GLcontext *gc);
       
   330 +    void (*notifyDestroy)(__GLcontext *gc);
       
   331 +    void (*notifySwapBuffers)(__GLcontext *gc);
       
   332 +
       
   333 +    /* Dispatch table override control for external agents like libGLS */
       
   334 +    struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
       
   335 +    void (*beginDispatchOverride)(__GLcontext *gc);
       
   336 +    void (*endDispatchOverride)(__GLcontext *gc);
       
   337 +} __GLexports;
       
   338 +
       
   339 +/************************************************************************/
       
   340 +
       
   341 +/*
       
   342 +** This must be the first member of a __GLcontext structure.  This is the
       
   343 +** only part of a context that is exposed to the outside world; everything
       
   344 +** else is opaque.
       
   345 +*/
       
   346 +struct __GLinterfaceRec {
       
   347 +    __GLimports imports;
       
   348 +    __GLexports exports;
       
   349 +};
       
   350 +
       
   351 +extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
       
   352 +extern void __glCoreNopDispatch(void);
       
   353 +
       
   354  #endif /* __gl_core_h_ */
       
   355 
       
   356 --- src/mesa/drivers/dri/i965/intel_buffers.c     Thu Nov  1 08:30:52 2007
       
   357 +++ src/mesa/drivers/dri/i965/intel_buffers.c        Thu Sep  4 21:35:02 2008
       
   358 @@ -192,6 +192,7 @@
       
   359        }
       
   360     }
       
   361  
       
   362 +#if 0
       
   363     {
       
   364        if (intel->intelScreen->driScrnPriv->ddxMinor >= 7) {
       
   365          volatile drmI830Sarea *sarea = intel->sarea;
       
   366 @@ -224,6 +225,8 @@
       
   367           intel->vblank_flags &= ~VBLANK_FLAG_SECONDARY;
       
   368        }
       
   369     }
       
   370 +#endif
       
   371 +
       
   372     _mesa_resize_framebuffer(&intel->ctx,
       
   373                             (GLframebuffer*)dPriv->driverPrivate,
       
   374                             dPriv->w, dPriv->h);
       
   375 
       
   376 --- include/GL/glxext.h	Mon Oct  6 10:51:23 2008
       
   377 +++ include/GL/glxext.h	Mon Oct  6 10:54:36 2008
       
   378 @@ -406,10 +406,10 @@
       
   379  /* (as used in the GLX_OML_sync_control extension). */
       
   380  #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
       
   381  #include <inttypes.h>
       
   382 -#elif defined(__sun__) || defined(__digital__)
       
   383 +#elif defined(sun) || defined(__digital__)
       
   384  #include <inttypes.h>
       
   385 -#if defined(__STDC__)
       
   386 -#if defined(__arch64__) || defined(_LP64)
       
   387 +#elif defined(__STDC__)
       
   388 +#if defined(__arch64__)
       
   389  typedef long int int64_t;
       
   390  typedef unsigned long int uint64_t;
       
   391  #else
       
   392 @@ -434,7 +434,6 @@
       
   393  #else
       
   394  #include <inttypes.h>     /* Fallback option */
       
   395  #endif
       
   396 -#endif
       
   397  
       
   398  #ifndef GLX_VERSION_1_3
       
   399  #define GLX_VERSION_1_3 1
       
   400 --- include/GL/glext.h	Mon Oct  6 10:55:51 2008
       
   401 +++ include/GL/glext.h	Mon Oct  6 10:56:47 2008
       
   402 @@ -3739,10 +3739,10 @@
       
   403  /* (as used in the GL_EXT_timer_query extension). */
       
   404  #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
       
   405  #include <inttypes.h>
       
   406 -#elif defined(__sun__) || defined(__digital__)
       
   407 +#elif defined(sun)
       
   408  #include <inttypes.h>
       
   409 -#if defined(__STDC__)
       
   410 -#if defined(__arch64__) || defined(_LP64)
       
   411 +#elif defined(__STDC__)
       
   412 +#if defined(__arch64__)
       
   413  typedef long int int64_t;
       
   414  typedef unsigned long int uint64_t;
       
   415  #else
       
   416 @@ -3767,7 +3767,6 @@
       
   417  #else
       
   418  #include <inttypes.h>     /* Fallback option */
       
   419  #endif
       
   420 -#endif
       
   421  
       
   422  #ifndef GL_EXT_timer_query
       
   423  typedef int64_t GLint64EXT;