Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers

2017-08-14 Thread Hans de Goede

Hi,

On 14-08-17 10:58, Daniel Vetter wrote:

On Fri, Aug 11, 2017 at 06:11:08PM +0200, Hans de Goede wrote:

Hi,

On 11-08-17 18:04, Sean Paul wrote:

On Fri, Aug 11, 2017 at 03:26:45PM +0200, Hans de Goede wrote:

Hi,

On 11-08-17 14:33, Cihangir Akturk wrote:

Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
and drm_*_unreference() helpers.

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to
use the new APIs.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

Signed-off-by: Cihangir Akturk 


Thank you for doing this, looks good to me:

Reviewed-by: Hans de Goede 



Applied to drm-misc-next, thank you for the review!


Erm vboxvideo is in staging, does this mean all patches for
it will now go through drm-misc-next despite it being in
staging (*) ?  Because if some patches get merged through
drm-misc-next and some through Greg's staging repo that
is not going to end well.


-staging doesn't work for drm. And yes this patch needs to go in through
drm-misc I think (I don't want to be at Greg's mercy for merging cleanups,
same way we don't wait for driver maintainers if they don't merge the
patch in a timely fashion).

I'd say if no one is actually working on vbox cleanup (i.e. porting to
atomic) we'll throw it out next cycle again.


Michael Thayer from vbox upstream has said repeatedly that he is
preparing a patch-set to move vboxvideo over to the atomic APIs).

ATM I'm focusing on the other 2 vbox-guest drivers (but that is almost
done) so if Michael does not follow through on this then I will take
care of this.

Either way please don't remove the driver, we do plan to clean it up
and having it ping pong into, out of and back into the mainline kernel
is really not helpful.

Regards,

Hans

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


Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers

2017-08-14 Thread Daniel Vetter
On Fri, Aug 11, 2017 at 06:11:08PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 11-08-17 18:04, Sean Paul wrote:
> > On Fri, Aug 11, 2017 at 03:26:45PM +0200, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 11-08-17 14:33, Cihangir Akturk wrote:
> > > > Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
> > > > and drm_*_unreference() helpers.
> > > > 
> > > > drm_*_reference() and drm_*_unreference() functions are just
> > > > compatibility alias for drm_*_get() and drm_*_put() and should not be
> > > > used by new code. So convert all users of compatibility functions to
> > > > use the new APIs.
> > > > 
> > > > Generated by: scripts/coccinelle/api/drm-get-put.cocci
> > > > 
> > > > Signed-off-by: Cihangir Akturk 
> > > 
> > > Thank you for doing this, looks good to me:
> > > 
> > > Reviewed-by: Hans de Goede 
> > > 
> > 
> > Applied to drm-misc-next, thank you for the review!
> 
> Erm vboxvideo is in staging, does this mean all patches for
> it will now go through drm-misc-next despite it being in
> staging (*) ?  Because if some patches get merged through
> drm-misc-next and some through Greg's staging repo that
> is not going to end well.

-staging doesn't work for drm. And yes this patch needs to go in through
drm-misc I think (I don't want to be at Greg's mercy for merging cleanups,
same way we don't wait for driver maintainers if they don't merge the
patch in a timely fashion).

I'd say if no one is actually working on vbox cleanup (i.e. porting to
atomic) we'll throw it out next cycle again.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers

2017-08-11 Thread Sean Paul
On Fri, Aug 11, 2017 at 12:11 PM, Hans de Goede  wrote:
> Hi,
>
> On 11-08-17 18:04, Sean Paul wrote:
>>
>> On Fri, Aug 11, 2017 at 03:26:45PM +0200, Hans de Goede wrote:
>>>
>>> Hi,
>>>
>>> On 11-08-17 14:33, Cihangir Akturk wrote:

 Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
 and drm_*_unreference() helpers.

 drm_*_reference() and drm_*_unreference() functions are just
 compatibility alias for drm_*_get() and drm_*_put() and should not be
 used by new code. So convert all users of compatibility functions to
 use the new APIs.

 Generated by: scripts/coccinelle/api/drm-get-put.cocci

 Signed-off-by: Cihangir Akturk 
>>>
>>>
>>> Thank you for doing this, looks good to me:
>>>
>>> Reviewed-by: Hans de Goede 
>>>
>>
>> Applied to drm-misc-next, thank you for the review!
>
>
> Erm vboxvideo is in staging, does this mean all patches for
> it will now go through drm-misc-next despite it being in
> staging (*) ?  Because if some patches get merged through
> drm-misc-next and some through Greg's staging repo that
> is not going to end well.
>

Hi Hans,
Thanks for pointing this out. I picked it up as I was vacuuming up the
rest of the set that was not yet applied, not realizing the staging
implications. It's not my intention to start taking vboxvideo through
-misc.

Hopefully this won't cause any nasty conflicts with Greg's staging
tree, and we can treat it as a one-off. If it does cause problems, I
can revert it in -misc in favor of taking it through staging.

Sean

> Regards,
>
> Hans
>
>
>
> *) that is fine, the same is done for e.g. the media drivers afaik
>
>
>
>>
>> Sean
>>
>>> Regards,
>>>
>>> Hans
>>>
>>>
>>>
 ---
drivers/staging/vboxvideo/vbox_fb.c   | 2 +-
drivers/staging/vboxvideo/vbox_main.c | 8 
drivers/staging/vboxvideo/vbox_mode.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)

 diff --git a/drivers/staging/vboxvideo/vbox_fb.c
 b/drivers/staging/vboxvideo/vbox_fb.c
 index bf66358..c157284 100644
 --- a/drivers/staging/vboxvideo/vbox_fb.c
 +++ b/drivers/staging/vboxvideo/vbox_fb.c
 @@ -343,7 +343,7 @@ void vbox_fbdev_fini(struct drm_device *dev)
 vbox_bo_unpin(bo);
 vbox_bo_unreserve(bo);
 }
 -   drm_gem_object_unreference_unlocked(afb->obj);
 +   drm_gem_object_put_unlocked(afb->obj);
 afb->obj = NULL;
 }
 drm_fb_helper_fini(&fbdev->helper);
 diff --git a/drivers/staging/vboxvideo/vbox_main.c
 b/drivers/staging/vboxvideo/vbox_main.c
 index d0c6ec7..80bd039 100644
 --- a/drivers/staging/vboxvideo/vbox_main.c
 +++ b/drivers/staging/vboxvideo/vbox_main.c
 @@ -40,7 +40,7 @@ static void vbox_user_framebuffer_destroy(struct
 drm_framebuffer *fb)
 struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb);
 if (vbox_fb->obj)
 -   drm_gem_object_unreference_unlocked(vbox_fb->obj);
 +   drm_gem_object_put_unlocked(vbox_fb->obj);
 drm_framebuffer_cleanup(fb);
 kfree(fb);
 @@ -198,7 +198,7 @@ static struct drm_framebuffer
 *vbox_user_framebuffer_create(
err_free_vbox_fb:
 kfree(vbox_fb);
err_unref_obj:
 -   drm_gem_object_unreference_unlocked(obj);
 +   drm_gem_object_put_unlocked(obj);
 return ERR_PTR(ret);
}
 @@ -472,7 +472,7 @@ int vbox_dumb_create(struct drm_file *file,
 return ret;
 ret = drm_gem_handle_create(file, gobj, &handle);
 -   drm_gem_object_unreference_unlocked(gobj);
 +   drm_gem_object_put_unlocked(gobj);
 if (ret)
 return ret;
 @@ -525,7 +525,7 @@ vbox_dumb_mmap_offset(struct drm_file *file,
 bo = gem_to_vbox_bo(obj);
 *offset = vbox_bo_mmap_offset(bo);
 -   drm_gem_object_unreference(obj);
 +   drm_gem_object_put(obj);
 ret = 0;
out_unlock:
 diff --git a/drivers/staging/vboxvideo/vbox_mode.c
 b/drivers/staging/vboxvideo/vbox_mode.c
 index 996da1c..e5b6383 100644
 --- a/drivers/staging/vboxvideo/vbox_mode.c
 +++ b/drivers/staging/vboxvideo/vbox_mode.c
 @@ -812,7 +812,7 @@ static int vbox_cursor_set2(struct drm_crtc *crtc,
 struct drm_file *file_priv,
out_unreserve_bo:
 vbox_bo_unreserve(bo);
out_unref_obj:
 -   drm_gem_object_unreference_unlocked(obj);
 +   drm_gem_object_put_unlocked(obj);
 return ret;
}

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

Re: [PATCH v3 28/28] drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers

2017-08-11 Thread Hans de Goede

Hi,

On 11-08-17 14:33, Cihangir Akturk wrote:

Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference()
and drm_*_unreference() helpers.

drm_*_reference() and drm_*_unreference() functions are just
compatibility alias for drm_*_get() and drm_*_put() and should not be
used by new code. So convert all users of compatibility functions to
use the new APIs.

Generated by: scripts/coccinelle/api/drm-get-put.cocci

Signed-off-by: Cihangir Akturk 


Thank you for doing this, looks good to me:

Reviewed-by: Hans de Goede 

Regards,

Hans




---
  drivers/staging/vboxvideo/vbox_fb.c   | 2 +-
  drivers/staging/vboxvideo/vbox_main.c | 8 
  drivers/staging/vboxvideo/vbox_mode.c | 2 +-
  3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c 
b/drivers/staging/vboxvideo/vbox_fb.c
index bf66358..c157284 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -343,7 +343,7 @@ void vbox_fbdev_fini(struct drm_device *dev)
vbox_bo_unpin(bo);
vbox_bo_unreserve(bo);
}
-   drm_gem_object_unreference_unlocked(afb->obj);
+   drm_gem_object_put_unlocked(afb->obj);
afb->obj = NULL;
}
drm_fb_helper_fini(&fbdev->helper);
diff --git a/drivers/staging/vboxvideo/vbox_main.c 
b/drivers/staging/vboxvideo/vbox_main.c
index d0c6ec7..80bd039 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -40,7 +40,7 @@ static void vbox_user_framebuffer_destroy(struct 
drm_framebuffer *fb)
struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb);
  
  	if (vbox_fb->obj)

-   drm_gem_object_unreference_unlocked(vbox_fb->obj);
+   drm_gem_object_put_unlocked(vbox_fb->obj);
  
  	drm_framebuffer_cleanup(fb);

kfree(fb);
@@ -198,7 +198,7 @@ static struct drm_framebuffer *vbox_user_framebuffer_create(
  err_free_vbox_fb:
kfree(vbox_fb);
  err_unref_obj:
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
return ERR_PTR(ret);
  }
  
@@ -472,7 +472,7 @@ int vbox_dumb_create(struct drm_file *file,

return ret;
  
  	ret = drm_gem_handle_create(file, gobj, &handle);

-   drm_gem_object_unreference_unlocked(gobj);
+   drm_gem_object_put_unlocked(gobj);
if (ret)
return ret;
  
@@ -525,7 +525,7 @@ vbox_dumb_mmap_offset(struct drm_file *file,

bo = gem_to_vbox_bo(obj);
*offset = vbox_bo_mmap_offset(bo);
  
-	drm_gem_object_unreference(obj);

+   drm_gem_object_put(obj);
ret = 0;
  
  out_unlock:

diff --git a/drivers/staging/vboxvideo/vbox_mode.c 
b/drivers/staging/vboxvideo/vbox_mode.c
index 996da1c..e5b6383 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -812,7 +812,7 @@ static int vbox_cursor_set2(struct drm_crtc *crtc, struct 
drm_file *file_priv,
  out_unreserve_bo:
vbox_bo_unreserve(bo);
  out_unref_obj:
-   drm_gem_object_unreference_unlocked(obj);
+   drm_gem_object_put_unlocked(obj);
  
  	return ret;

  }


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