diff options
author | Eric Anholt <[email protected]> | 2012-03-09 16:27:35 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-03-21 12:45:06 -0700 |
commit | 2222aa06e16dbfe4c29e05a1189bce80680aba19 (patch) | |
tree | b54aa77e2a27bba44d08ca0f72f945e50885eb08 | |
parent | 0247d89183e26fbd07e4176ff6f8d1b4989e24ab (diff) |
intel: Handle devid overrides using libdrm.
Reviewed-by: Yuanhan Liu <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index e7c45b7d907..3c57c5b8807 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -628,8 +628,7 @@ intel_init_bufmgr(struct intel_screen *intelScreen) __DRIscreen *spriv = intelScreen->driScrnPriv; int num_fences = 0; - intelScreen->no_hw = (getenv("INTEL_NO_HW") != NULL || - getenv("INTEL_DEVID_OVERRIDE") != NULL); + intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); if (intelScreen->bufmgr == NULL) { @@ -717,7 +716,6 @@ __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 @@ -739,20 +737,10 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) intelScreen->driScrnPriv = psp; psp->driverPrivate = (void *) intelScreen; - /* Determine chipset ID */ - if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID, - &intelScreen->deviceID)) - return false; + if (!intel_init_bufmgr(intelScreen)) + return 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); - } + intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr); intelScreen->kernel_has_gen7_sol_reset = intel_get_boolean(intelScreen->driScrnPriv, @@ -797,9 +785,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) if (IS_9XX(intelScreen->deviceID) || IS_965(intelScreen->deviceID)) psp->api_mask = api_mask; - if (!intel_init_bufmgr(intelScreen)) - return false; - intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen); psp->extensions = intelScreenExtensions; |