Re: [PATCH 10/14] drm/exynos: remove function check_gem_flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/06/2015 07:00 PM, Daniel Stone wrote:
> Hi Joonyoung,
> 
> On 28 July 2015 at 09:53, Joonyoung Shim <jy0922.shim@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux