xf86-video-intel: 2 commits - src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Aug 9 22:53:21 PDT 2014


 src/sna/sna_display.c |   67 +++++++++++++++++++++++++++++---------------------
 1 file changed, 40 insertions(+), 27 deletions(-)

New commits:
commit 8e1961e7fc163f3103b2260cca965aefa61fed40
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Aug 10 06:51:33 2014 +0100

    sna: Respect monitor option "DefaultModes"
    
    The is a monitor option to allow the user to specify whether to add the
    default modes, use it to determine adding the extra modes for panels.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 68295ac..3d9724b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -167,7 +167,7 @@ struct sna_output {
 	unsigned attached_encoders;
 
 	unsigned int is_panel : 1;
-	unsigned int has_scaler : 1;
+	unsigned int add_default_modes : 1;
 
 	uint32_t edid_idx;
 	uint32_t edid_blob_id;
@@ -2864,7 +2864,7 @@ sna_output_get_modes(xf86OutputPtr output)
 	 * If it is incorrect, please fix me.
 	 */
 	sna_output->has_panel_limits = false;
-	if (sna_output->has_scaler) {
+	if (sna_output->add_default_modes) {
 		sna_output->panel_hdisplay = sna_output->panel_vdisplay = 0;
 		for (i = 0; i < sna_output->num_modes; i++) {
 			struct drm_mode_modeinfo *m;
@@ -3697,7 +3697,10 @@ reset:
 	sna_output->id = compat_conn.conn.connector_id;
 	sna_output->is_panel = is_panel(compat_conn.conn.connector_type);
 	sna_output->edid_idx = find_property(sna, sna_output, "EDID");
-	sna_output->has_scaler = find_property(sna, sna_output, "scaling mode") != -1;
+	if (find_property(sna, sna_output, "scaling mode") != -1)
+		sna_output->add_default_modes =
+			xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE);
+
 	i = find_property(sna, sna_output, "DPMS");
 	if (i != -1) {
 		sna_output->dpms_id = sna_output->prop_ids[i];
commit f6e85048b0789162e389ad2b838d417d517d62d9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Aug 9 08:02:39 2014 +0100

    sna: Reorder output array to match primary placement for InitialConfiguration
    
    xf86InitialConfiguration() depends upon the order of the outputs for its
    mode selection and expects the Primary output to be listed first.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82205
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 277e238..68295ac 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -192,6 +192,27 @@ struct sna_output {
 	struct sna_property *props;
 };
 
+enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */
+	OPTION_PREFERRED_MODE,
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,1,0)
+	OPTION_ZOOM_MODES,
+#endif
+	OPTION_POSITION,
+	OPTION_BELOW,
+	OPTION_RIGHT_OF,
+	OPTION_ABOVE,
+	OPTION_LEFT_OF,
+	OPTION_ENABLE,
+	OPTION_DISABLE,
+	OPTION_MIN_CLOCK,
+	OPTION_MAX_CLOCK,
+	OPTION_IGNORE,
+	OPTION_ROTATE,
+	OPTION_PANNING,
+	OPTION_PRIMARY,
+	OPTION_DEFAULT_MODES,
+};
+
 static void sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc);
 
 inline static unsigned count_to_mask(int x)
@@ -3655,7 +3676,11 @@ sna_output_add(struct sna *sna, unsigned id, unsigned serial)
 		assert(outputs[i]->driver_private == NULL);
 		outputs[i]->possible_clones <<= 1;
 	}
-	outputs[i] = output;
+	if (xf86ReturnOptValBool(output->options, OPTION_PRIMARY, FALSE)) {
+		memmove(outputs + 1, outputs, sizeof(output)*config->num_output);
+		outputs[0] = output;
+	} else
+		outputs[i] = output;
 	sna->mode.num_real_output++;
 	config->num_output++;
 	config->output = outputs;
@@ -5135,27 +5160,6 @@ static void set_size_range(struct sna *sna)
 	xf86CrtcSetSizeRange(sna->scrn, 8, 8, INT16_MAX, INT16_MAX);
 }
 
-enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */
-	OPTION_PREFERRED_MODE,
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,1,0)
-	OPTION_ZOOM_MODES,
-#endif
-	OPTION_POSITION,
-	OPTION_BELOW,
-	OPTION_RIGHT_OF,
-	OPTION_ABOVE,
-	OPTION_LEFT_OF,
-	OPTION_ENABLE,
-	OPTION_DISABLE,
-	OPTION_MIN_CLOCK,
-	OPTION_MAX_CLOCK,
-	OPTION_IGNORE,
-	OPTION_ROTATE,
-	OPTION_PANNING,
-	OPTION_PRIMARY,
-	OPTION_DEFAULT_MODES,
-};
-
 #if HAS_GAMMA
 static void set_gamma(uint16_t *curve, int size, double value)
 {
@@ -5614,7 +5618,6 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 		sna->mode.num_real_output = xf86_config->num_output;
 
 		sna_mode_compute_possible_outputs(sna);
-		sort_config_outputs(sna);
 
 		sna->mode.max_crtc_width  = res->max_width;
 		sna->mode.max_crtc_height = res->max_height;
@@ -5638,10 +5641,17 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 		return false;
 
 	if (!sna_probe_initial_configuration(sna)) {
+		xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+
 		sanitize_outputs(sna);
-		if (XF86_CRTC_CONFIG_PTR(scrn)->num_crtc)
+		if (config->num_crtc && config->num_output) {
+			if (!xf86ReturnOptValBool(config->output[0]->options,
+						  OPTION_PRIMARY, FALSE))
+				sort_config_outputs(sna);
 			xf86InitialConfiguration(scrn, TRUE);
+		}
 	}
+	sort_config_outputs(sna);
 
 	sna_setup_provider(scrn);
 	return scrn->modes != NULL;


More information about the xorg-commit mailing list