i965: Bump kernel requirement to 3.3 on Ivybridge.
[mesa.git] / src / mesa / drivers / dri / intel / intel_screen.c
index 00e7bc6cb77492aaa090191693b5243f7f6d4938..433f4ed2bd3d464a3e905e956077388a75030e4a 100644 (file)
@@ -34,7 +34,6 @@
 #include "main/texobj.h"
 #include "main/hash.h"
 #include "main/fbobject.h"
-#include "main/mfeatures.h"
 #include "main/version.h"
 #include "swrast/s_renderbuffer.h"
 
@@ -55,43 +54,35 @@ PUBLIC const char __driConfigOptions[] =
         DRI_CONF_DESC_END
       DRI_CONF_OPT_END
 
-      DRI_CONF_OPT_BEGIN(hiz, bool, true)
+      DRI_CONF_OPT_BEGIN_B(hiz, "true")
         DRI_CONF_DESC(en, "Enable Hierarchical Z on gen6+")
       DRI_CONF_OPT_END
 
-      DRI_CONF_OPT_BEGIN(early_z, bool, false)
+      DRI_CONF_OPT_BEGIN_B(early_z, "false")
         DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
       DRI_CONF_OPT_END
 
-      DRI_CONF_OPT_BEGIN(fragment_shader, bool, true)
-        DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.")
-      DRI_CONF_OPT_END
-
    DRI_CONF_SECTION_END
    DRI_CONF_SECTION_QUALITY
-      DRI_CONF_FORCE_S3TC_ENABLE(false)
+      DRI_CONF_FORCE_S3TC_ENABLE("false")
       DRI_CONF_ALLOW_LARGE_TEXTURES(2)
    DRI_CONF_SECTION_END
    DRI_CONF_SECTION_DEBUG
-     DRI_CONF_NO_RAST(false)
-     DRI_CONF_ALWAYS_FLUSH_BATCH(false)
-     DRI_CONF_ALWAYS_FLUSH_CACHE(false)
-     DRI_CONF_DISABLE_THROTTLING(false)
-     DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
-     DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
-     DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
-
-      DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
-        DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
-      DRI_CONF_OPT_END
-
-      DRI_CONF_OPT_BEGIN(shader_precompile, bool, true)
+      DRI_CONF_NO_RAST("false")
+      DRI_CONF_ALWAYS_FLUSH_BATCH("false")
+      DRI_CONF_ALWAYS_FLUSH_CACHE("false")
+      DRI_CONF_DISABLE_THROTTLING("false")
+      DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
+      DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
+      DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
+
+      DRI_CONF_OPT_BEGIN_B(shader_precompile, "true")
         DRI_CONF_DESC(en, "Perform code generation at shader link time.")
       DRI_CONF_OPT_END
    DRI_CONF_SECTION_END
 DRI_CONF_END;
 
-const GLuint __driNConfigOptions = 16;
+const GLuint __driNConfigOptions = 14;
 
 #include "intel_batchbuffer.h"
 #include "intel_buffers.h"
@@ -418,6 +409,7 @@ intel_create_image_from_renderbuffer(__DRIcontext *context,
    image->dri_format = intel_dri_format(image->format);
    image->has_depthstencil = irb->mt->stencil_mt? true : false;
 
+   rb->NeedsFinishRenderTexture = true;
    return image;
 }
 
@@ -1204,17 +1196,10 @@ set_max_gl_versions(struct intel_screen *screen)
 
    switch (screen->gen) {
    case 7:
-      if (screen->kernel_has_gen7_sol_reset) {
-         screen->max_gl_core_version = 31;
-         screen->max_gl_compat_version = 30;
-         screen->max_gl_es1_version = 11;
-         screen->max_gl_es2_version = 30;
-      } else {
-         screen->max_gl_core_version = 0;
-         screen->max_gl_compat_version = 21;
-         screen->max_gl_es1_version = 11;
-         screen->max_gl_es2_version = 20;
-      }
+      screen->max_gl_core_version = 31;
+      screen->max_gl_compat_version = 30;
+      screen->max_gl_es1_version = 11;
+      screen->max_gl_es2_version = 30;
       break;
    case 6:
       screen->max_gl_core_version = 31;
@@ -1230,23 +1215,10 @@ set_max_gl_versions(struct intel_screen *screen)
       screen->max_gl_es2_version = 20;
       break;
    case 3: {
-      bool has_fragment_shader = driQueryOptionb(&screen->optionCache, "fragment_shader");
-      bool has_occlusion_query = driQueryOptionb(&screen->optionCache, "stub_occlusion_query");
-
       screen->max_gl_core_version = 0;
       screen->max_gl_es1_version = 11;
-
-      if (has_fragment_shader && has_occlusion_query) {
-         screen->max_gl_compat_version = 21;
-      } else {
-         screen->max_gl_compat_version = 14;
-      }
-
-      if (has_fragment_shader) {
-         screen->max_gl_es2_version = 20;
-      } else {
-         screen->max_gl_es2_version = 0;
-      }
+      screen->max_gl_compat_version = 21;
+      screen->max_gl_es2_version = 20;
 
       break;
    }
@@ -1315,10 +1287,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
 
    intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr);
 
-   intelScreen->kernel_has_gen7_sol_reset =
-      intel_get_boolean(intelScreen->driScrnPriv,
-                       I915_PARAM_HAS_GEN7_SOL_RESET);
-
    if (IS_GEN7(intelScreen->deviceID)) {
       intelScreen->gen = 7;
    } else if (IS_GEN6(intelScreen->deviceID)) {
@@ -1333,6 +1301,13 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
       intelScreen->gen = 2;
    }
 
+   if (intelScreen->gen == 7 &&
+       !intel_get_boolean(intelScreen->driScrnPriv,
+                          I915_PARAM_HAS_GEN7_SOL_RESET)) {
+      fprintf(stderr, "i965 requires Kernel 3.3 or later.\n");
+      return false;
+   }
+
    intelScreen->hw_has_separate_stencil = intelScreen->gen >= 6;
    intelScreen->hw_must_use_separate_stencil = intelScreen->gen >= 7;