[Intel-gfx] [PATCH 19/26] drm/i915: Consolidate dma mappings

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 18 10:28:15 CET 2014


On Mon, Mar 17, 2014 at 10:48:51PM -0700, Ben Widawsky wrote:
> With a little bit of macro magic, and the fact that every page
> table/dir/etc. we wish to map will have a page, and daddr member, we can
> greatly simplify and reduce code.
> 
> The patch introduces an i915_dma_map/unmap which has the same semantics
> as pci_map_page, but is 1 line, and doesn't require newlines, or local
> variables to make it fit cleanly.
> 
> Notice that even the page allocation shares this same attribute. For
> now, I am leaving that code untouched because the macro version would be
> a bit on the big side - but it's a nice cleanup as well (IMO)

Doesn't this make the error unwinding very fragile and likely to unmap a
pci_dma_mapping_error() cookie rather than the dma_addr_t?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list