[Libva] [PATCH 2/2] Use libdrm to get device id

Zhao, Yakui yakui.zhao at intel.com
Thu Dec 25 23:00:39 PST 2014


On Fri, 2014-12-26 at 00:04 -0700, Zhenyu Wang wrote:
> Instead of call ioctl by ourself, use libdrm interface to get device id.
> This not only saves one ioctl call as is done when gem bufmgr init. It
> also allows to use libdrm's device id override helper envionment "INTEL_DEVID_OVERRIDE".
> 
> If you override device id combined with aub dump enable, you can get aub
> file to debug it under emulator for any device that you might not have real
> HW metal.
> 

This looks good to me.

Add: Reviewed-by: Zhao Yakui <yakui.zhao at intel.com>

> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
>  src/intel_driver.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel_driver.c b/src/intel_driver.c
> index 2e6fae3..96c1994 100644
> --- a/src/intel_driver.c
> +++ b/src/intel_driver.c
> @@ -110,7 +110,8 @@ intel_driver_init(VADriverContextP ctx)
>      intel->locked = 0;
>      pthread_mutex_init(&intel->ctxmutex, NULL);
>  
> -    intel_driver_get_param(intel, I915_PARAM_CHIPSET_ID, &intel->device_id);
> +    intel_memman_init(intel);
> +    intel->device_id = drm_intel_bufmgr_gem_get_devid(intel->bufmgr);
>      intel->device_info = i965_get_device_info(intel->device_id);
>  
>      if (!intel->device_info)
> @@ -130,7 +131,6 @@ intel_driver_init(VADriverContextP ctx)
>          intel->has_bsd2 = !!ret_value;
>  
>      intel_driver_get_revid(intel, &intel->revision);
> -    intel_memman_init(intel);
>      return true;
>  }
>  




More information about the Libva mailing list