summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-02-12 13:51:53 -0800
committerMichel Dänzer <michel@daenzer.net>2018-07-06 16:38:35 +0200
commit14db71a606128c4a207f43298809af279b77e2a8 (patch)
tree45f97f2debd21f48a85291d43369aadbab84799a
parentbaea4fa492f635cdfe746a84be2e337d9aeae8a9 (diff)
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 <keithp@keithp.com> (Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--configure.ac2
-rw-r--r--src/drmmode_display.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2593f52..a475f37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ AC_ARG_WITH(xorg-module-dir,
[moduledir="$libdir/xorg/modules"])
# Store the list of server defined optional extensions in REQUIRED_MODULES
-XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+XORG_DRIVER_CHECK_EXT(RANDR, [randrproto >= 1.6.0])
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9364a88..ca8a617 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2595,6 +2595,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
drmModeEncoderPtr *kencoders = NULL;
drmmode_output_private_ptr drmmode_output;
drmModePropertyBlobPtr path_blob = NULL;
+#if XF86_CRTC_VERSION >= 8
+ Bool nonDesktop = FALSE;
+#endif
char name[32];
int i;
const char *s;
@@ -2607,6 +2610,13 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
path_blob = koutput_get_prop_blob(pAMDGPUEnt->fd, koutput, "PATH");
+#if XF86_CRTC_VERSION >= 8
+ i = koutput_get_prop_idx(pAMDGPUEnt->fd, koutput, DRM_MODE_PROP_RANGE,
+ RR_PROPERTY_NON_DESKTOP);
+ if (i >= 0)
+ nonDesktop = koutput->prop_values[i] != 0;
+#endif
+
kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders);
if (!kencoders) {
goto out_free_encoders;
@@ -2638,6 +2648,9 @@ 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;
+#if XF86_CRTC_VERSION >= 8
+ output->non_desktop = nonDesktop;
+#endif
for (i = 0; i < koutput->count_encoders; i++) {
drmModeFreeEncoder(kencoders[i]);
}
@@ -2681,6 +2694,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
output->interlaceAllowed = TRUE;
output->doubleScanAllowed = TRUE;
output->driver_private = drmmode_output;
+#if XF86_CRTC_VERSION >= 8
+ output->non_desktop = nonDesktop;
+#endif
output->possible_crtcs = 0xffffffff;
for (i = 0; i < koutput->count_encoders; i++) {