diff mbox series

drm/auth: Drop master_create/destroy hooks

Message ID 20200127100203.1299322-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series drm/auth: Drop master_create/destroy hooks | expand

Commit Message

Daniel Vetter Jan. 27, 2020, 10:02 a.m. UTC
vmwgfx stopped using them.

With the drm device model that we've slowly evolved over the past few
years master status essentially controls access to display resources,
and nothing else. Since that's a pure access permission check drivers
should have no need at all to track additional state on a per file
basis.

Aside: For cleanup and restoring kernel-internal clients the grand
plan is to move everyone over to drm_client and
drm_master_internal_acquire/release, like the generic fbdev code
already does. That should get rid of most ->lastclose implementations,
and I think also subsumes any processing vmwgfx does in
master_set/drop.

Cc: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_auth.c |  8 --------
 include/drm/drm_drv.h      | 14 --------------
 2 files changed, 22 deletions(-)

Comments

Thomas Zimmermann Jan. 27, 2020, 11:55 a.m. UTC | #1
Am 27.01.20 um 11:02 schrieb Daniel Vetter:
> vmwgfx stopped using them.
> 
> With the drm device model that we've slowly evolved over the past few
> years master status essentially controls access to display resources,
> and nothing else. Since that's a pure access permission check drivers
> should have no need at all to track additional state on a per file
> basis.
> 
> Aside: For cleanup and restoring kernel-internal clients the grand
> plan is to move everyone over to drm_client and
> drm_master_internal_acquire/release, like the generic fbdev code
> already does. That should get rid of most ->lastclose implementations,
> and I think also subsumes any processing vmwgfx does in
> master_set/drop.
> 
> Cc: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>  drivers/gpu/drm/drm_auth.c |  8 --------
>  include/drm/drm_drv.h      | 14 --------------
>  2 files changed, 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
> index cc9acd986c68..531b876d0ed8 100644
> --- a/drivers/gpu/drm/drm_auth.c
> +++ b/drivers/gpu/drm/drm_auth.c
> @@ -153,11 +153,6 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
>  		return -ENOMEM;
>  	}
>  
> -	if (dev->driver->master_create) {
> -		ret = dev->driver->master_create(dev, fpriv->master);
> -		if (ret)
> -			goto out_err;
> -	}
>  	fpriv->is_master = 1;
>  	fpriv->authenticated = 1;
>  
> @@ -332,9 +327,6 @@ static void drm_master_destroy(struct kref *kref)
>  	if (drm_core_check_feature(dev, DRIVER_MODESET))
>  		drm_lease_destroy(master);
>  
> -	if (dev->driver->master_destroy)
> -		dev->driver->master_destroy(dev, master);
> -
>  	drm_legacy_master_rmmaps(dev, master);
>  
>  	idr_destroy(&master->magic_map);
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index f3f3e10873af..77bc63de0a91 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -460,20 +460,6 @@ struct drm_driver {
>  	 */
>  	void (*irq_uninstall) (struct drm_device *dev);
>  
> -	/**
> -	 * @master_create:
> -	 *
> -	 * Called whenever a new master is created. Only used by vmwgfx.
> -	 */
> -	int (*master_create)(struct drm_device *dev, struct drm_master *master);
> -
> -	/**
> -	 * @master_destroy:
> -	 *
> -	 * Called whenever a master is destroyed. Only used by vmwgfx.
> -	 */
> -	void (*master_destroy)(struct drm_device *dev, struct drm_master *master);
> -
>  	/**
>  	 * @master_set:
>  	 *
>
Thomas Hellström (Intel) Jan. 27, 2020, 12:14 p.m. UTC | #2
On 1/27/20 11:02 AM, Daniel Vetter wrote:
> vmwgfx stopped using them.
>
> With the drm device model that we've slowly evolved over the past few
> years master status essentially controls access to display resources,
> and nothing else. Since that's a pure access permission check drivers
> should have no need at all to track additional state on a per file
> basis.
>
> Aside: For cleanup and restoring kernel-internal clients the grand
> plan is to move everyone over to drm_client and
> drm_master_internal_acquire/release, like the generic fbdev code
> already does. That should get rid of most ->lastclose implementations,
> and I think also subsumes any processing vmwgfx does in
> master_set/drop.
>
> Cc: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Daniel Vetter Jan. 29, 2020, 8:14 a.m. UTC | #3
On Mon, Jan 27, 2020 at 01:14:37PM +0100, Thomas Hellström (VMware) wrote:
> On 1/27/20 11:02 AM, Daniel Vetter wrote:
> > vmwgfx stopped using them.
> > 
> > With the drm device model that we've slowly evolved over the past few
> > years master status essentially controls access to display resources,
> > and nothing else. Since that's a pure access permission check drivers
> > should have no need at all to track additional state on a per file
> > basis.
> > 
> > Aside: For cleanup and restoring kernel-internal clients the grand
> > plan is to move everyone over to drm_client and
> > drm_master_internal_acquire/release, like the generic fbdev code
> > already does. That should get rid of most ->lastclose implementations,
> > and I think also subsumes any processing vmwgfx does in
> > master_set/drop.
> > 
> > Cc: "Thomas Hellström (VMware)" <thomas_os@shipmail.org>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> 
> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

Thanks for your review, patch applied.
-Daniel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index cc9acd986c68..531b876d0ed8 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -153,11 +153,6 @@  static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)
 		return -ENOMEM;
 	}
 
-	if (dev->driver->master_create) {
-		ret = dev->driver->master_create(dev, fpriv->master);
-		if (ret)
-			goto out_err;
-	}
 	fpriv->is_master = 1;
 	fpriv->authenticated = 1;
 
@@ -332,9 +327,6 @@  static void drm_master_destroy(struct kref *kref)
 	if (drm_core_check_feature(dev, DRIVER_MODESET))
 		drm_lease_destroy(master);
 
-	if (dev->driver->master_destroy)
-		dev->driver->master_destroy(dev, master);
-
 	drm_legacy_master_rmmaps(dev, master);
 
 	idr_destroy(&master->magic_map);
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index f3f3e10873af..77bc63de0a91 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -460,20 +460,6 @@  struct drm_driver {
 	 */
 	void (*irq_uninstall) (struct drm_device *dev);
 
-	/**
-	 * @master_create:
-	 *
-	 * Called whenever a new master is created. Only used by vmwgfx.
-	 */
-	int (*master_create)(struct drm_device *dev, struct drm_master *master);
-
-	/**
-	 * @master_destroy:
-	 *
-	 * Called whenever a master is destroyed. Only used by vmwgfx.
-	 */
-	void (*master_destroy)(struct drm_device *dev, struct drm_master *master);
-
 	/**
 	 * @master_set:
 	 *