dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	jy0922.shim@samsung.com, sw0312.kim@samsung.com,
	Kyungmin Park <kyungmin.park@samsung.com>
Cc: dri-devel@lists.freedesktop.org, Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH] gpu: drm: exynos: Change return type to vm_fault_t
Date: Fri, 11 May 2018 16:54:00 +0900	[thread overview]
Message-ID: <5AF54C18.1000806@samsung.com> (raw)
In-Reply-To: <CAFqt6zY49e91KDGjU5k1t1_smYjm=pYS78Txau=99DsfufOEbg@mail.gmail.com>


2018년 05월 10일 23:27에 Souptick Joarder 이(가) 쓴 글:
> On Sat, Apr 14, 2018 at 9:34 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> Use new return type vm_fault_t for fault handler
>> in struct vm_operations_struct.
>>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 21 ++++-----------------
>>  drivers/gpu/drm/exynos/exynos_drm_gem.h |  3 ++-
>>  2 files changed, 6 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> index 11cc01b..6e1494f 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>> @@ -431,37 +431,24 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
>>         return 0;
>>  }
>>
>> -int exynos_drm_gem_fault(struct vm_fault *vmf)
>> +vm_fault_t exynos_drm_gem_fault(struct vm_fault *vmf)
>>  {
>>         struct vm_area_struct *vma = vmf->vma;
>>         struct drm_gem_object *obj = vma->vm_private_data;
>>         struct exynos_drm_gem *exynos_gem = to_exynos_gem(obj);
>>         unsigned long pfn;
>>         pgoff_t page_offset;
>> -       int ret;
>>
>>         page_offset = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
>>
>>         if (page_offset >= (exynos_gem->size >> PAGE_SHIFT)) {
>>                 DRM_ERROR("invalid page offset\n");
>> -               ret = -EINVAL;
>> -               goto out;
>> +               return VM_FAULT_SIGBUS;
>>         }
>>
>>         pfn = page_to_pfn(exynos_gem->pages[page_offset]);
>> -       ret = vm_insert_mixed(vma, vmf->address, __pfn_to_pfn_t(pfn, PFN_DEV));
>> -
>> -out:
>> -       switch (ret) {
>> -       case 0:
>> -       case -ERESTARTSYS:
>> -       case -EINTR:
>> -               return VM_FAULT_NOPAGE;
>> -       case -ENOMEM:
>> -               return VM_FAULT_OOM;
>> -       default:
>> -               return VM_FAULT_SIGBUS;
>> -       }
>> +       return vmf_insert_mixed(vma, vmf->address,
>> +                       __pfn_to_pfn_t(pfn, PFN_DEV));
>>  }
>>
>>  static int exynos_drm_gem_mmap_obj(struct drm_gem_object *obj,
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h
>> index 5a4c7de..9057d7f 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h
>> @@ -13,6 +13,7 @@
>>  #define _EXYNOS_DRM_GEM_H_
>>
>>  #include <drm/drm_gem.h>
>> +#include <linux/mm_types.h>
>>
>>  #define to_exynos_gem(x)       container_of(x, struct exynos_drm_gem, base)
>>
>> @@ -111,7 +112,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
>>                                struct drm_mode_create_dumb *args);
>>
>>  /* page fault handler and mmap fault address(virtual) to physical memory. */
>> -int exynos_drm_gem_fault(struct vm_fault *vmf);
>> +vm_fault_t exynos_drm_gem_fault(struct vm_fault *vmf);
>>
>>  /* set vm_flags and we can change the vm attribute to other one at here. */
>>  int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
>> --
>> 1.9.1
>>
> 
> Any comment on this patch ?
> 

Cleanup one so merged it already to -next.

Thanks,
Inki Dae

> 
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-11  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14 16:04 [PATCH] gpu: drm: exynos: Change return type to vm_fault_t Souptick Joarder
2018-05-10 14:27 ` Souptick Joarder
2018-05-11  7:54   ` Inki Dae [this message]
2018-05-11  8:24     ` Souptick Joarder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5AF54C18.1000806@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=sw0312.kim@samsung.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox