Re:Re: [PATCH] drm/auth: Move master pointer from drm_device to drm_file

2021-06-17 Thread 马强
> That sounds like a bug. drm_file->master should be always the same -> either you become a new stand-alone thing, our you get linked to the> current master.> > Or I'm completely missing what you're trying to fix here.Now I have a bug, the soft cursor disappears when switching users.debug it, the fpriv->is_master is found to be 0. The reason it is 0 is that switching the user frees pointer of drm_file, and creating a new pointer of drm_file, and setting master. However, since dev->master is non-0, drm_new_set_master() of the setting master function will not be executed.--Qiang MaOn Thu, Jun 17, 2021 at 05:47:33PM +0800, Qiang Ma wrote:  > The drm_file pointer clears to zero during multi-user switching,  > so it needs to call drm_new_set_master for master pointer from drm_file.  
  That sounds like a bug. drm_file->master should be always the same -  either you become a new stand-alone thing, our you get linked to the  current master.  
  Or I'm completely missing what you're trying to fix here.  -Daniel  
  > 
  > Signed-off-by: Qiang Ma   > ---  > drivers/gpu/drm/drm_auth.c | 2 +-  > 1 file changed, 1 insertion(+), 1 deletion(-)  > 
  > diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c  > index f2d46b7ac6f9..02431af6d0c5 100644  > --- a/drivers/gpu/drm/drm_auth.c  > +++ b/drivers/gpu/drm/drm_auth.c  > @@ -302,7 +302,7 @@ int drm_master_open(struct drm_file *file_priv)  > /* if there is no current master make this fd it, but do not create  > * any master object for render clients */  > mutex_lock(>master_mutex);  > - if (!dev->master)  > + if (!file_priv->master)  > ret = drm_new_set_master(dev, file_priv);  > else  > file_priv->master = drm_master_get(dev->master);  > -- 
  > 2.20.1  > 
  > 
  > 
  
  -- 
  Daniel Vetter  Software Engineer, Intel Corporation  http://blog.ffwll.ch
  
  
  
 

Re: [PATCH] drm/auth: Move master pointer from drm_device to drm_file

2021-06-17 Thread Daniel Vetter
On Thu, Jun 17, 2021 at 05:47:33PM +0800, Qiang Ma wrote:
> The drm_file pointer clears to zero during multi-user switching,
> so it needs to call drm_new_set_master for master pointer from drm_file.

That sounds like a bug. drm_file->master should be always the same -
either you become a new stand-alone thing, our you get linked to the
current master.

Or I'm completely missing what you're trying to fix here.
-Daniel

> 
> Signed-off-by: Qiang Ma 
> ---
>  drivers/gpu/drm/drm_auth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
> index f2d46b7ac6f9..02431af6d0c5 100644
> --- a/drivers/gpu/drm/drm_auth.c
> +++ b/drivers/gpu/drm/drm_auth.c
> @@ -302,7 +302,7 @@ int drm_master_open(struct drm_file *file_priv)
>   /* if there is no current master make this fd it, but do not create
>* any master object for render clients */
>   mutex_lock(>master_mutex);
> - if (!dev->master)
> + if (!file_priv->master)
>   ret = drm_new_set_master(dev, file_priv);
>   else
>   file_priv->master = drm_master_get(dev->master);
> -- 
> 2.20.1
> 
> 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


[PATCH] drm/auth: Move master pointer from drm_device to drm_file

2021-06-17 Thread Qiang Ma
The drm_file pointer clears to zero during multi-user switching,
so it needs to call drm_new_set_master for master pointer from drm_file.

Signed-off-by: Qiang Ma 
---
 drivers/gpu/drm/drm_auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index f2d46b7ac6f9..02431af6d0c5 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -302,7 +302,7 @@ int drm_master_open(struct drm_file *file_priv)
/* if there is no current master make this fd it, but do not create
 * any master object for render clients */
mutex_lock(>master_mutex);
-   if (!dev->master)
+   if (!file_priv->master)
ret = drm_new_set_master(dev, file_priv);
else
file_priv->master = drm_master_get(dev->master);
-- 
2.20.1