Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345533
b: refs/heads/master
c: dd26585
h: refs/heads/master
i:
  345531: f3e1615
v: v3
  • Loading branch information
Prathyush K authored and Inki Dae committed Dec 5, 2012
1 parent fcbbe87 commit 6f83ca6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1daa892c1df5c329375d791ca169db22f18e5c28
refs/heads/master: dd265850f10a16e4525ed002f0173a1acd8c8876
30 changes: 30 additions & 0 deletions trunk/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,38 @@ struct exynos_drm_fbdev {
struct exynos_drm_gem_obj *exynos_gem_obj;
};

static int exynos_drm_fb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
struct drm_fb_helper *helper = info->par;
struct exynos_drm_fbdev *exynos_fbd = to_exynos_fbdev(helper);
struct exynos_drm_gem_obj *exynos_gem_obj = exynos_fbd->exynos_gem_obj;
struct exynos_drm_gem_buf *buffer = exynos_gem_obj->buffer;
unsigned long vm_size;
int ret;

DRM_DEBUG_KMS("%s\n", __func__);

vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;

vm_size = vma->vm_end - vma->vm_start;

if (vm_size > buffer->size)
return -EINVAL;

ret = dma_mmap_attrs(helper->dev->dev, vma, buffer->kvaddr,
buffer->dma_addr, buffer->size, &buffer->dma_attrs);
if (ret < 0) {
DRM_ERROR("failed to mmap.\n");
return ret;
}

return 0;
}

static struct fb_ops exynos_drm_fb_ops = {
.owner = THIS_MODULE,
.fb_mmap = exynos_drm_fb_mmap,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
.fb_imageblit = cfb_imageblit,
Expand Down

0 comments on commit 6f83ca6

Please sign in to comment.