[PATCH xf86-video-amdgpu 1/3] xf86-video-modesetting: Record non-desktop kernel property at PreInit time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at keithp.com>
Reviewed-by: Adam Jackson <ajax at nwnk.net>
---
 src/drmmode_display.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 746e52a..b0fc7ea 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1980,6 +1980,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 	drmModePropertyBlobPtr path_blob = NULL;
 	char name[32];
 	int i;
+	Bool nonDesktop = FALSE;
 	const char *s;
 
 	koutput =
@@ -1989,6 +1990,10 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 		return 0;
 
 	path_blob = koutput_get_prop_blob(pAMDGPUEnt->fd, koutput, "PATH");
+	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;
+
 
 	kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders);
 	if (!kencoders) {
@@ -2021,6 +2026,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;
 			for (i = 0; i < koutput->count_encoders; i++) {
 				drmModeFreeEncoder(kencoders[i]);
 			}
@@ -2064,6 +2070,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 = 0xffffffff;
 	for (i = 0; i < koutput->count_encoders; i++) {
-- 
2.16.2



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux