Skip to content

Commit f5ddf69

Browse files
ideakdanvet
authored andcommitted
drm: handle compact dma scatter lists in drm_clflush_sg()
So far the assumption was that each scatter list entry contains a single page. This might not hold in the future, when we'll introduce compact scatter lists, so prepare for this here. Reference: http://www.spinics.net/lists/dri-devel/msg33917.html Signed-off-by: Imre Deak <imre.deak@intel.com> Acked-by: Dave Airlie <airlied@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 0d4a42f commit f5ddf69

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/gpu/drm/drm_cache.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,11 @@ drm_clflush_sg(struct sg_table *st)
105105
{
106106
#if defined(CONFIG_X86)
107107
if (cpu_has_clflush) {
108-
struct scatterlist *sg;
109-
int i;
108+
struct sg_page_iter sg_iter;
110109

111110
mb();
112-
for_each_sg(st->sgl, sg, st->nents, i)
113-
drm_clflush_page(sg_page(sg));
111+
for_each_sg_page(st->sgl, &sg_iter, st->nents, 0)
112+
drm_clflush_page(sg_iter.page);
114113
mb();
115114

116115
return;

0 commit comments

Comments
 (0)