aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/dri
diff options
context:
space:
mode:
authorAlan Hourihane <[email protected]>2008-06-12 00:11:54 +0100
committerAlan Hourihane <[email protected]>2008-06-12 00:11:54 +0100
commit6f7ed99b306990f284f9d57c0b66efaa7f2277e1 (patch)
tree23819c5863553573f6cf70de8e5ee127a875b63b /src/gallium/winsys/dri
parent2161b0fafcdc16703162dd489d2ec1e7114cce4c (diff)
revert the DRI2 commits
Diffstat (limited to 'src/gallium/winsys/dri')
-rw-r--r--src/gallium/winsys/dri/intel/intel_context.c81
-rw-r--r--src/gallium/winsys/dri/intel/intel_lock.c7
-rw-r--r--src/gallium/winsys/dri/intel/intel_screen.c375
-rw-r--r--src/gallium/winsys/dri/intel/intel_screen.h4
-rw-r--r--src/gallium/winsys/dri/intel/intel_swapbuffers.c3
5 files changed, 159 insertions, 311 deletions
diff --git a/src/gallium/winsys/dri/intel/intel_context.c b/src/gallium/winsys/dri/intel/intel_context.c
index 9d78e9ebf8c..8284e0edbb9 100644
--- a/src/gallium/winsys/dri/intel/intel_context.c
+++ b/src/gallium/winsys/dri/intel/intel_context.c
@@ -28,8 +28,6 @@
#include "i830_dri.h"
-#include "state_tracker/st_public.h"
-#include "state_tracker/st_context.h"
#include "intel_screen.h"
#include "intel_context.h"
#include "intel_swapbuffers.h"
@@ -38,6 +36,8 @@
#include "i915simple/i915_screen.h"
+#include "state_tracker/st_public.h"
+#include "state_tracker/st_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_context.h"
@@ -67,6 +67,7 @@ int __intel_debug = 0;
#define need_GL_NV_vertex_program
#include "extension_helper.h"
+
/**
* Extension strings exported by the intel driver.
*
@@ -74,7 +75,7 @@ int __intel_debug = 0;
* It appears that ARB_texture_env_crossbar has "disappeared" compared to the
* old i830-specific driver.
*/
-static const struct dri_extension card_extensions[] = {
+const struct dri_extension card_extensions[] = {
{"GL_ARB_multisample", GL_ARB_multisample_functions},
{"GL_ARB_multitexture", NULL},
{"GL_ARB_point_parameters", GL_ARB_point_parameters_functions},
@@ -85,27 +86,22 @@ static const struct dri_extension card_extensions[] = {
{"GL_ARB_texture_env_combine", NULL},
{"GL_ARB_texture_env_dot3", NULL},
{"GL_ARB_texture_mirrored_repeat", NULL},
- {"GL_ARB_texture_non_power_of_two", NULL },
{"GL_ARB_texture_rectangle", NULL},
- {"GL_NV_texture_rectangle", NULL},
- {"GL_EXT_texture_rectangle", NULL},
- {"GL_ARB_point_parameters", NULL},
{"GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions},
+ {"GL_ARB_pixel_buffer_object", NULL},
{"GL_ARB_vertex_program", GL_ARB_vertex_program_functions},
{"GL_ARB_window_pos", GL_ARB_window_pos_functions},
{"GL_EXT_blend_color", GL_EXT_blend_color_functions},
- {"GL_EXT_blend_equation_separate",
- GL_EXT_blend_equation_separate_functions},
+ {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions},
{"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions},
{"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions},
- {"GL_EXT_blend_logic_op", NULL},
{"GL_EXT_blend_subtract", NULL},
{"GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions},
{"GL_EXT_fog_coord", GL_EXT_fog_coord_functions},
+ {"GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
{"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
-#if 1 /* XXX FBO temporary? */
{"GL_EXT_packed_depth_stencil", NULL},
-#endif
+ {"GL_EXT_pixel_buffer_object", NULL},
{"GL_EXT_secondary_color", GL_EXT_secondary_color_functions},
{"GL_EXT_stencil_wrap", NULL},
{"GL_EXT_texture_edge_clamp", NULL},
@@ -120,61 +116,10 @@ static const struct dri_extension card_extensions[] = {
{"GL_NV_blend_square", NULL},
{"GL_NV_vertex_program", GL_NV_vertex_program_functions},
{"GL_NV_vertex_program1_1", NULL},
- { "GL_SGIS_generate_mipmap", NULL },
+ {"GL_SGIS_generate_mipmap", NULL },
{NULL, NULL}
};
-#if 0
-static const struct dri_extension brw_extensions[] = {
- { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions},
- { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions},
- { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions},
- { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions},
- { "GL_ARB_point_sprite", NULL},
- { "GL_ARB_fragment_shader", NULL },
- { "GL_ARB_draw_buffers", NULL },
- { "GL_ARB_depth_texture", NULL },
- { "GL_ARB_fragment_program", NULL },
- { "GL_ARB_shadow", NULL },
- { "GL_EXT_shadow_funcs", NULL },
- /* ARB extn won't work if not enabled */
- { "GL_SGIX_depth_texture", NULL },
- { "GL_ARB_texture_env_crossbar", NULL },
- { "GL_EXT_texture_sRGB", NULL},
- { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions},
- { "GL_ARB_pixel_buffer_object", NULL},
- { NULL, NULL }
-};
-
-static const struct dri_extension arb_oc_extensions[] = {
- {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
- {NULL, NULL}
-};
-#endif
-
-/**
- * Initializes potential list of extensions if ctx == NULL, or actually enables
- * extensions for a context.
- */
-void intelInitExtensions(struct intel_context *intel, GLboolean enable_imaging)
-{
- GLcontext *ctx = intel ? intel->st->ctx : NULL;
- /* Disable imaging extension until convolution is working in teximage paths.
- */
- enable_imaging = GL_FALSE;
-
- driInitExtensions(ctx, card_extensions, enable_imaging);
-
-#if 0
- if (intel == NULL ||
- (IS_965(intel->intelScreen->deviceID) &&
- intel->intelScreen->drmMinor >= 8))
- driInitExtensions(ctx, arb_oc_extensions, GL_FALSE);
-
- if (intel == NULL || IS_965(intel->intelScreen->deviceID))
- driInitExtensions(ctx, brw_extensions, GL_FALSE);
-#endif
-}
#ifdef DEBUG
@@ -259,10 +204,10 @@ intelCreateContext(const __GLcontextModes * visual,
/*
* memory pools
*/
- DRM_LIGHT_LOCK(sPriv->fd, &sPriv->lock, driContextPriv->hHWContext);
+ DRM_LIGHT_LOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
// ZZZ JB should be per screen and not be done per context
havePools = intelCreatePools(sPriv);
- DRM_UNLOCK(sPriv->fd, &sPriv->lock, driContextPriv->hHWContext);
+ DRM_UNLOCK(sPriv->fd, &sPriv->pSAREA->lock, driContextPriv->hHWContext);
if (!havePools)
return GL_FALSE;
@@ -270,7 +215,7 @@ intelCreateContext(const __GLcontextModes * visual,
/* Dri stuff */
intel->hHWContext = driContextPriv->hHWContext;
intel->driFd = sPriv->fd;
- intel->driHwLock = (drmLock *) & sPriv->lock;
+ intel->driHwLock = (drmLock *) & sPriv->pSAREA->lock;
fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode");
intel->iw.irq_seq = -1;
@@ -320,7 +265,7 @@ intelCreateContext(const __GLcontextModes * visual,
intel->st = st_create_context(pipe, visual, st_share);
- intelInitExtensions( intel, GL_TRUE );
+ driInitExtensions( intel->st->ctx, card_extensions, GL_TRUE );
return GL_TRUE;
}
diff --git a/src/gallium/winsys/dri/intel/intel_lock.c b/src/gallium/winsys/dri/intel/intel_lock.c
index 469090c0e17..406284c98fb 100644
--- a/src/gallium/winsys/dri/intel/intel_lock.c
+++ b/src/gallium/winsys/dri/intel/intel_lock.c
@@ -50,9 +50,6 @@ intelContendedLock(struct intel_context *intel, uint flags)
DBG(LOCK, "%s - got contended lock\n", __progname);
- if (sPriv->dri2.enabled)
- return;
-
/* If the window moved, may need to set a new cliprect now.
*
* NOTE: This releases and regains the hw lock, so all state
@@ -61,8 +58,8 @@ intelContendedLock(struct intel_context *intel, uint flags)
if (dPriv)
DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
- if (sarea && (sarea->width != intelScreen->front.width ||
- sarea->height != intelScreen->front.height)) {
+ if (sarea->width != intelScreen->front.width ||
+ sarea->height != intelScreen->front.height) {
intelUpdateScreenRotation(sPriv, sarea);
}
diff --git a/src/gallium/winsys/dri/intel/intel_screen.c b/src/gallium/winsys/dri/intel/intel_screen.c
index e456c28d0d7..8817a80a5a5 100644
--- a/src/gallium/winsys/dri/intel/intel_screen.c
+++ b/src/gallium/winsys/dri/intel/intel_screen.c
@@ -60,114 +60,7 @@ static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
extern const struct dri_extension card_extensions[];
-static GLboolean
-intel_get_param(__DRIscreenPrivate *psp, int param, int *value)
-{
- int ret;
- struct drm_i915_getparam gp;
-
- gp.param = param;
- gp.value = value;
- ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drm_i915_getparam: %d\n", ret);
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static void
-intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
- unsigned long long offset, int depth, uint pitch)
-{
- abort();
-#if 0
- struct intel_context *intel = (struct intel_context*)
- ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
- struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
- struct st_texture_object *stObj = st_texture_object(tObj);
-
- if (!stObj)
- return;
-
- if (stObj->pt)
- st->pipe->texture_release(intel->st->pipe, &stObj->pt);
-
- stObj->imageOverride = GL_TRUE;
- stObj->depthOverride = depth;
- stObj->pitchOverride = pitch;
-
- if (offset)
- stObj->textureOffset = offset;
-#endif
-}
-
-
-static void
-intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv,
- __DRIcontextPrivate *pcp,
- __DRIDrawableConfigEvent *event)
-{
- (void) dPriv;
- (void) pcp;
- (void) event;
-}
-
-static void
-intelHandleBufferAttach(__DRIdrawablePrivate *dPriv,
- __DRIcontextPrivate *pcp,
- __DRIBufferAttachEvent *ba)
-{
- struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv);
-
- switch (ba->buffer.attachment) {
- case DRI_DRAWABLE_BUFFER_FRONT_LEFT:
- intelScreen->front.width = dPriv->w;
- intelScreen->front.height = dPriv->h;
- intelScreen->front.cpp = ba->buffer.cpp;
- intelScreen->front.pitch = ba->buffer.pitch;
- driGenBuffers(intelScreen->base.staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0);
- driBOSetReferenced(intelScreen->front.buffer, ba->buffer.handle);
- break;
-
- case DRI_DRAWABLE_BUFFER_BACK_LEFT:
- case DRI_DRAWABLE_BUFFER_DEPTH:
- case DRI_DRAWABLE_BUFFER_STENCIL:
- case DRI_DRAWABLE_BUFFER_ACCUM:
- /* anything ?? */
- break;
-
- default:
- fprintf(stderr, "unhandled buffer attach event, attachment type %d\n",
- ba->buffer.attachment);
- return;
- }
-}
-
-static const __DRItexOffsetExtension intelTexOffsetExtension = {
- { __DRI_TEX_OFFSET },
- intelSetTexOffset,
-};
-
-#if 0
-static const __DRItexBufferExtension intelTexBufferExtension = {
- { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
- intelSetTexBuffer,
-};
-#endif
-
-static const __DRIextension *intelScreenExtensions[] = {
- &driReadDrawableExtension,
- &driCopySubBufferExtension.base,
- &driSwapControlExtension.base,
- &driFrameTrackingExtension.base,
- &driMediaStreamCounterExtension.base,
- &intelTexOffsetExtension.base,
-// &intelTexBufferExtension.base,
- NULL
-};
static void
@@ -284,8 +177,7 @@ intelCreatePools(__DRIscreenPrivate * sPriv)
intelScreen->havePools = GL_TRUE;
- if (intelScreen->sarea)
- intelUpdateScreenRotation(sPriv, intelScreen->sarea);
+ intelUpdateScreenRotation(sPriv, intelScreen->sarea);
return GL_TRUE;
}
@@ -318,6 +210,11 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
struct intel_screen *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
+ getProcAddress("glxEnableExtension"));
+ void *const psc = sPriv->psc->screenConfigs;
+
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
fprintf(stderr,
"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
@@ -334,19 +231,28 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
__driConfigOptions, __driNConfigOptions);
sPriv->private = (void *) intelScreen;
- intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) +
- gDRIPriv->sarea_priv_offset);
+ intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) +
+ gDRIPriv->sarea_priv_offset);
intelScreen->deviceID = gDRIPriv->deviceID;
-
intelScreen->front.cpp = gDRIPriv->cpp;
- intelScreen->drmMinor = sPriv->drm_version.minor;
+ intelScreen->drmMinor = sPriv->drmMinor;
+
+ assert(gDRIPriv->bitsPerPixel == 16 ||
+ gDRIPriv->bitsPerPixel == 32);
+
intelUpdateScreenRotation(sPriv, intelScreen->sarea);
if (0)
intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
- sPriv->extensions = intelScreenExtensions;
+ if (glx_enable_extension != NULL) {
+ (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
+ (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
+ (*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
+ }
intel_be_init_device(&intelScreen->base, sPriv->fd);
intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
@@ -445,19 +351,65 @@ intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
return 0;
}
-static __DRIconfig **
-intelFillInModes(__DRIscreenPrivate *psp,
- unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, GLboolean have_back_buffer)
+
+static void
+intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
+ unsigned long long offset, int depth, uint pitch)
+{
+ abort();
+#if 0
+ struct intel_context *intel = (struct intel_context*)
+ ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
+ struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
+ struct st_texture_object *stObj = st_texture_object(tObj);
+
+ if (!stObj)
+ return;
+
+ if (stObj->pt)
+ st->pipe->texture_release(intel->st->pipe, &stObj->pt);
+
+ stObj->imageOverride = GL_TRUE;
+ stObj->depthOverride = depth;
+ stObj->pitchOverride = pitch;
+
+ if (offset)
+ stObj->textureOffset = offset;
+#endif
+}
+
+
+static const struct __DriverAPIRec intelAPI = {
+ .InitDriver = intelInitDriver,
+ .DestroyScreen = intelDestroyScreen,
+ .CreateContext = intelCreateContext,
+ .DestroyContext = intelDestroyContext,
+ .CreateBuffer = intelCreateBuffer,
+ .DestroyBuffer = intelDestroyBuffer,
+ .SwapBuffers = intelSwapBuffers,
+ .MakeCurrent = intelMakeCurrent,
+ .UnbindContext = intelUnbindContext,
+ .GetSwapInfo = intelGetSwapInfo,
+ .GetMSC = driGetMSC32,
+ .WaitForMSC = driWaitForMSC32,
+ .WaitForSBC = NULL,
+ .SwapBuffersMSC = NULL,
+ .CopySubBuffer = intelCopySubBuffer,
+ .setTexOffset = intelSetTexOffset,
+};
+
+
+static __GLcontextModes *
+intelFillInModes(unsigned pixel_bits, unsigned depth_bits,
+ unsigned stencil_bits, boolean have_back_buffer)
{
- __DRIconfig **configs;
+ __GLcontextModes *modes;
__GLcontextModes *m;
unsigned num_modes;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
GLenum fb_format;
GLenum fb_type;
- int i;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
@@ -499,143 +451,100 @@ intelFillInModes(__DRIscreenPrivate *psp,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- configs = driCreateConfigs(fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor);
- if (configs == NULL) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ modes =
+ (*dri_interface->createContextModes) (num_modes,
+ sizeof(__GLcontextModes));
+ m = modes;
+ if (!driFillInModes(&m, fb_format, fb_type,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor, GLX_TRUE_COLOR)) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
+ if (!driFillInModes(&m, fb_format, fb_type,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor, GLX_DIRECT_COLOR)) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
return NULL;
}
/* Mark the visual as slow if there are "fake" stencil bits.
*/
- for (i = 0; configs[i]; i++) {
- m = &configs[i]->modes;
+ for (m = modes; m != NULL; m = m->next) {
if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
m->visualRating = GLX_SLOW_CONFIG;
}
}
- return configs;
+ return modes;
}
+
/**
- * This is the driver specific part of the createNewScreen entry point.
- *
- * \todo maybe fold this into intelInitDriver
+ * This is the bootstrap function for the driver. libGL supplies all of the
+ * requisite information about the system, and the driver initializes itself.
+ * This routine also fills in the linked list pointed to by \c driver_modes
+ * with the \c __GLcontextModes that the driver can support for windows or
+ * pbuffers.
*
- * \return the __GLcontextModes supported by this driver
+ * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
+ * failure.
*/
-static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp)
+PUBLIC void *
+__driCreateNewScreen_20050727(__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,
+ drmAddress pSAREA, int fd,
+ int internal_api_version,
+ const __DRIinterfaceMethods * interface,
+ __GLcontextModes ** driver_modes)
{
-#ifdef I915
- static const __DRIversion ddx_expected = { 1, 5, 0 };
-#else
- static const __DRIversion ddx_expected = { 1, 6, 0 };
-#endif
+ __DRIscreenPrivate *psp;
+ static const __DRIversion ddx_expected = { 1, 7, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 5, 0 };
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
+ static const __DRIversion drm_expected = { 1, 7, 0 };
+
+ dri_interface = interface;
if (!driCheckDriDdxDrmVersions2("i915",
- &psp->dri_version, &dri_expected,
- &psp->ddx_version, &ddx_expected,
- &psp->drm_version, &drm_expected)) {
+ dri_version, &dri_expected,
+ ddx_version, &ddx_expected,
+ drm_version, &drm_expected)) {
return NULL;
}
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is
- * called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- intelInitExtensions(NULL, GL_TRUE);
-
- if (!intelInitDriver(psp))
- return NULL;
-
- psp->extensions = intelScreenExtensions;
-
- return (const __DRIconfig **)
- intelFillInModes(psp, dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8, 1);
-}
-
-/**
- * This is the driver specific part of the createNewScreen entry point.
- *
- * \return the __GLcontextModes supported by this driver
- */
-static const
-__DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
-{
- struct intel_screen *intelScreen;
-
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is
- * called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- intelInitExtensions(NULL, GL_TRUE);
-
- /* Allocate the private area */
- intelScreen = CALLOC_STRUCT(intel_screen);
- if (!intelScreen) {
- fprintf(stderr, "\nERROR! Allocating private area failed\n");
- return GL_FALSE;
+ psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
+ ddx_version, dri_version, drm_version,
+ frame_buffer, pSAREA, fd,
+ internal_api_version, &intelAPI);
+
+ if (psp != NULL) {
+ I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
+ *driver_modes = intelFillInModes(dri_priv->cpp * 8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8, 1);
+
+ /* Calling driInitExtensions here, with a NULL context pointer,
+ * does not actually enable the extensions. It just makes sure
+ * that all the dispatch offsets for all the extensions that
+ * *might* be enables are known. This is needed because the
+ * dispatch offsets need to be known when _mesa_context_create
+ * is called, but we can't enable the extensions until we have a
+ * context pointer.
+ *
+ * Hello chicken. Hello egg. How are you two today?
+ */
+ driInitExtensions(NULL, card_extensions, GL_FALSE);
}
- /* parse information in __driConfigOptions */
- driParseOptionInfo(&intelScreen->optionCache,
- __driConfigOptions, __driNConfigOptions);
-
- psp->private = (void *) intelScreen;
-
- intelScreen->drmMinor = psp->drm_version.minor;
- /* Determine chipset ID? */
- if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
- &intelScreen->deviceID))
- return GL_FALSE;
-
- psp->extensions = intelScreenExtensions;
-
- intel_be_init_device(&intelScreen->base, psp->fd);
- intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
- intelScreen->base.base.get_name = intel_get_name;
-
- return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1),
- intelFillInModes(psp, 32, 24, 8, 1));
+ return (void *) psp;
}
-const struct __DriverAPIRec driDriverAPI = {
- .InitScreen = intelInitScreen,
- .DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
- .DestroyContext = intelDestroyContext,
- .CreateBuffer = intelCreateBuffer,
- .DestroyBuffer = intelDestroyBuffer,
- .SwapBuffers = intelSwapBuffers,
- .MakeCurrent = intelMakeCurrent,
- .UnbindContext = intelUnbindContext,
- .GetSwapInfo = intelGetSwapInfo,
- .GetDrawableMSC = driDrawableGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .CopySubBuffer = intelCopySubBuffer,
-
- .InitScreen2 = intelInitScreen2,
- .HandleDrawableConfig = intelHandleDrawableConfig,
- .HandleBufferAttach = intelHandleBufferAttach,
-};
diff --git a/src/gallium/winsys/dri/intel/intel_screen.h b/src/gallium/winsys/dri/intel/intel_screen.h
index 5a3ae1dc0f8..80369179031 100644
--- a/src/gallium/winsys/dri/intel/intel_screen.h
+++ b/src/gallium/winsys/dri/intel/intel_screen.h
@@ -32,7 +32,7 @@
#include "i830_common.h"
#include "xmlconfig.h"
#include "intel_drm/ws_dri_bufpool.h"
-#include "state_tracker/st_context.h"
+
#include "pipe/p_compiler.h"
#include "intel_drm/intel_be_device.h"
@@ -116,7 +116,5 @@ intelCreateContext(const __GLcontextModes * visual,
__DRIcontextPrivate * driContextPriv,
void *sharedContextPrivate);
-extern void
-intelInitExtensions(struct intel_context *intel, GLboolean enable_imaging);
#endif
diff --git a/src/gallium/winsys/dri/intel/intel_swapbuffers.c b/src/gallium/winsys/dri/intel/intel_swapbuffers.c
index 8b17154cf9b..7f3babd98ef 100644
--- a/src/gallium/winsys/dri/intel/intel_swapbuffers.c
+++ b/src/gallium/winsys/dri/intel/intel_swapbuffers.c
@@ -78,8 +78,7 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv,
* current context (which is what intelScreenContext should return) might
* not get a contended lock and thus cliprects not updated (tests/manywin)
*/
- if (!intel->driScreen->dri2.enabled &&
- intel_context(dPriv->driContextPriv) != intel)
+ if (intel_context(dPriv->driContextPriv) != intel)
DRI_VALIDATE_DRAWABLE_INFO(intel->driScreen, dPriv);