sorry for being late.<br><br><div class="gmail_quote">2012/11/7 Rahul Sharma <span dir="ltr"><<a href="mailto:rahul.sharma@samsung.com" target="_blank">rahul.sharma@samsung.com</a>></span><br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
From: Prathyush K <<a href="mailto:prathyush.k@samsung.com">prathyush.k@samsung.com</a>><br>
<br>
This patch adds a exynos drm specific implementation of fb_mmap<br>
which supports mapping a non-contiguous buffer to user space.<br>
<br>
This new function does not assume that the frame buffer is contiguous<br>
and calls dma_mmap_writecombine for mapping the buffer to user space.<br>
dma_mmap_writecombine will be able to map a contiguous buffer as well<br>
as non-contig buffer depending on whether an IOMMU mapping is created<br>
for drm or not.<br>
<br>
Signed-off-by: Prathyush K <<a href="mailto:prathyush.k@samsung.com">prathyush.k@samsung.com</a>><br>
Signed-off-by: Rahul Sharma <<a href="mailto:rahul.sharma@samsung.com">rahul.sharma@samsung.com</a>><br>
---<br>
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   26 ++++++++++++++++++++++++++<br>
 1 files changed, 26 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c<br>
index 67eb6ba..3939f7f 100644<br>
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c<br>
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c<br>
@@ -46,8 +46,34 @@ struct exynos_drm_fbdev {<br>
        struct exynos_drm_gem_obj       *exynos_gem_obj;<br>
 };<br>
<br>
+static int exynos_drm_fb_mmap(struct fb_info *info,<br>
+                             struct vm_area_struct *vma)<br>
+{<br>
+       DRM_DEBUG_KMS("%s\n", __func__);<br>
+<br>
+       if (!vma || !info) {<br>
+               DRM_ERROR("invalid arguments vma 0x%x, info 0x%x.\n",<br>
+                               (unsigned int)vma, (unsigned int)info);<br>
+               return -EINVAL;<br>
+       }<br>
+<br>
+       if (!info->screen_base || info->screen_size == 0) {<br>
+               DRM_ERROR("invalid screen information.\n");<br>
+               return -EINVAL;<br>
+       }<br>
+<br>
+       vma->vm_pgoff = 0;<br>
+       vma->vm_flags |= VM_IO;<br>
+       if (dma_mmap_writecombine(info->device, vma, info->screen_base,<br>
+                       info->fix.smem_start, vma->vm_end - vma->vm_start))<br></blockquote><div> </div><div>fix.smem_start should have physical address. Please see the below comment of framebuffer header,</div>
<div>        struct  fb_fix_screeninfo { </div><div>                ...</div><div>                unsigned long smem_start;            /* Start of frame buffer mem */</div><div>                                                                       /* (physical address) */</div>
<div> </div><div>For this, I posted fixup patch so smem_start has physical address always.</div><div> </div><div>Thanks,</div><div>Inki Dae</div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">

+               return -EAGAIN;<br>
+<br>
+       return 0;<br>
+}<br>
+<br>
 static struct fb_ops exynos_drm_fb_ops = {<br>
        .owner          = THIS_MODULE,<br>
+       .fb_mmap        = exynos_drm_fb_mmap,<br>
        .fb_fillrect    = cfb_fillrect,<br>
        .fb_copyarea    = cfb_copyarea,<br>
        .fb_imageblit   = cfb_imageblit,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.0.4<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br>