Skip to content

Commit

Permalink
Add a warning when failing to drop DRM master
Browse files Browse the repository at this point in the history
When running radeontop as normal user from the console, DRM master
cannot be dropped. On a VT switch, other clients (eg. X11) are not
able to regain master and crash or exit. Users of systemd-logind
should not be affected.
  • Loading branch information
trek00 authored and clbr committed Sep 30, 2019
1 parent 63ab59f commit b242d82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ void authenticate_drm(int fd) {

/* Try self-authenticate (if we are somehow the master). */
if (drmAuthMagic(fd, magic) == 0) {
if (drmDropMaster(fd))
if (drmDropMaster(fd)) {
perror(_("Failed to drop DRM master"));
fprintf(stderr, _("\nWARNING: other DRM clients will crash on VT switch while radeontop is running!\npress ENTER to continue\n"));
fgetc(stdin);
}
return;
}

Expand Down

0 comments on commit b242d82

Please sign in to comment.