Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unprivileged use of radeontop via console
With appropriate privileges on the /dev/dri/cardN files, it is possible to run radeontop as normal user. At minimum you need read/write permissions: sudo setfacl -m u:$USER:rw /dev/dri/card* You also need to be the DRM Master (i.e. Xorg must not be active on a console).
- Loading branch information
1 parent
761ffe2
commit fc51270
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Copyright (C) 2016 Peter Wu <peter@lekensteyn.nl> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "radeontop.h" | ||
|
||
void authenticate_drm(int fd) { | ||
drm_magic_t magic; | ||
|
||
/* Obtain magic for our DRM client. */ | ||
if (drmGetMagic(fd, &magic) < 0) { | ||
return; | ||
} | ||
|
||
/* Try self-authenticate (if we are somehow the master). */ | ||
if (drmAuthMagic(fd, magic) == 0) { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters