[PATCH 13/16] drm: Refactor drop/set master code a bit

2016-06-20 Thread Daniel Vetter
On Sat, Jun 18, 2016 at 12:47:21AM +0100, Emil Velikov wrote: > On 18 June 2016 at 00:00, Emil Velikov wrote: > > >> @@ -134,24 +152,21 @@ static int drm_new_set_master(struct drm_device > >> *dev, struct drm_file *fpriv) > >> > >> /* take another reference for the copy in the local file

[PATCH 13/16] drm: Refactor drop/set master code a bit

2016-06-18 Thread Emil Velikov
On 18 June 2016 at 00:00, Emil Velikov wrote: >> @@ -134,24 +152,21 @@ static int drm_new_set_master(struct drm_device *dev, >> struct drm_file *fpriv) >> >> /* take another reference for the copy in the local file priv */ >> old_master = fpriv->master; >> - fpriv->master =

[PATCH 13/16] drm: Refactor drop/set master code a bit

2016-06-18 Thread Emil Velikov
Hi Daniel, It doesn't look quite right I'm afraid. This causes a leak plus there's a small style issue. See below for details. On 17 June 2016 at 08:33, Daniel Vetter wrote: > @@ -134,24 +152,21 @@ static int drm_new_set_master(struct drm_device *dev, > struct drm_file *fpriv) > > /*

[PATCH 13/16] drm: Refactor drop/set master code a bit

2016-06-17 Thread Daniel Vetter
File open/set_maseter ioctl and file close/drop_master ioctl share the same master handling code. Extract it. Note that vmwgfx's master_set callback needs to know whether the master is a new one or has been used already, so thread this through. On the close/drop side a similar parameter existed, b

[PATCH 13/16] drm: Refactor drop/set master code a bit

2016-06-17 Thread Chris Wilson
On Fri, Jun 17, 2016 at 09:33:31AM +0200, Daniel Vetter wrote: > File open/set_maseter ioctl and file close/drop_master ioctl share the > same master handling code. Extract it. > > Note that vmwgfx's master_set callback needs to know whether the > master is a new one or has been used already, so t