summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_gem.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-07-28 11:53:16 +0300
committerInki Dae <inki.dae@samsung.com>2015-08-16 07:25:21 +0300
commit8139951cae69637cc882e23f36fc45ecfa1ec814 (patch)
treec69923fc2c2e3fd75147850481d6025a8be3c505 /drivers/gpu/drm/exynos/exynos_drm_gem.c
parent2b8376c803c4c1c02446520527b31161e8a3c066 (diff)
downloadlinux-8139951cae69637cc882e23f36fc45ecfa1ec814.tar.xz
drm/exynos: stop using sgtable in page fault handler
Already struct exynos_drm_gem_buf has pages of the buffer when buffer is created, so just can use pages in page fault handler, we don't have to make sgtable of the buffer. But this needs to construct pages of the buffer that is imported from dma-buf prime. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_gem.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gem.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
index 0d5b9698d384..d320acd20986 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
@@ -83,26 +83,14 @@ static int exynos_drm_gem_map_buf(struct drm_gem_object *obj,
{
struct exynos_drm_gem_obj *exynos_gem_obj = to_exynos_gem_obj(obj);
struct exynos_drm_gem_buf *buf = exynos_gem_obj->buffer;
- struct scatterlist *sgl;
unsigned long pfn;
- int i;
-
- if (!buf->sgt)
- return -EINTR;
if (page_offset >= (buf->size >> PAGE_SHIFT)) {
DRM_ERROR("invalid page offset\n");
return -EINVAL;
}
- sgl = buf->sgt->sgl;
- for_each_sg(buf->sgt->sgl, sgl, buf->sgt->nents, i) {
- if (page_offset < (sgl->length >> PAGE_SHIFT))
- break;
- page_offset -= (sgl->length >> PAGE_SHIFT);
- }
-
- pfn = __phys_to_pfn(sg_phys(sgl)) + page_offset;
+ pfn = page_to_pfn(buf->pages[page_offset]);
return vm_insert_mixed(vma, f_vaddr, pfn);
}