From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Implement dma_buf_ops->kmap
Date: Wed, 12 Apr 2017 14:39:30 +0300 [thread overview]
Message-ID: <1491997170.3274.22.camel@linux.intel.com> (raw)
In-Reply-To: <20170407213630.4657-1-chris@chris-wilson.co.uk>
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@chris-wilson.co.uk>
<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@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-04-12 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 21:36 [PATCH] drm/i915: Implement dma_buf_ops->kmap Chris Wilson
2017-04-07 21:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-04-12 11:39 ` Joonas Lahtinen [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-05-03 20:25 [CI] " Chris Wilson
2017-05-03 20:50 ` [PATCH] " Chris Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1491997170.3274.22.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox