Re: [PATCH 1/2] intel: Use I915_EXEC_HANDLE_LUT when available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 16, 2015 at 05:45:59PM -0800, Kristian Høgsberg wrote:
> In userspace we can track which buffer a relocation refers to in
> constant time.  However, the kernel has to look up the per-fd gem
> handle for each relocation.  Using the I915_EXEC_HANDLE_LUT flag lets
> us use the the bos validation list index instead of the gem handle in
> the relocation entries.  This allows the kernel to look up the bo for
> a reloc in constant time.
             ^near

> Signed-off-by: Kristian Høgsberg <krh@xxxxxxxxxxxxx>

Ok, I thought libdrm_intel was doing something questionable with its
cache of reloc trees, but that doesn't actually impact the execlist.

With the minor inline comment,
Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

> ---
>  intel/intel_bufmgr_gem.c | 33 +++++++++++++++++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> @@ -3569,6 +3594,10 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
>  		}
>  	}
>  
> +	gp.param = I915_PARAM_HAS_EXEC_HANDLE_LUT;
> +	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	bufmgr_gem->has_handle_lut = ret == 0;

Better to use

val = 0;
gp.value = &val;
(void)drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_handle_lut = val > 0;

for future proofing.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux