[Mesa-dev] [PATCH 2/3] i965: Use drmIoctl for DRM_I915_GETPARAM

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 28 19:57:46 UTC 2016


On Tue, Jun 28, 2016 at 10:07:10AM -0700, Chad Versace wrote:
> Stop using drmCommandWriteRead for such a simple ioctl.
> ---
>  src/mesa/drivers/dri/i965/intel_screen.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index b693c45..f7f806e 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -979,8 +979,7 @@ intel_get_param(struct intel_screen *screen, int param, int *value)
>     gp.param = param;
>     gp.value = value;
>  
> -   ret = drmCommandWriteRead(screen->driScrnPriv->fd,
> -                             DRM_I915_GETPARAM, &gp, sizeof(gp));
> +   ret = drmIoctl(screen->driScrnPriv->fd, DRM_IOCTL_I915_GETPARAM, &gp);
>     if (ret < 0 && ret != -EINVAL)

drmIoctl() doesn't return -errno, just -1 and the error code in errno.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list