Skip to content

Commit

Permalink
drm/i915: set dummy page for stolen objects
Browse files Browse the repository at this point in the history
This is needed since currently sg_for_each_page assumes that we have
a valid page in each sg item. It is only a real problem for
CONFIG_SPARSEMEM where the page is dereferenced, in other cases the
iterator works ok with an invalid page pointer.

We can remove this workaround when we have fixed sg_page_iter to work on
scatterlists without backing pages.

Signed-off-by: Imre Deak <imre.deak@intel.com>
  • Loading branch information
Imre Deak authored and Daniel Vetter committed Mar 23, 2013
1 parent f5ddf69 commit 5bd4687
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/i915_gem_stolen.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ i915_pages_create_for_stolen(struct drm_device *dev,
}

sg = st->sgl;
sg->offset = offset;
sg->length = size;
/* we set the dummy page here only to make for_each_sg_page work */
sg_set_page(sg, dev_priv->gtt.scratch_page, size, offset);

sg_dma_address(sg) = (dma_addr_t)dev_priv->mm.stolen_base + offset;
sg_dma_len(sg) = size;
Expand Down

0 comments on commit 5bd4687

Please sign in to comment.