[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 5 May 2020 12:51:58 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Christoph Hellwig <hch@....de>
Cc: dri-devel@...ts.freedesktop.org, iommu@...ts.linux-foundation.org,
linaro-mm-sig@...ts.linaro.org, linux-kernel@...r.kernel.org,
Robin Murphy <robin.murphy@....com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
linux-arm-kernel@...ts.infradead.org,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>
Subject: Re: [PATCH v3 02/25] drm: core: fix common struct sg_table related
issues
Hi Christoph,
On 05.05.2020 12:15, Christoph Hellwig wrote:
>> - for_each_sg_page(st->sgl, &sg_iter, st->nents, 0)
>> + for_each_sg_page(st->sgl, &sg_iter, st->orig_nents, 0)
> Would it make sense to also add a for_each_sgtable_page helper that
> hides the use of orig_nents? To be used like:
>
> for_each_sgtable_page(st, &sg_iter, 0) {
We would need two helpers:
for_each_sgtable_cpu_page() and for_each_sgtable_dma_page().
I considered them, but then I found that there are already
for_each_sg_page(), for_each_sg_dma_page() and various special iterators
like sg_page_iter, sg_dma_page_iter and sg_mapping_iter. Too bad that
they are almost not used, at least in the DRM subsystem. I wonder if it
make sense to apply them or simply provide the two above mentioned
wrappers?
>> + for_each_sg(sgt->sgl, sg, sgt->orig_nents, count) {
> Same here, e.g.
>
> for_each_sgtable_entry(sgt, sg, count) {
>
> ?
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists