From: Stanislav Vorobiov Date: Thu, 13 Sep 2012 13:30:18 +0000 (+0400) Subject: YaGL: Allow user to specify marshal buffer size, it still has to be 1 page, to be... X-Git-Tag: 2.2.1_release^2~83^2~7^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9044db6d958ce6e21d5ec50a36cac47a082da23b;p=sdk%2Femulator%2Femulator-kernel.git YaGL: Allow user to specify marshal buffer size, it still has to be 1 page, to be fixed later YaGL: Version bump --- diff --git a/drivers/gpu/yagl/yagl_driver.c b/drivers/gpu/yagl/yagl_driver.c index 463cc8211f0d..e36fb7662757 100644 --- a/drivers/gpu/yagl/yagl_driver.c +++ b/drivers/gpu/yagl/yagl_driver.c @@ -181,18 +181,18 @@ static int yagl_misc_mmap(struct file *file, struct vm_area_struct *vma) mutex_lock(&yfile->device->mutex); - if (num_pages != 1) { - dprintk("%s: mmap must be called for 1 page only\n", - yfile->device->miscdev.name); - ret = -EINVAL; - goto out; - } - if (vma->vm_pgoff == 0) { /* * First page is 'regs'. */ + if (num_pages != 1) { + dprintk("%s: mmap must be called for 1 page only\n", + yfile->device->miscdev.name); + ret = -EINVAL; + goto out; + } + vma->vm_flags |= VM_IO | VM_RESERVED; vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); @@ -220,7 +220,7 @@ static int yagl_misc_mmap(struct file *file, struct vm_area_struct *vma) goto out; } - buff = vmalloc_user(PAGE_SIZE); + buff = vmalloc_user(vma->vm_end - vma->vm_start); if (!buff) { dprintk("%s: unable to alloc memory\n", diff --git a/drivers/gpu/yagl/yagl_version.h b/drivers/gpu/yagl/yagl_version.h index 721a5554d655..52e077851775 100644 --- a/drivers/gpu/yagl/yagl_version.h +++ b/drivers/gpu/yagl/yagl_version.h @@ -6,7 +6,7 @@ /* * Version number. */ -#define YAGL_VERSION 3 +#define YAGL_VERSION 4 /* * Device control codes magic.