From: "Michael J. Ruhl" <michael.j.ruhl@intel.com>
To: intel-gfx@lists.freedesktop.org, airlied@linux.ie, daniel@ffwll.ch
Cc: lucas.demarchi@intel.com
Subject: [Intel-gfx] [PATCH 2/2] drm/i915/dmabuf: Use scatterlist for_each_sg API
Date: Fri, 6 May 2022 15:08:47 -0400 [thread overview]
Message-ID: <20220506190847.480320-3-michael.j.ruhl@intel.com> (raw)
In-Reply-To: <20220506190847.480320-1-michael.j.ruhl@intel.com>
Update open coded for loop to use the standard scatterlist
for_each_sg API.
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
index 5f327eac26e6..3006e60e2d51 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
@@ -47,12 +47,10 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attach,
if (ret)
goto err_free;
- src = obj->mm.pages->sgl;
dst = sgt->sgl;
- for (i = 0; i < obj->mm.pages->nents; i++) {
+ for_each_sg(obj->mm.pages->sgl, src, obj->mm.pages->nents, i) {
sg_set_page(dst, sg_page(src), src->length, 0);
dst = sg_next(dst);
- src = sg_next(src);
}
ret = dma_map_sgtable(attach->dev, sgt, dir, DMA_ATTR_SKIP_CPU_SYNC);
--
2.31.1
next prev parent reply other threads:[~2022-05-06 19:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 19:08 [Intel-gfx] i915 dmabuf cleanup Michael J. Ruhl
2022-05-06 19:08 ` [Intel-gfx] [PATCH 1/2] drm/i915/dmabuf: " Michael J. Ruhl
2022-05-31 19:16 ` Ruhl, Michael J
2022-05-06 19:08 ` Michael J. Ruhl [this message]
2022-05-06 19:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2022-05-06 23:15 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=20220506190847.480320-3-michael.j.ruhl@intel.com \
--to=michael.j.ruhl@intel.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
/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