1 /**************************************************************************
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
30 #include "framebuffer.h"
32 #include "renderbuffer.h"
33 #include "simple_list.h"
39 #include "intel_screen.h"
41 #include "intel_context.h"
42 #include "intel_tex.h"
43 #include "intel_span.h"
44 #include "intel_ioctl.h"
45 #include "intel_regions.h"
46 #include "intel_bufmgr_ttm.h"
51 PUBLIC
const char __driConfigOptions
[] =
53 DRI_CONF_SECTION_PERFORMANCE
54 DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS
)
55 DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0
)
57 DRI_CONF_SECTION_QUALITY
58 DRI_CONF_FORCE_S3TC_ENABLE(false)
59 DRI_CONF_ALLOW_LARGE_TEXTURES(1)
62 const GLuint __driNConfigOptions
= 4;
64 #ifdef USE_NEW_INTERFACE
65 static PFNGLXCREATECONTEXTMODES create_context_modes
= NULL
;
66 #endif /*USE_NEW_INTERFACE*/
69 * Map all the memory regions described by the screen.
70 * \return GL_TRUE if success, GL_FALSE if error.
73 intelMapScreenRegions(__DRIscreenPrivate
*sPriv
)
75 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*)sPriv
->private;
77 if (intelScreen
->front
.handle
) {
79 intelScreen
->front
.handle
,
80 intelScreen
->front
.size
,
81 (drmAddress
*)&intelScreen
->front
.map
) != 0) {
82 _mesa_problem(NULL
, "drmMap(frontbuffer) failed!");
86 /* Use the old static allocation method if the server isn't setting up
87 * a movable handle for us. Add in the front buffer offset from
88 * framebuffer start, as our span routines (unlike other drivers) expect
89 * the renderbuffer address to point to the beginning of the
92 intelScreen
->front
.map
= (char *)sPriv
->pFB
;
93 if (intelScreen
->front
.map
== NULL
) {
94 fprintf(stderr
, "Failed to find framebuffer mapping\n");
100 intelScreen
->back
.handle
,
101 intelScreen
->back
.size
,
102 (drmAddress
*)&intelScreen
->back
.map
) != 0) {
103 intelUnmapScreenRegions(intelScreen
);
107 if (drmMap(sPriv
->fd
,
108 intelScreen
->depth
.handle
,
109 intelScreen
->depth
.size
,
110 (drmAddress
*)&intelScreen
->depth
.map
) != 0) {
111 intelUnmapScreenRegions(intelScreen
);
115 if (drmMap(sPriv
->fd
,
116 intelScreen
->tex
.handle
,
117 intelScreen
->tex
.size
,
118 (drmAddress
*)&intelScreen
->tex
.map
) != 0) {
119 intelUnmapScreenRegions(intelScreen
);
124 printf("Mappings: front: %p back: %p depth: %p tex: %p\n",
125 intelScreen
->front
.map
,
126 intelScreen
->back
.map
,
127 intelScreen
->depth
.map
,
128 intelScreen
->tex
.map
);
133 intelUnmapScreenRegions(intelScreenPrivate
*intelScreen
)
135 #define REALLY_UNMAP 1
136 /* If front.handle is present, we're doing the dynamic front buffer mapping,
137 * but if we've fallen back to static allocation then we shouldn't try to
140 if (intelScreen
->front
.handle
) {
142 if (drmUnmap(intelScreen
->front
.map
, intelScreen
->front
.size
) != 0)
143 printf("drmUnmap front failed!\n");
145 intelScreen
->front
.map
= NULL
;
147 if (intelScreen
->back
.map
) {
149 if (drmUnmap(intelScreen
->back
.map
, intelScreen
->back
.size
) != 0)
150 printf("drmUnmap back failed!\n");
152 intelScreen
->back
.map
= NULL
;
154 if (intelScreen
->depth
.map
) {
156 drmUnmap(intelScreen
->depth
.map
, intelScreen
->depth
.size
);
157 intelScreen
->depth
.map
= NULL
;
160 if (intelScreen
->tex
.map
) {
162 drmUnmap(intelScreen
->tex
.map
, intelScreen
->tex
.size
);
163 intelScreen
->tex
.map
= NULL
;
170 intelPrintDRIInfo(intelScreenPrivate
*intelScreen
,
171 __DRIscreenPrivate
*sPriv
,
174 fprintf(stderr
, "*** Front size: 0x%x offset: 0x%x pitch: %d\n",
175 intelScreen
->front
.size
, intelScreen
->front
.offset
,
176 intelScreen
->front
.pitch
);
177 fprintf(stderr
, "*** Back size: 0x%x offset: 0x%x pitch: %d\n",
178 intelScreen
->back
.size
, intelScreen
->back
.offset
,
179 intelScreen
->back
.pitch
);
180 fprintf(stderr
, "*** Depth size: 0x%x offset: 0x%x pitch: %d\n",
181 intelScreen
->depth
.size
, intelScreen
->depth
.offset
,
182 intelScreen
->depth
.pitch
);
183 fprintf(stderr
, "*** Rotated size: 0x%x offset: 0x%x pitch: %d\n",
184 intelScreen
->rotated
.size
, intelScreen
->rotated
.offset
,
185 intelScreen
->rotated
.pitch
);
186 fprintf(stderr
, "*** Texture size: 0x%x offset: 0x%x\n",
187 intelScreen
->tex
.size
, intelScreen
->tex
.offset
);
188 fprintf(stderr
, "*** Memory : 0x%x\n", gDRIPriv
->mem
);
193 intelPrintSAREA(volatile drmI830Sarea
*sarea
)
195 fprintf(stderr
, "SAREA: sarea width %d height %d\n", sarea
->width
, sarea
->height
);
196 fprintf(stderr
, "SAREA: pitch: %d\n", sarea
->pitch
);
198 "SAREA: front offset: 0x%08x size: 0x%x handle: 0x%x\n",
199 sarea
->front_offset
, sarea
->front_size
,
200 (unsigned) sarea
->front_handle
);
202 "SAREA: back offset: 0x%08x size: 0x%x handle: 0x%x\n",
203 sarea
->back_offset
, sarea
->back_size
,
204 (unsigned) sarea
->back_handle
);
205 fprintf(stderr
, "SAREA: depth offset: 0x%08x size: 0x%x handle: 0x%x\n",
206 sarea
->depth_offset
, sarea
->depth_size
,
207 (unsigned) sarea
->depth_handle
);
208 fprintf(stderr
, "SAREA: tex offset: 0x%08x size: 0x%x handle: 0x%x\n",
209 sarea
->tex_offset
, sarea
->tex_size
,
210 (unsigned) sarea
->tex_handle
);
211 fprintf(stderr
, "SAREA: rotation: %d\n", sarea
->rotation
);
213 "SAREA: rotated offset: 0x%08x size: 0x%x\n",
214 sarea
->rotated_offset
, sarea
->rotated_size
);
215 fprintf(stderr
, "SAREA: rotated pitch: %d\n", sarea
->rotated_pitch
);
220 * A number of the screen parameters are obtained/computed from
221 * information in the SAREA. This function updates those parameters.
224 intelUpdateScreenFromSAREA(intelScreenPrivate
*intelScreen
,
225 volatile drmI830Sarea
*sarea
)
227 intelScreen
->width
= sarea
->width
;
228 intelScreen
->height
= sarea
->height
;
230 intelScreen
->front
.offset
= sarea
->front_offset
;
231 intelScreen
->front
.pitch
= sarea
->pitch
* intelScreen
->cpp
;
232 intelScreen
->front
.handle
= sarea
->front_handle
;
233 intelScreen
->front
.size
= sarea
->front_size
;
234 intelScreen
->front
.tiled
= sarea
->front_tiled
;
236 intelScreen
->back
.offset
= sarea
->back_offset
;
237 intelScreen
->back
.pitch
= sarea
->pitch
* intelScreen
->cpp
;
238 intelScreen
->back
.handle
= sarea
->back_handle
;
239 intelScreen
->back
.size
= sarea
->back_size
;
240 intelScreen
->back
.tiled
= sarea
->back_tiled
;
242 intelScreen
->depth
.offset
= sarea
->depth_offset
;
243 intelScreen
->depth
.pitch
= sarea
->pitch
* intelScreen
->cpp
;
244 intelScreen
->depth
.handle
= sarea
->depth_handle
;
245 intelScreen
->depth
.size
= sarea
->depth_size
;
246 intelScreen
->depth
.tiled
= sarea
->depth_tiled
;
248 if (intelScreen
->driScrnPriv
->ddx_version
.minor
>= 9) {
249 intelScreen
->front
.bo_handle
= sarea
->front_bo_handle
;
250 intelScreen
->back
.bo_handle
= sarea
->back_bo_handle
;
251 intelScreen
->depth
.bo_handle
= sarea
->depth_bo_handle
;
253 intelScreen
->front
.bo_handle
= -1;
254 intelScreen
->back
.bo_handle
= -1;
255 intelScreen
->depth
.bo_handle
= -1;
258 intelScreen
->tex
.offset
= sarea
->tex_offset
;
259 intelScreen
->logTextureGranularity
= sarea
->log_tex_granularity
;
260 intelScreen
->tex
.handle
= sarea
->tex_handle
;
261 intelScreen
->tex
.size
= sarea
->tex_size
;
263 intelScreen
->rotated
.offset
= sarea
->rotated_offset
;
264 intelScreen
->rotated
.pitch
= sarea
->rotated_pitch
* intelScreen
->cpp
;
265 intelScreen
->rotated
.size
= sarea
->rotated_size
;
266 intelScreen
->rotated
.tiled
= sarea
->rotated_tiled
;
267 intelScreen
->current_rotation
= sarea
->rotation
;
269 matrix23Rotate(&intelScreen
->rotMatrix
,
270 sarea
->width
, sarea
->height
, sarea
->rotation
);
272 intelScreen
->rotatedWidth
= sarea
->virtualX
;
273 intelScreen
->rotatedHeight
= sarea
->virtualY
;
276 intelPrintSAREA(sarea
);
279 static const __DRIextension
*intelExtensions
[] = {
280 &driReadDrawableExtension
,
281 &driCopySubBufferExtension
.base
,
282 &driSwapControlExtension
.base
,
283 &driFrameTrackingExtension
.base
,
284 &driMediaStreamCounterExtension
.base
,
288 static GLboolean
intelInitDriver(__DRIscreenPrivate
*sPriv
)
290 intelScreenPrivate
*intelScreen
;
291 I830DRIPtr gDRIPriv
= (I830DRIPtr
)sPriv
->pDevPriv
;
292 volatile drmI830Sarea
*sarea
;
294 if (sPriv
->devPrivSize
!= sizeof(I830DRIRec
)) {
295 fprintf(stderr
,"\nERROR! sizeof(I830DRIRec) (%ld) does not match passed size from device driver (%d)\n", (unsigned long)sizeof(I830DRIRec
), sPriv
->devPrivSize
);
299 /* Allocate the private area */
300 intelScreen
= (intelScreenPrivate
*)CALLOC(sizeof(intelScreenPrivate
));
302 fprintf(stderr
,"\nERROR! Allocating private area failed\n");
305 /* parse information in __driConfigOptions */
306 driParseOptionInfo (&intelScreen
->optionCache
,
307 __driConfigOptions
, __driNConfigOptions
);
309 intelScreen
->driScrnPriv
= sPriv
;
310 sPriv
->private = (void *)intelScreen
;
311 intelScreen
->sarea_priv_offset
= gDRIPriv
->sarea_priv_offset
;
312 sarea
= (volatile drmI830Sarea
*)
313 (((GLubyte
*)sPriv
->pSAREA
)+intelScreen
->sarea_priv_offset
);
315 intelScreen
->deviceID
= gDRIPriv
->deviceID
;
316 intelScreen
->mem
= gDRIPriv
->mem
;
317 intelScreen
->cpp
= gDRIPriv
->cpp
;
319 switch (gDRIPriv
->bitsPerPixel
) {
320 case 15: intelScreen
->fbFormat
= DV_PF_555
; break;
321 case 16: intelScreen
->fbFormat
= DV_PF_565
; break;
322 case 32: intelScreen
->fbFormat
= DV_PF_8888
; break;
325 intelUpdateScreenFromSAREA(intelScreen
, sarea
);
328 intelPrintDRIInfo(intelScreen
, sPriv
, gDRIPriv
);
330 if (!intelMapScreenRegions(sPriv
)) {
331 fprintf(stderr
,"\nERROR! mapping regions\n");
332 _mesa_free(intelScreen
);
333 sPriv
->private = NULL
;
337 intelScreen
->drmMinor
= sPriv
->drm_version
.minor
;
339 /* Determine if IRQs are active? */
344 gp
.param
= I830_PARAM_IRQ_ACTIVE
;
345 gp
.value
= &intelScreen
->irq_active
;
347 ret
= drmCommandWriteRead( sPriv
->fd
, DRM_I830_GETPARAM
,
350 fprintf(stderr
, "drmI830GetParam: %d\n", ret
);
355 /* Determine if batchbuffers are allowed */
360 gp
.param
= I830_PARAM_ALLOW_BATCHBUFFER
;
361 gp
.value
= &intelScreen
->allow_batchbuffer
;
363 ret
= drmCommandWriteRead( sPriv
->fd
, DRM_I830_GETPARAM
,
366 fprintf(stderr
, "drmI830GetParam: (%d) %d\n", gp
.param
, ret
);
371 sPriv
->extensions
= intelExtensions
;
377 static void intelDestroyScreen(__DRIscreenPrivate
*sPriv
)
379 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*)sPriv
->private;
381 intelUnmapScreenRegions(intelScreen
);
383 sPriv
->private = NULL
;
386 static GLboolean
intelCreateBuffer( __DRIscreenPrivate
*driScrnPriv
,
387 __DRIdrawablePrivate
*driDrawPriv
,
388 const __GLcontextModes
*mesaVis
,
391 intelScreenPrivate
*screen
= (intelScreenPrivate
*) driScrnPriv
->private;
394 return GL_FALSE
; /* not implemented */
396 GLboolean swStencil
= (mesaVis
->stencilBits
> 0 &&
397 mesaVis
->depthBits
!= 24);
399 struct gl_framebuffer
*fb
= _mesa_create_framebuffer(mesaVis
);
402 driRenderbuffer
*frontRb
403 = driNewRenderbuffer(GL_RGBA
,
406 screen
->front
.offset
, screen
->front
.pitch
,
408 intelSetSpanFunctions(frontRb
, mesaVis
);
409 _mesa_add_renderbuffer(fb
, BUFFER_FRONT_LEFT
, &frontRb
->Base
);
412 if (mesaVis
->doubleBufferMode
) {
413 driRenderbuffer
*backRb
414 = driNewRenderbuffer(GL_RGBA
,
417 screen
->back
.offset
, screen
->back
.pitch
,
419 intelSetSpanFunctions(backRb
, mesaVis
);
420 _mesa_add_renderbuffer(fb
, BUFFER_BACK_LEFT
, &backRb
->Base
);
423 if (mesaVis
->depthBits
== 16) {
424 driRenderbuffer
*depthRb
425 = driNewRenderbuffer(GL_DEPTH_COMPONENT16
,
428 screen
->depth
.offset
, screen
->depth
.pitch
,
430 intelSetSpanFunctions(depthRb
, mesaVis
);
431 _mesa_add_renderbuffer(fb
, BUFFER_DEPTH
, &depthRb
->Base
);
433 else if (mesaVis
->depthBits
== 24) {
434 driRenderbuffer
*depthRb
435 = driNewRenderbuffer(GL_DEPTH_COMPONENT24
,
438 screen
->depth
.offset
, screen
->depth
.pitch
,
440 intelSetSpanFunctions(depthRb
, mesaVis
);
441 _mesa_add_renderbuffer(fb
, BUFFER_DEPTH
, &depthRb
->Base
);
444 if (mesaVis
->stencilBits
> 0 && !swStencil
) {
445 driRenderbuffer
*stencilRb
446 = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT
,
449 screen
->depth
.offset
, screen
->depth
.pitch
,
451 intelSetSpanFunctions(stencilRb
, mesaVis
);
452 _mesa_add_renderbuffer(fb
, BUFFER_STENCIL
, &stencilRb
->Base
);
455 _mesa_add_soft_renderbuffers(fb
,
456 GL_FALSE
, /* color */
457 GL_FALSE
, /* depth */
459 mesaVis
->accumRedBits
> 0,
460 GL_FALSE
, /* alpha */
462 driDrawPriv
->driverPrivate
= (void *) fb
;
464 return (driDrawPriv
->driverPrivate
!= NULL
);
468 static void intelDestroyBuffer(__DRIdrawablePrivate
*driDrawPriv
)
470 _mesa_unreference_framebuffer((GLframebuffer
**)(&(driDrawPriv
->driverPrivate
)));
475 * Get information about previous buffer swaps.
478 intelGetSwapInfo( __DRIdrawablePrivate
*dPriv
, __DRIswapInfo
* sInfo
)
480 struct intel_context
*intel
;
482 if ( (dPriv
== NULL
) || (dPriv
->driContextPriv
== NULL
)
483 || (dPriv
->driContextPriv
->driverPrivate
== NULL
)
484 || (sInfo
== NULL
) ) {
488 intel
= dPriv
->driContextPriv
->driverPrivate
;
489 sInfo
->swap_count
= intel
->swap_count
;
490 sInfo
->swap_ust
= intel
->swap_ust
;
491 sInfo
->swap_missed_count
= intel
->swap_missed_count
;
493 sInfo
->swap_missed_usage
= (sInfo
->swap_missed_count
!= 0)
494 ? driCalculateSwapUsage( dPriv
, 0, intel
->swap_missed_ust
)
501 /* There are probably better ways to do this, such as an
502 * init-designated function to register chipids and createcontext
505 extern GLboolean
i830CreateContext( const __GLcontextModes
*mesaVis
,
506 __DRIcontextPrivate
*driContextPriv
,
507 void *sharedContextPrivate
);
509 extern GLboolean
i915CreateContext( const __GLcontextModes
*mesaVis
,
510 __DRIcontextPrivate
*driContextPriv
,
511 void *sharedContextPrivate
);
513 extern GLboolean
brwCreateContext( const __GLcontextModes
*mesaVis
,
514 __DRIcontextPrivate
*driContextPriv
,
515 void *sharedContextPrivate
);
520 static GLboolean
intelCreateContext( const __GLcontextModes
*mesaVis
,
521 __DRIcontextPrivate
*driContextPriv
,
522 void *sharedContextPrivate
)
525 __DRIscreenPrivate
*sPriv
= driContextPriv
->driScreenPriv
;
526 intelScreenPrivate
*intelScreen
= (intelScreenPrivate
*)sPriv
->private;
527 switch (intelScreen
->deviceID
) {
529 case PCI_CHIP_I830_M
:
530 case PCI_CHIP_I855_GM
:
531 case PCI_CHIP_I865_G
:
532 return i830CreateContext( mesaVis
, driContextPriv
,
533 sharedContextPrivate
);
535 case PCI_CHIP_I915_G
:
536 case PCI_CHIP_I915_GM
:
537 case PCI_CHIP_I945_G
:
538 case PCI_CHIP_I945_GM
:
539 return i915CreateContext( mesaVis
, driContextPriv
,
540 sharedContextPrivate
);
543 fprintf(stderr
, "Unrecognized deviceID %x\n", intelScreen
->deviceID
);
547 return brwCreateContext( mesaVis
, driContextPriv
,
548 sharedContextPrivate
);
553 static const struct __DriverAPIRec intelAPI
= {
554 .DestroyScreen
= intelDestroyScreen
,
555 .CreateContext
= intelCreateContext
,
556 .DestroyContext
= intelDestroyContext
,
557 .CreateBuffer
= intelCreateBuffer
,
558 .DestroyBuffer
= intelDestroyBuffer
,
559 .SwapBuffers
= intelSwapBuffers
,
560 .MakeCurrent
= intelMakeCurrent
,
561 .UnbindContext
= intelUnbindContext
,
562 .GetSwapInfo
= intelGetSwapInfo
,
563 .GetMSC
= driGetMSC32
,
564 .GetDrawableMSC
= driDrawableGetMSC32
,
565 .WaitForMSC
= driWaitForMSC32
,
567 .SwapBuffersMSC
= NULL
,
568 .CopySubBuffer
= intelCopySubBuffer
572 static __GLcontextModes
*
573 intelFillInModes( unsigned pixel_bits
, unsigned depth_bits
,
574 unsigned stencil_bits
, GLboolean have_back_buffer
)
576 __GLcontextModes
* modes
;
577 __GLcontextModes
* m
;
579 unsigned depth_buffer_factor
;
580 unsigned back_buffer_factor
;
584 /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
585 * support pageflipping at all.
587 static const GLenum back_buffer_modes
[] = {
588 GLX_NONE
, GLX_SWAP_UNDEFINED_OML
, GLX_SWAP_COPY_OML
591 u_int8_t depth_bits_array
[3];
592 u_int8_t stencil_bits_array
[3];
595 depth_bits_array
[0] = 0;
596 depth_bits_array
[1] = depth_bits
;
597 depth_bits_array
[2] = depth_bits
;
599 /* Just like with the accumulation buffer, always provide some modes
600 * with a stencil buffer. It will be a sw fallback, but some apps won't
603 stencil_bits_array
[0] = 0;
604 stencil_bits_array
[1] = 0;
605 stencil_bits_array
[2] = (stencil_bits
== 0) ? 8 : stencil_bits
;
607 depth_buffer_factor
= ((depth_bits
!= 0) || (stencil_bits
!= 0)) ? 3 : 1;
608 back_buffer_factor
= (have_back_buffer
) ? 3 : 1;
610 num_modes
= depth_buffer_factor
* back_buffer_factor
* 4;
612 if ( pixel_bits
== 16 ) {
614 fb_type
= GL_UNSIGNED_SHORT_5_6_5
;
618 fb_type
= GL_UNSIGNED_INT_8_8_8_8_REV
;
621 modes
= (*dri_interface
->createContextModes
)( num_modes
, sizeof( __GLcontextModes
) );
623 if ( ! driFillInModes( & m
, fb_format
, fb_type
,
624 depth_bits_array
, stencil_bits_array
, depth_buffer_factor
,
625 back_buffer_modes
, back_buffer_factor
,
627 fprintf( stderr
, "[%s:%u] Error creating FBConfig!\n",
628 __func__
, __LINE__
);
631 if ( ! driFillInModes( & m
, fb_format
, fb_type
,
632 depth_bits_array
, stencil_bits_array
, depth_buffer_factor
,
633 back_buffer_modes
, back_buffer_factor
,
634 GLX_DIRECT_COLOR
) ) {
635 fprintf( stderr
, "[%s:%u] Error creating FBConfig!\n",
636 __func__
, __LINE__
);
640 /* Mark the visual as slow if there are "fake" stencil bits.
642 for ( m
= modes
; m
!= NULL
; m
= m
->next
) {
643 if ( (m
->stencilBits
!= 0) && (m
->stencilBits
!= stencil_bits
) ) {
644 m
->visualRating
= GLX_SLOW_CONFIG
;
653 * This is the driver specific part of the createNewScreen entry point.
655 * \todo maybe fold this into intelInitDriver
657 * \return the __GLcontextModes supported by this driver
659 __GLcontextModes
*__driDriverInitScreen(__DRIscreenPrivate
*psp
)
661 static const __DRIversion ddx_expected
= { 1, 6, 0 };
662 static const __DRIversion dri_expected
= { 4, 0, 0 };
663 static const __DRIversion drm_expected
= { 1, 3, 0 };
664 I830DRIPtr dri_priv
= (I830DRIPtr
) psp
->pDevPriv
;
666 psp
->DriverAPI
= intelAPI
;
667 if ( ! driCheckDriDdxDrmVersions2( "i915",
668 &psp
->dri_version
, &dri_expected
,
669 &psp
->ddx_version
, &ddx_expected
,
670 &psp
->drm_version
, &drm_expected
) ) {
674 /* Calling driInitExtensions here, with a NULL context pointer,
675 * does not actually enable the extensions. It just makes sure
676 * that all the dispatch offsets for all the extensions that
677 * *might* be enables are known. This is needed because the
678 * dispatch offsets need to be known when _mesa_context_create is
679 * called, but we can't enable the extensions until we have a
682 * Hello chicken. Hello egg. How are you two today?
684 intelInitExtensions(NULL
, GL_FALSE
);
686 if (!intelInitDriver(psp
))
689 return intelFillInModes( dri_priv
->cpp
* 8,
690 (dri_priv
->cpp
== 2) ? 16 : 24,
691 (dri_priv
->cpp
== 2) ? 0 : 8,