LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: "Souptick Joarder" <jrdr.linux@gmail.com>,
airlied@redhat.com, "Christian König" <christian.koenig@amd.com>,
"Cihangir Aktürk" <cakturk@gmail.com>,
"Sean Paul" <seanpaul@chromium.org>,
"Michal Hocko" <mhocko@kernel.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"Matthew Wilcox" <willy@infradead.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH v2] gpu: drm: udl: Adding new typedef vm_fault_t
Date: Wed, 23 May 2018 15:24:12 +0530 [thread overview]
Message-ID: <CAFqt6zaav_OHxxBP6T=SHmXKeYQzG_HJzJRkuFDq0A_H6-mgfA@mail.gmail.com> (raw)
In-Reply-To: <20180523084904.GN3438@phenom.ffwll.local>
On Wed, May 23, 2018 at 2:19 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, May 21, 2018 at 10:27:44AM +0530, Souptick Joarder wrote:
>> On Thu, May 10, 2018 at 7:18 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> > On Wed, Apr 25, 2018 at 10:29 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> >> Use new return type vm_fault_t for fault and huge_fault
>> >> handler. For now, this is just documenting that the
>> >> function returns a VM_FAULT value rather than an errno.
>> >> Once all instances are converted, vm_fault_t will become
>> >> a distinct type.
>> >>
>> >> Commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>> >>
>> >> Previously vm_insert_page() returns err which driver
>> >> mapped into VM_FAULT_* type. The new function vmf_
>> >> insert_page() will replace this inefficiency by
>> >> returning VM_FAULT_* type.
>> >>
>> >> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> >> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>> >> ---
>> >> v2: Updated the change log
>> >>
>> >> drivers/gpu/drm/udl/udl_drv.h | 3 ++-
>> >> drivers/gpu/drm/udl/udl_gem.c | 15 ++-------------
>> >> 2 files changed, 4 insertions(+), 14 deletions(-)
>> >>
>> >> diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
>> >> index 2a75ab8..11151c4 100644
>> >> --- a/drivers/gpu/drm/udl/udl_drv.h
>> >> +++ b/drivers/gpu/drm/udl/udl_drv.h
>> >> @@ -16,6 +16,7 @@
>> >>
>> >> #include <linux/usb.h>
>> >> #include <drm/drm_gem.h>
>> >> +#include <linux/mm_types.h>
>> >>
>> >> #define DRIVER_NAME "udl"
>> >> #define DRIVER_DESC "DisplayLink"
>> >> @@ -134,7 +135,7 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev,
>> >> int udl_gem_vmap(struct udl_gem_object *obj);
>> >> void udl_gem_vunmap(struct udl_gem_object *obj);
>> >> int udl_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
>> >> -int udl_gem_fault(struct vm_fault *vmf);
>> >> +vm_fault_t udl_gem_fault(struct vm_fault *vmf);
>> >>
>> >> int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
>> >> int width, int height);
>> >> diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c
>> >> index dee6bd9..cf5fe35 100644
>> >> --- a/drivers/gpu/drm/udl/udl_gem.c
>> >> +++ b/drivers/gpu/drm/udl/udl_gem.c
>> >> @@ -100,13 +100,12 @@ int udl_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>> >> return ret;
>> >> }
>> >>
>> >> -int udl_gem_fault(struct vm_fault *vmf)
>> >> +vm_fault_t udl_gem_fault(struct vm_fault *vmf)
>> >> {
>> >> struct vm_area_struct *vma = vmf->vma;
>> >> struct udl_gem_object *obj = to_udl_bo(vma->vm_private_data);
>> >> struct page *page;
>> >> unsigned int page_offset;
>> >> - int ret = 0;
>> >>
>> >> page_offset = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
>> >>
>> >> @@ -114,17 +113,7 @@ int udl_gem_fault(struct vm_fault *vmf)
>> >> return VM_FAULT_SIGBUS;
>> >>
>> >> page = obj->pages[page_offset];
>> >> - ret = vm_insert_page(vma, vmf->address, page);
>> >> - switch (ret) {
>> >> - case -EAGAIN:
>> >> - case 0:
>> >> - case -ERESTARTSYS:
>> >> - return VM_FAULT_NOPAGE;
>> >> - case -ENOMEM:
>> >> - return VM_FAULT_OOM;
>> >> - default:
>> >> - return VM_FAULT_SIGBUS;
>> >> - }
>> >> + return vmf_insert_page(vma, vmf->address, page);
>> >> }
>> >>
>> >> int udl_gem_get_pages(struct udl_gem_object *obj)
>> >> --
>> >> 1.9.1
>> >>
>> >
>> > Any comment on this patch ?
>>
>> If no comment, we would like to get this patch in queue
>> for 4.18.
>
> 4.18 is done already, queued up for 4.19 in drm-misc-next.
>
> Thanks, Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
Thanks :)
prev parent reply other threads:[~2018-05-23 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 4:59 Souptick Joarder
2018-05-10 13:48 ` Souptick Joarder
2018-05-21 4:57 ` Souptick Joarder
2018-05-23 8:49 ` Daniel Vetter
2018-05-23 9:54 ` Souptick Joarder [this message]
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='CAFqt6zaav_OHxxBP6T=SHmXKeYQzG_HJzJRkuFDq0A_H6-mgfA@mail.gmail.com' \
--to=jrdr.linux@gmail.com \
--cc=airlied@redhat.com \
--cc=cakturk@gmail.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=seanpaul@chromium.org \
--cc=willy@infradead.org \
--subject='Re: [PATCH v2] gpu: drm: udl: Adding new typedef vm_fault_t' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).