mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-15 05:23:40 +00:00
kdrive: Don't enable drm master by default
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / xserver-build-netbsd (push) Waiting to run
Build X servers / xserver-build-cygwin (push) Waiting to run
Build X servers / xserver-build-arch (push) Waiting to run
Build X servers / Check Signed-Off-By (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / xserver-build-dragonflybsd (push) Waiting to run
Build X servers / xserver-build-netbsd (push) Waiting to run
Build X servers / xserver-build-cygwin (push) Waiting to run
Build X servers / xserver-build-arch (push) Waiting to run
Build X servers / Check Signed-Off-By (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run
On some cards, `drmSetMaster` hangs.
Since Xfbdev does not set the video card mode, it does not need
master permissions. As such, we can just drop master at the
begining to not conflict with other drm users.
For any cards that do require master permissions,
Xfbdev can still do the `drm{Set,Drop}Master` dance
on {Enter,Leave}VT, with a command line argument.
Fixes: https://github.com/X11Libre/xserver/issues/2711
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
parent
cd01bb5651
commit
52ec2ea514
3 changed files with 19 additions and 4 deletions
|
|
@ -22,10 +22,13 @@
|
|||
#include <xf86drm.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
char *fbdev_glvnd_provider = NULL;
|
||||
char *fbdev_dri_path = NULL;
|
||||
|
||||
bool fbdev_auto_dri3 = FALSE;
|
||||
bool fbdev_drm_master = FALSE;
|
||||
bool es_allowed = TRUE;
|
||||
bool force_es = FALSE;
|
||||
bool fbGlamorAllowed = TRUE;
|
||||
|
|
@ -43,10 +46,14 @@ fbdevInitAccel(ScreenPtr pScreen)
|
|||
scrpriv->dri_fd = open(fbdev_dri_path, O_RDWR);
|
||||
if (scrpriv->dri_fd >= 0) {
|
||||
#ifdef WITH_LIBDRM
|
||||
drmSetMaster(scrpriv->dri_fd);
|
||||
if (fbdev_drm_master) {
|
||||
drmSetMaster(scrpriv->dri_fd);
|
||||
} else {
|
||||
drmDropMaster(scrpriv->dri_fd);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
perror("open");
|
||||
LogMessage(X_WARNING, "Could not open %s: %s\n", fbdev_dri_path, strerror(errno));
|
||||
}
|
||||
} else {
|
||||
scrpriv->dri_fd = -1;
|
||||
|
|
@ -115,7 +122,7 @@ fbdevEnableAccel(ScreenPtr pScreen)
|
|||
KdScreenInfo *screen = pScreenPriv->screen;
|
||||
FbdevScrPriv *scrpriv = screen->driver;
|
||||
|
||||
if (scrpriv->dri_fd >= 0) {
|
||||
if (fbdev_drm_master && scrpriv->dri_fd >= 0) {
|
||||
drmSetMaster(scrpriv->dri_fd);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -129,7 +136,7 @@ fbdevDisableAccel(ScreenPtr pScreen)
|
|||
KdScreenInfo *screen = pScreenPriv->screen;
|
||||
FbdevScrPriv *scrpriv = screen->driver;
|
||||
|
||||
if (scrpriv->dri_fd >= 0) {
|
||||
if (fbdev_drm_master && scrpriv->dri_fd >= 0) {
|
||||
drmDropMaster(scrpriv->dri_fd);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ extern Bool fbDisableShadow;
|
|||
extern char *fbdev_glvnd_provider;
|
||||
extern char *fbdev_dri_path;
|
||||
extern bool fbdev_auto_dri3;
|
||||
extern bool fbdev_drm_master;
|
||||
extern bool es_allowed;
|
||||
extern bool force_es;
|
||||
extern bool fbGlamorAllowed;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ ddxUseMsg(void)
|
|||
("-fb path Framebuffer device to use. Defaults to /dev/fb0\n");
|
||||
ErrorF
|
||||
("-dri <path|auto> Optional drm device path to use\n");
|
||||
ErrorF
|
||||
("-drm-master Enable master permissions on the fd used for dri\n");
|
||||
ErrorF
|
||||
("-noshadow Disable the ShadowFB layer if possible\n");
|
||||
ErrorF
|
||||
|
|
@ -140,6 +142,11 @@ ddxProcessArgument(int argc, char **argv, int i)
|
|||
}
|
||||
}
|
||||
|
||||
if (!strcmp(argv[i], "-drm-master")) {
|
||||
fbdev_drm_master = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!strcmp(argv[i], "-force-gl")) {
|
||||
es_allowed = FALSE;
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue