From b91c787c4cd2d20685db69426c539938c556128a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 12 Feb 2018 13:51:53 -0800 Subject: [PATCH] xf86-video-modesetting: Record non-desktop kernel property at PreInit time Save any value of the kernel non-desktop property in the xf86Output structure to avoid non-desktop outputs in the default configuration. [Also bump randrproto requirement to a version that defines RR_PROPERTY_NON_DESKTOP - ajax] Signed-off-by: Keith Packard Reviewed-by: Adam Jackson --- configure.ac | 2 +- hw/xfree86/drivers/modesetting/drmmode_display.c | 6 ++++++ meson.build | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c1f389c1e..eb5b3a224 100644 --- a/configure.ac +++ b/configure.ac @@ -742,7 +742,7 @@ LIBXSHMFENCE="xshmfence >= 1.1" dnl Required modules XPROTO="xproto >= 7.0.31" -RANDRPROTO="randrproto >= 1.5.0" +RANDRPROTO="randrproto >= 1.6.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.2.99.901" INPUTPROTO="inputproto >= 2.3" diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 7fe16c4a1..c86eb6082 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1769,6 +1769,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r drmmode_output_private_ptr drmmode_output; char name[32]; int i; + Bool nonDesktop = FALSE; drmModePropertyBlobPtr path_blob = NULL; const char *s; koutput = @@ -1777,6 +1778,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r return 0; path_blob = koutput_get_prop_blob(drmmode->fd, koutput, "PATH"); + i = koutput_get_prop_idx(drmmode->fd, koutput, DRM_MODE_PROP_RANGE, RR_PROPERTY_NON_DESKTOP); + if (i >= 0) + nonDesktop = koutput->prop_values[i] != 0; drmmode_create_name(pScrn, koutput, name, path_blob); @@ -1795,6 +1799,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r drmmode_output = output->driver_private; drmmode_output->output_id = mode_res->connectors[num]; drmmode_output->mode_output = koutput; + output->non_desktop = nonDesktop; return 1; } } @@ -1845,6 +1850,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r output->interlaceAllowed = TRUE; output->doubleScanAllowed = TRUE; output->driver_private = drmmode_output; + output->non_desktop = nonDesktop; output->possible_crtcs = 0x7f; for (i = 0; i < koutput->count_encoders; i++) { diff --git a/meson.build b/meson.build index 492d8cd9d..c6a391c73 100644 --- a/meson.build +++ b/meson.build @@ -59,7 +59,7 @@ endforeach add_global_arguments(common_wflags, language : 'c') xproto_dep = dependency('xproto', version: '>= 7.0.31') -randrproto_dep = dependency('randrproto', version: '>= 1.5.0') +randrproto_dep = dependency('randrproto', version: '>= 1.6.0') renderproto_dep = dependency('renderproto', version: '>= 0.11') xextproto_dep = dependency('xextproto', version: '>= 7.2.99.901') inputproto_dep = dependency('inputproto', version: '>= 2.3')