mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-21 01:13:38 +00:00
kdrive/modesetting: pass the gbm device to glamor
Don't have it open another one This fixes a segfault when the render card is different from the scanout card, and glamor uses the fast gbm import path. If https://github.com/X11Libre/xserver/issues/2645 applies to Xmodesetting, this probably fixes it. This is also a resource usage optimization, since glamor doesn't allocate another gbm device when Xmodesetting already allocates a perfectly usable one. Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
parent
fbde8700f8
commit
29a6b17197
3 changed files with 4 additions and 0 deletions
|
|
@ -129,6 +129,8 @@ msGlamorInit(ScreenPtr pScreen)
|
|||
uint32_t format;
|
||||
int write_pos = 0;
|
||||
|
||||
config->glamor_info.gbm = priv->gbm;
|
||||
|
||||
if (!config->glamor_info.dri_path) {
|
||||
config->glamor_info.dri_fd = dup(gbm_device_get_fd(priv->gbm));
|
||||
if (config->glamor_info.dri_fd >= 0) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ KdGlamorInit(ScreenPtr pScreen, KdGlamorInfo *info, int *caps)
|
|||
.glvnd_vendor = info->glvnd,
|
||||
.fd = -1,
|
||||
.gbm_forbidden = !info->use_gbm,
|
||||
.gbm = info->gbm,
|
||||
.direct_dri3_only = info->direct_dri3,
|
||||
.auto_dri = FALSE, /* deprecated */
|
||||
.partial_dri_allowed = FALSE, /* deprecated */
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ typedef struct {
|
|||
/* Passed to glamor_egl */
|
||||
const char* glvnd; /* glvnd vendor library or driver name */
|
||||
const char* dri_path; /* /dev/dri/[cardxx|renderDxxx] */
|
||||
void* gbm; /* Optional gbm device to pass to glamor */
|
||||
Bool use_gbm; /* If glamor should try to use libgbm */
|
||||
Bool direct_dri3; /* If glamor should only use the direct DRI3 implementation */
|
||||
Bool force_gl; /* If glamor should only create desktop gl contexts */
|
||||
|
|
|
|||
Loading…
Reference in a new issue