Commit 4fa6ce48 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm: omapdrm: Lower indentation level in omap_gem_dma_sync_buffer()

This makes the function more readable.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent bc20c85c
...@@ -752,36 +752,35 @@ void omap_gem_dma_sync(struct drm_gem_object *obj, ...@@ -752,36 +752,35 @@ void omap_gem_dma_sync(struct drm_gem_object *obj,
{ {
struct drm_device *dev = obj->dev; struct drm_device *dev = obj->dev;
struct omap_gem_object *omap_obj = to_omap_bo(obj); struct omap_gem_object *omap_obj = to_omap_bo(obj);
int i, npages = obj->size >> PAGE_SHIFT;
struct page **pages = omap_obj->pages;
bool dirty = false;
if (is_cached_coherent(obj)) { if (!is_cached_coherent(obj))
int i, npages = obj->size >> PAGE_SHIFT; return;
struct page **pages = omap_obj->pages;
bool dirty = false;
for (i = 0; i < npages; i++) {
if (!omap_obj->addrs[i]) {
dma_addr_t addr;
addr = dma_map_page(dev->dev, pages[i], 0, for (i = 0; i < npages; i++) {
PAGE_SIZE, DMA_BIDIRECTIONAL); if (!omap_obj->addrs[i]) {
dma_addr_t addr;
if (dma_mapping_error(dev->dev, addr)) { addr = dma_map_page(dev->dev, pages[i], 0,
dev_warn(dev->dev, PAGE_SIZE, DMA_BIDIRECTIONAL);
"%s: failed to map page\n",
__func__);
break;
}
dirty = true; if (dma_mapping_error(dev->dev, addr)) {
omap_obj->addrs[i] = addr; dev_warn(dev->dev, "%s: failed to map page\n",
__func__);
break;
} }
}
if (dirty) { dirty = true;
unmap_mapping_range(obj->filp->f_mapping, 0, omap_obj->addrs[i] = addr;
omap_gem_mmap_size(obj), 1);
} }
} }
if (dirty) {
unmap_mapping_range(obj->filp->f_mapping, 0,
omap_gem_mmap_size(obj), 1);
}
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment