summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 061f0d278d..d683e67532 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -35,19 +35,6 @@
#include "utils.h"
#include "xmlpool.h"
-#include "intel_batchbuffer.h"
-#include "intel_buffers.h"
-#include "intel_bufmgr.h"
-#include "intel_chipset.h"
-#include "intel_fbo.h"
-#include "intel_screen.h"
-#include "intel_tex.h"
-#include "intel_regions.h"
-
-#include "i915_drm.h"
-
-#define DRI_CONF_TEXTURE_TILING(def) \
-
PUBLIC const char __driConfigOptions[] =
DRI_CONF_BEGIN
DRI_CONF_SECTION_PERFORMANCE
@@ -92,6 +79,17 @@ DRI_CONF_END;
const GLuint __driNConfigOptions = 11;
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_bufmgr.h"
+#include "intel_chipset.h"
+#include "intel_fbo.h"
+#include "intel_screen.h"
+#include "intel_tex.h"
+#include "intel_regions.h"
+
+#include "i915_drm.h"
+
#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
#endif /*USE_NEW_INTERFACE */
@@ -452,7 +450,7 @@ intelCreateContext(gl_api api,
return brwCreateContext(api, mesaVis,
driContextPriv, sharedContextPrivate);
#endif
- fprintf(stderr, "Unrecognized deviceID %x\n", intelScreen->deviceID);
+ fprintf(stderr, "Unrecognized deviceID 0x%x\n", intelScreen->deviceID);
return GL_FALSE;
}
@@ -462,7 +460,8 @@ intel_init_bufmgr(struct intel_screen *intelScreen)
__DRIscreen *spriv = intelScreen->driScrnPriv;
int num_fences = 0;
- intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL;
+ intelScreen->no_hw = (getenv("INTEL_NO_HW") != NULL ||
+ getenv("INTEL_DEVID_OVERRIDE") != NULL);
intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ);
if (intelScreen->bufmgr == NULL) {
@@ -497,6 +496,7 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
GLenum fb_format[3];
GLenum fb_type[3];
unsigned int api_mask;
+ char *devid_override;
static const GLenum back_buffer_modes[] = {
GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
@@ -523,6 +523,16 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
&intelScreen->deviceID))
return GL_FALSE;
+ /* Allow an override of the device ID for the purpose of making the
+ * driver produce dumps for debugging of new chipset enablement.
+ * This implies INTEL_NO_HW, to avoid programming your actual GPU
+ * incorrectly.
+ */
+ devid_override = getenv("INTEL_DEVID_OVERRIDE");
+ if (devid_override) {
+ intelScreen->deviceID = strtod(devid_override, NULL);
+ }
+
api_mask = (1 << __DRI_API_OPENGL);
#if FEATURE_ES1
api_mask |= (1 << __DRI_API_GLES);