Merge branch 'gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / intel / intel_context.c
index 082dfe87e38aad31582b8e3b6542e99668a105b5..50c1964d8784dfd9fa431d84fca244b133e40a57 100644 (file)
@@ -266,6 +266,7 @@ static const struct dri_extension brw_extensions[] = {
    { "GL_ARB_fragment_program",           NULL },
    { "GL_ARB_shadow",                     NULL },
    { "GL_EXT_shadow_funcs",               NULL },
+   { "GL_ARB_fragment_program_shadow",    NULL },
    /* ARB extn won't work if not enabled */
    { "GL_SGIX_depth_texture",             NULL },
    { "GL_EXT_texture_sRGB",              NULL},
@@ -464,7 +465,14 @@ intel_init_bufmgr(struct intel_context *intel)
 {
    intelScreenPrivate *intelScreen = intel->intelScreen;
    GLboolean gem_disable = getenv("INTEL_NO_GEM") != NULL;
+   int gem_kernel = 0;
    GLboolean gem_supported;
+   struct drm_i915_getparam gp;
+
+   gp.param = I915_PARAM_HAS_GEM;
+   gp.value = &gem_kernel;
+
+   (void) drmCommandWriteRead(intel->driFd, DRM_I915_GETPARAM, &gp, sizeof(gp));
 
    /* If we've got a new enough DDX that's initializing GEM and giving us
     * object handles for the shared buffers, use that.
@@ -473,7 +481,7 @@ intel_init_bufmgr(struct intel_context *intel)
    if (intel->intelScreen->driScrnPriv->dri2.enabled)
        gem_supported = GL_TRUE;
    else if (intel->intelScreen->driScrnPriv->ddx_version.minor >= 9 &&
-           intel->intelScreen->drmMinor >= 11 &&
+           gem_kernel &&
            intel->intelScreen->front.bo_handle != -1)
        gem_supported = GL_TRUE;
    else