All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 10/14] drm/exynos: remove function check_gem_flags
Date: Tue, 11 Aug 2015 09:23:00 +0900	[thread overview]
Message-ID: <55C94064.9070902@samsung.com> (raw)
In-Reply-To: <CAPj87rO1gkqLwsK76p3=WM4u8oMPu8stCAjobvGiuR6eDC47rQ@mail.gmail.com>

On 08/06/2015 07:00 PM, Daniel Stone wrote:
> Hi Joonyoung,
> 
> On 28 July 2015 at 09:53, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>  static void update_vm_cache_attr(struct exynos_drm_gem_obj *obj,
>>                                         struct vm_area_struct *vma)
>>  {
>> @@ -169,6 +159,11 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
>>         struct exynos_drm_gem_buf *buf;
>>         int ret;
>>
>> +       if (flags & ~(EXYNOS_BO_MASK)) {
>> +               DRM_ERROR("invalid flags.\n");
>> +               return ERR_PTR(-EINVAL);
>> +       }
>> +
>>         if (!size) {
>>                 DRM_ERROR("invalid size.\n");
>>                 return ERR_PTR(-EINVAL);
>> @@ -176,10 +171,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
>>
>>         size = roundup_gem_size(size, flags);
>>
>> -       ret = check_gem_flags(flags);
>> -       if (ret)
>> -               return ERR_PTR(ret);
>> -
>>         buf = exynos_drm_init_buf(dev, size);
>>         if (!buf)
>>                 return ERR_PTR(-ENOMEM);
>> @@ -584,9 +575,10 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>>         obj = vma->vm_private_data;
>>         exynos_gem_obj = to_exynos_gem_obj(obj);
>>
>> -       ret = check_gem_flags(exynos_gem_obj->flags);
>> -       if (ret)
>> +       if (exynos_gem_obj->flags & ~(EXYNOS_BO_MASK)) {
>> +               DRM_ERROR("invalid flags.\n");
>>                 goto err_close_vm;
>> +       }
> 
> This check should be removed, or turned into a WARN_ON: there is no
> way for the user to control the GEM object flags except through the
> create ioctl, no?
> 

Right, your point is reasonable to me.

Thanks.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-08-11  0:23 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
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 [this message]
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=55C94064.9070902@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.