dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Inki Dae <inki.dae@samsung.com>, dri-devel@lists.freedesktop.org
Cc: sw0312.kim@samsung.com
Subject: Re: [PATCH 09/14] drm/exynos: remove call to drm_gem_free_mmap_offset()
Date: Mon, 17 Aug 2015 17:17:07 +0900	[thread overview]
Message-ID: <55D19883.4090300@samsung.com> (raw)
In-Reply-To: <55D192C7.8060901@samsung.com>

On 08/17/2015 04:52 PM, Inki Dae wrote:
> On 2015년 08월 17일 14:29, Joonyoung Shim wrote:
>> On 08/16/2015 02:07 PM, Inki Dae wrote:
>>> On 2015년 07월 28일 17:53, Joonyoung Shim wrote:
>>>> The drm_gem_object_release() function already performs this cleanup,
>>>> so there is no reason to do it explicitly.
>>>>
>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>> ---
>>>>  drivers/gpu/drm/exynos/exynos_drm_gem.c | 3 ---
>>>>  1 file changed, 3 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>>>> index c76aa8a..ab7d029 100644
>>>> --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c
>>>> +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c
>>>> @@ -100,8 +100,6 @@ out:
>>>>  	exynos_drm_fini_buf(obj->dev, buf);
>>>>  	exynos_gem_obj->buffer = NULL;
>>>>  
>>>> -	drm_gem_free_mmap_offset(obj);
>>>> -
>>>>  	/* release file pointer to gem object. */
>>>>  	drm_gem_object_release(obj);
>>>>  
>>>> @@ -600,7 +598,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>>>>  
>>>>  err_close_vm:
>>>>  	drm_gem_vm_close(vma);
>>>> -	drm_gem_free_mmap_offset(obj);
>>>
>>> Without previous patch, drm_gem_free_mmap_offset is required. I guess
>>> the reason you removed above line is that you thought
>>> drm_gem_object_release function would be called by drm_gem_vm_close
>>> function which drops a reference of the gem object.
>>>
>>> However, drm_gem_vm_close should be a pair with drm_gem_vm_open
>>> function. These will be called whenever a process opens or closes the
>>> VMA. So the reference count of the gem object had already been taken by
>>> open operation when a new reference to the VMA had been created.
>>>
>>
>> This changes is not related with drm_gem_vm_close and prior patch. Why
>> should free mmap offset when mmap operation is failed? The mmap offset
>> can be used repeatedly.
> 
> Isn't vm space of vm manager still used even if any user-space process
> doesn't use the region? And if mmap is failed, then the user-space
> process will be terminated. Do you think it can be re-tried? However,
> mmap system call never return -EAGAIN. Is it reasonable to you? I cannot
> understand how the mmap offset can be re-used. So can you show me some
> example?
> 

Currently, mmap offset of exynos-drm gem is made by                 
DRM_IOCTL_MODE_MAP_DUMB ioctl and mmap() ioctl just uses the mmap     
offset. User will use same mmap offset about same gem. It's why mmap
offset made by DRM_IOCTL_MODE_MAP_DUMB ioctl is unnecessary, it's just
enough to make mmap offset from when gem is create. You can get a
reference from drm_gem_cma_helper.c file.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-08-17  8:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28  8:53 [PATCH 01/14] drm/exynos: stop using sgtable in page fault handler Joonyoung Shim
2015-07-28  8:53 ` [PATCH 02/14] drm/exynos: remove function convert_to_vm_err_msg Joonyoung Shim
2015-08-16  4:39   ` Inki Dae
2015-07-28  8:53 ` [PATCH 03/14] drm/exynos: remove mutex locking in pagefault handler Joonyoung Shim
2015-07-28  8:53 ` [PATCH 04/14] drm/exynos: remove function exynos_drm_gem_map_buf Joonyoung Shim
2015-07-28  8:53 ` [PATCH 05/14] drm/exynos: stop copying sg table Joonyoung Shim
2015-07-28  8:53 ` [PATCH 06/14] drm/exynos: remove unused fields of struct exynos_drm_gem_buf Joonyoung Shim
2015-07-28  8:53 ` [PATCH 07/14] drm/exynos: use ERR_PTR instead of NULL in exynos_drm_gem_init Joonyoung Shim
2015-07-28  8:53 ` [PATCH 08/14] drm/exynos: create a fake mmap offset with gem creation Joonyoung Shim
2015-08-16  4:50   ` Inki Dae
2015-08-17  5:29     ` Joonyoung Shim
2015-08-17  7:39       ` Inki Dae
2015-11-16 16:22   ` Daniel Vetter
2015-11-16 16:23     ` Daniel Vetter
2015-11-17  2:53       ` Inki Dae
2015-11-17  9:42         ` Daniel Vetter
2015-07-28  8:53 ` [PATCH 09/14] drm/exynos: remove call to drm_gem_free_mmap_offset() Joonyoung Shim
2015-08-16  5:07   ` Inki Dae
2015-08-17  5:29     ` Joonyoung Shim
2015-08-17  7:52       ` Inki Dae
2015-08-17  8:17         ` Joonyoung Shim [this message]
2015-08-17  9:03           ` Inki Dae
2015-09-24  1:01             ` Joonyoung Shim
2015-09-25  9:15               ` Inki Dae
2015-09-30  5:45                 ` Joonyoung Shim
2015-07-28  8:53 ` [PATCH 10/14] drm/exynos: remove function check_gem_flags Joonyoung Shim
2015-08-06 10:00   ` Daniel Stone
2015-08-11  0:23     ` Joonyoung Shim
2015-08-16  5:14   ` Inki Dae
2015-07-28  8:53 ` [PATCH 11/14] drm/exynos: remove function update_vm_cache_attr Joonyoung Shim
2015-07-28  8:53 ` [PATCH 12/14] drm/exynos: remove function roundup_gem_size Joonyoung Shim
2015-07-28  8:53 ` [PATCH 13/14] drm/exynos: use prime helpers Joonyoung Shim
2015-08-16  5:26   ` Inki Dae
2015-08-16  5:43     ` Inki Dae
2015-07-28  8:53 ` [PATCH 14/14] drm/exynos: merge exynos_drm_buf.c to exynos_drm_gem.c Joonyoung Shim

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=55D19883.4090300@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=sw0312.kim@samsung.com \
    /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