Re: [PATCH] drm/i915: Implement dma_buf_ops->kmap

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

 



On pe, 2017-04-07 at 22:36 +0100, Chris Wilson wrote:
> Since kmap allows us to block we can pin the pages and use our normal
> page lookup routine making the implementation simple.
> 
> Testcase: igt/drv_selftest/dmabuf
> Testcase: igt/prime_rw
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

<SNIP>

> +static int igt_dmabuf_export_kmap(void *arg)
> +{
> +	struct drm_i915_private *i915 = arg;
> +	struct drm_i915_gem_object *obj;
> +	struct dma_buf *dmabuf;
> +	void *ptr;
> +	int err;
> +
> +	obj = i915_gem_object_create(i915, 2*PAGE_SIZE);
> +	if (IS_ERR(obj))
> +		return PTR_ERR(obj);
> +
> +	dmabuf = i915_gem_prime_export(&i915->drm, &obj->base, 0);
> +	if (IS_ERR(dmabuf)) {
> +		pr_err("i915_gem_prime_export failed with err=%d\n",
> +		       (int)PTR_ERR(dmabuf));
> +		err = PTR_ERR(dmabuf);

You could hoist this assignment on line up. and just make the pr_err
use err, just saying.

Maybe you could use phases array in this function too.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://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