diff options
author | Imre Deak <imre.deak@intel.com> | 2013-02-18 12:28:01 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-03-19 04:50:22 -0400 |
commit | f5ddf69736fb328800ccd1a06fe69ad2e830adbe (patch) | |
tree | 50be97730f9ac64e10fc0fd444c265c1a4b1d44f | |
parent | 0d4a42f6bd298e826620585e766a154ab460617a (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/drm_cache.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index a575cb2e6bdb..bc8edbeca3fd 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c | |||
@@ -105,12 +105,11 @@ drm_clflush_sg(struct sg_table *st) | |||
105 | { | 105 | { |
106 | #if defined(CONFIG_X86) | 106 | #if defined(CONFIG_X86) |
107 | if (cpu_has_clflush) { | 107 | if (cpu_has_clflush) { |
108 | struct scatterlist *sg; | 108 | struct sg_page_iter sg_iter; |
109 | int i; | ||
110 | 109 | ||
111 | mb(); | 110 | mb(); |
112 | for_each_sg(st->sgl, sg, st->nents, i) | 111 | for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) |
113 | drm_clflush_page(sg_page(sg)); | 112 | drm_clflush_page(sg_iter.page); |
114 | mb(); | 113 | mb(); |
115 | 114 | ||
116 | return; | 115 | return; |