Skip to content

Commit

Permalink
drm: handle compact dma scatter lists in drm_clflush_sg()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Imre Deak authored and Daniel Vetter committed Mar 19, 2013
1 parent 0d4a42f commit f5ddf69
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/drm_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ drm_clflush_sg(struct sg_table *st)
{
#if defined(CONFIG_X86)
if (cpu_has_clflush) {
struct scatterlist *sg;
int i;
struct sg_page_iter sg_iter;

mb();
for_each_sg(st->sgl, sg, st->nents, i)
drm_clflush_page(sg_page(sg));
for_each_sg_page(st->sgl, &sg_iter, st->nents, 0)
drm_clflush_page(sg_iter.page);
mb();

return;
Expand Down

0 comments on commit f5ddf69

Please sign in to comment.