<style>table.customTableClassName {margin-bottom: 10px;border-collapse: collapse;display: table;}.customTableClassName td, .customTableClassName th {border: 1px solid #ddd;}</style><p style="margin:0px;"><br><span style="background-color: rgb(255, 255, 255); color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px;">> That sounds like a bug. drm_file->master should be always the same -<br></span></p><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">> either you become a new stand-alone thing, our you get linked to the</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">> current master.</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">> <br style="box-sizing: border-box;">> Or I'm completely missing what you're trying to fix here.</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">Now I have a bug, the soft cursor disappears when switching users.</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">debug it, the fpriv->is_master is found to be 0. </span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">The reason it is 0 is that switching the user frees pointer of drm_file, </span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">and creating a new pointer of drm_file, and setting master. </span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">However, since dev->master is non-0, </span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">drm_new_set_master() of the setting master function will not be executed.</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">--</span></div><div style="box-sizing: border-box; color: rgb(51, 51, 51); font-family: Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", Roboto, "Heiti SC", "Microsoft Yahei", sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);"><span style="font-size: 16px;">Qiang Ma</span></div><p style="margin:0px;"></p><p style="margin:0px;"><br></p><p style="margin:0px;"><br></p><p style="margin:0px;">On Thu, Jun 17, 2021 at 05:47:33PM +0800, Qiang Ma wrote: <br>> The drm_file pointer clears to zero during multi-user switching, <br>> so it needs to call drm_new_set_master for master pointer from drm_file. <br>
<br>That sounds like a bug. drm_file->master should be always the same - <br>either you become a new stand-alone thing, our you get linked to the <br>current master. <br>
<br>Or I'm completely missing what you're trying to fix here. <br>-Daniel <br>
<br>>
<br>> Signed-off-by: Qiang Ma <maqianga@uniontech.com> <br>> --- <br>> drivers/gpu/drm/drm_auth.c | 2 +- <br>> 1 file changed, 1 insertion(+), 1 deletion(-) <br>>
<br>> diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c <br>> index f2d46b7ac6f9..02431af6d0c5 100644 <br>> --- a/drivers/gpu/drm/drm_auth.c <br>> +++ b/drivers/gpu/drm/drm_auth.c <br>> @@ -302,7 +302,7 @@ int drm_master_open(struct drm_file *file_priv) <br>> /* if there is no current master make this fd it, but do not create <br>> * any master object for render clients */ <br>> mutex_lock(&dev->master_mutex); <br>> - if (!dev->master) <br>> + if (!file_priv->master) <br>> ret = drm_new_set_master(dev, file_priv); <br>> else <br>> file_priv->master = drm_master_get(dev->master); <br>> --
<br>> 2.20.1 <br>>
<br>>
<br>>
<br>
<br>--
<br>Daniel Vetter <br>Software Engineer, Intel Corporation <br><a href="http://blog.ffwll.ch" target="_blank">http://blog.ffwll.ch</a>
<br>
<br>
<br>
</p>