Skip to contentSkip to conversation

drm: Try to make display info less nuts

RFC PATCH In review Ville Syrjala 11 participants 39 messages Feb 27, 2018 – Mar 7, 2018

Subsystems (21)
lore
Share & tools
lore
#0 lore raw

cover drm: Try to make display info less nuts

From: Ville Syrjälä <[email protected]>

Currently the display info is cleared/populated in a very ad-hoc manner. I'd like to make it more robust by making sure it gets cleared by the core forcing drivers to repopulate in .fill_modes().

The bus_formats stuff looks very much ad-hoc all over, so I left that out from consideration for now.

The locking around the display info and edid updates looks somewhat busted as well, so I figured I'd sprinkle some lockdep asserts around. That last part probably won't cooperate nicely with amdgpu as they seem to be doing edid updates from the modeset path. So need to think of some way to untangle that mess. Hence this is just an RFC for now.

Cc Alison Wang <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Archit Taneja <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Keith Packard <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Patrik Jakobsson <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>

Ville Syrjälä (11):
drm/gma500: Fill display_info.{width,height}_mm from .get_modes() drm/i915: Fill display_info.{width,height}_mm from .get_modes() drm/shmobile: Don't fill display_info.{width,height}_mm at init time
drm: Split the display info into static and dynamic parts drm/edid: Clear display info fully
drm/edid: Don't call drm_add_display_info() with an invalid EDID drm/probe-helper: Avoid iterating the list twice on ww backoff
drm: Add drm_connector_fill_modes()
drm: Fix getconnector locking
drm: Fix debugfs edid_override locking
drm: Sprinkle lockdep asserts for edid/display_info

 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     |   2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c           |   2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |   2 +-
 drivers/gpu/drm/bridge/sii902x.c                   |   2 +-
 drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
 drivers/gpu/drm/drm_connector.c                    |  70 ++++++++---
 drivers/gpu/drm/drm_debugfs.c                      |  12 +-
 drivers/gpu/drm/drm_edid.c                         |  35 +-----
 drivers/gpu/drm/drm_fb_helper.c                    |   4 +-
 drivers/gpu/drm/drm_probe_helper.c                 |  10 +-
 drivers/gpu/drm/drm_sysfs.c                        |   6 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c            |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/mdfld_dsi_output.c          |  14 +--
 drivers/gpu/drm/gma500/oaktrail_hdmi.c             |   2 +-
 drivers/gpu/drm/gma500/oaktrail_lvds.c             |   2 +-
 drivers/gpu/drm/gma500/psb_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/psb_intel_sdvo.c            |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |   2 +-
 drivers/gpu/drm/i915/intel_dp.c                    |  15 ++-
 drivers/gpu/drm/i915/intel_dsi.c                   |  17 +--
 drivers/gpu/drm/i915/intel_dvo.c                   |   2 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |  11 +-
 drivers/gpu/drm/i915/intel_sdvo.c                  |   2 +-
 drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
 drivers/gpu/drm/imx/parallel-display.c             |   2 +-
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |   6 +-
 drivers/gpu/drm/panel/panel-arm-versatile.c        |   2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c       |   8 +-
 drivers/gpu/drm/panel/panel-lvds.c                 |   4 +-
 .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  |   2 +-
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c        |   4 +-
 drivers/gpu/drm/panel/panel-simple.c               |   4 +-
 drivers/gpu/drm/pl111/pl111_display.c              |   4 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   2 +-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c          |   3 -
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |   4 +-
 drivers/gpu/drm/tve200/tve200_display.c            |   2 +-
 drivers/gpu/drm/vc4/vc4_dpi.c                      |   4 +-
 include/drm/drm_connector.h                        | 128 ++++++++++++---------
 include/drm/drm_edid.h                             |   1 -
 43 files changed, 227 insertions(+), 185 deletions(-)
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

RFC PATCH 1/11 drm/gma500: Fill display_info.{width, height}_mm from .get_modes()

From: Ville Syrjälä <[email protected]>

display_info.width_mm and display_info.height_mm are dynamic metadata that either gets parsed from the EDID or filled by the driver by some other means. Either way we should update it in the same place, ie. the .fill_modes()/.get_modes() hooks.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Patrik Jakobsson <[email protected]>
---
 drivers/gpu/drm/gma500/mdfld_dsi_output.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/gma500/mdfld_dsi_output.c +6 -6
index acb3848ef1c9..41e7f25ba7e0 100644
@@ -336,6 +336,9 @@ static int mdfld_dsi_connector_get_modes(struct drm_connector *connector)
 	struct drm_device *dev = connector->dev;
 
 	if (fixed_mode) {
+		connector->display_info.width_mm = fixed_mode->width_mm;
+		connector->display_info.height_mm = fixed_mode->height_mm;
+
 		dev_dbg(dev->dev, "fixed_mode %dx%d\n",
 				fixed_mode->hdisplay, fixed_mode->vdisplay);
 		dup_mode = drm_mode_duplicate(dev, fixed_mode);
@@ -487,7 +490,6 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 	struct mdfld_dsi_encoder *encoder;
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	struct panel_info dsi_panel_info;
-	u32 width_mm, height_mm;
 
 	dev_dbg(dev->dev, "init DSI output on pipe %d\n", pipe);
 
@@ -522,9 +524,6 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 	if (p_vid_funcs->get_panel_info(dev, pipe, &dsi_panel_info))
 			goto dsi_init_err0;
 
-	width_mm = dsi_panel_info.width_mm;
-	height_mm = dsi_panel_info.height_mm;
-
 	dsi_config->mode = dsi_config->fixed_mode;
 	dsi_config->connector = dsi_connector;
 
@@ -533,6 +532,9 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 		goto dsi_init_err0;
 	}
 
+	dsi_config->fixed_mode->width_mm = dsi_panel_info.width_mm;
+	dsi_config->fixed_mode->height_mm = dsi_panel_info.height_mm;
+
 	if (pipe && dev_priv->dsi_configs[0]) {
 		dsi_config->dvr_ic_inited = 0;
 		dev_priv->dsi_configs[1] = dsi_config;
@@ -554,8 +556,6 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 	drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
 
 	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
-	connector->display_info.width_mm = width_mm;
-	connector->display_info.height_mm = height_mm;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
Signature · 6 lines
2.13.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

RFC PATCH 2/11 drm/i915: Fill display_info.{width, height}_mm from .get_modes()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

display_info.width_mm and display_info.height_mm are dynamic metadata that either gets parsed from the EDID or filled by the driver by some other means. Either way we should update it in the same place, ie. the .fill_modes()/.get_modes() hooks.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/intel_dp.c   | 15 +++++++--------
 drivers/gpu/drm/i915/intel_dsi.c  | 13 +++++++------
 drivers/gpu/drm/i915/intel_lvds.c |  9 ++++++---
 3 files changed, 20 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +7 -8
index 801a21b16004..edfcad276506 100644
@@ -4966,6 +4966,7 @@ intel_dp_force(struct drm_connector *connector)
 static int intel_dp_get_modes(struct drm_connector *connector)
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
+	const struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
 	struct edid *edid;
 
 	edid = intel_connector->detect_edid;
@@ -4976,12 +4977,13 @@ static int intel_dp_get_modes(struct drm_connector *connector)
 	}
 
 	/* if eDP has no EDID, fall back to fixed mode */
-	if (intel_dp_is_edp(intel_attached_dp(connector)) &&
-	    intel_connector->panel.fixed_mode) {
+	if (intel_dp_is_edp(intel_attached_dp(connector)) && fixed_mode) {
 		struct drm_display_mode *mode;
 
-		mode = drm_mode_duplicate(connector->dev,
-					  intel_connector->panel.fixed_mode);
+		connector->display_info.width_mm = fixed_mode->width_mm;
+		connector->display_info.height_mm = fixed_mode->height_mm;
+
+		mode = drm_mode_duplicate(connector->dev, fixed_mode);
 		if (mode) {
 			drm_mode_probed_add(connector, mode);
 			return 1;
@@ -6251,11 +6253,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	if (!fixed_mode && dev_priv->vbt.lfp_lvds_vbt_mode) {
 		fixed_mode = drm_mode_duplicate(dev,
 					dev_priv->vbt.lfp_lvds_vbt_mode);
-		if (fixed_mode) {
+		if (fixed_mode)
 			fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
-			connector->display_info.width_mm = fixed_mode->width_mm;
-			connector->display_info.height_mm = fixed_mode->height_mm;
-		}
 	}
 	mutex_unlock(&dev->mode_config.mutex);
 
drivers/gpu/drm/i915/intel_dsi.c +7 -6
index 51a1d6868b1e..c8cf3d5c7783 100644
@@ -1599,17 +1599,21 @@ static void intel_dsi_unprepare(struct intel_encoder *encoder)
 static int intel_dsi_get_modes(struct drm_connector *connector)
 {
 	struct intel_connector *intel_connector = to_intel_connector(connector);
+	const struct drm_display_mode *fixed_mode =
+		intel_connector->panel.fixed_mode;
 	struct drm_display_mode *mode;
 
 	DRM_DEBUG_KMS("\n");
 
-	if (!intel_connector->panel.fixed_mode) {
+	if (!fixed_mode) {
 		DRM_DEBUG_KMS("no fixed mode\n");
 		return 0;
 	}
 
-	mode = drm_mode_duplicate(connector->dev,
-				  intel_connector->panel.fixed_mode);
+	connector->display_info.width_mm = fixed_mode->width_mm;
+	connector->display_info.height_mm = fixed_mode->height_mm;
+
+	mode = drm_mode_duplicate(connector->dev, fixed_mode);
 	if (!mode) {
 		DRM_DEBUG_KMS("drm_mode_duplicate failed\n");
 		return 0;
@@ -1843,9 +1847,6 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 		goto err;
 	}
 
-	connector->display_info.width_mm = fixed_mode->width_mm;
-	connector->display_info.height_mm = fixed_mode->height_mm;
-
 	intel_panel_init(&intel_connector->panel, fixed_mode, NULL, NULL);
 	intel_panel_setup_backlight(connector, INVALID_PIPE);
 
drivers/gpu/drm/i915/intel_lvds.c +6 -3
index d35d2d50f595..cdae4934b885 100644
@@ -477,6 +477,8 @@ intel_lvds_detect(struct drm_connector *connector, bool force)
 static int intel_lvds_get_modes(struct drm_connector *connector)
 {
 	struct intel_lvds_connector *lvds_connector = to_lvds_connector(connector);
+	const struct drm_display_mode *fixed_mode =
+		lvds_connector->base.panel.fixed_mode;
 	struct drm_device *dev = connector->dev;
 	struct drm_display_mode *mode;
 
@@ -484,7 +486,10 @@ static int intel_lvds_get_modes(struct drm_connector *connector)
 	if (!IS_ERR_OR_NULL(lvds_connector->base.edid))
 		return drm_add_edid_modes(connector, lvds_connector->base.edid);
 
-	mode = drm_mode_duplicate(dev, lvds_connector->base.panel.fixed_mode);
+	connector->display_info.width_mm = fixed_mode->width_mm;
+	connector->display_info.height_mm = fixed_mode->height_mm;
+
+	mode = drm_mode_duplicate(dev, fixed_mode);
 	if (mode == NULL)
 		return 0;
 
@@ -1114,8 +1119,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
 		fixed_mode = drm_mode_duplicate(dev, dev_priv->vbt.lfp_lvds_vbt_mode);
 		if (fixed_mode) {
 			fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
-			connector->display_info.width_mm = fixed_mode->width_mm;
-			connector->display_info.height_mm = fixed_mode->height_mm;
 			goto out;
 		}
 	}
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

RFC PATCH 3/11 drm/shmobile: Don't fill display_info.{width, height}_mm at init time

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

shmobile is already populating display_info.width_mm and display_info.height_mm from the .get_modes() hook which is what we want. No need to populate it from the init path as well.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +0 -3
index e7738939a86d..327b7965679a 100644
@@ -703,9 +703,6 @@ int shmob_drm_connector_create(struct shmob_drm_device *sdev,
 
 	sdev->connector.encoder = encoder;
 
-	connector->display_info.width_mm = sdev->pdata->panel.width_mm;
-	connector->display_info.height_mm = sdev->pdata->panel.height_mm;
-
 	ret = drm_connector_init(sdev->ddev, connector, &connector_funcs,
 				 DRM_MODE_CONNECTOR_LVDS);
 	if (ret < 0)
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

RFC PATCH 4/11 drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     |   2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c           |   2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |   2 +-
 drivers/gpu/drm/bridge/sii902x.c                   |   2 +-
 drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
 drivers/gpu/drm/drm_connector.c                    |  12 +-
 drivers/gpu/drm/drm_fb_helper.c                    |   2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c            |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/mdfld_dsi_output.c          |   2 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi.c             |   2 +-
 drivers/gpu/drm/gma500/oaktrail_lvds.c             |   2 +-
 drivers/gpu/drm/gma500/psb_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/psb_intel_sdvo.c            |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |   2 +-
 drivers/gpu/drm/i915/intel_dsi.c                   |   4 +-
 drivers/gpu/drm/i915/intel_dvo.c                   |   2 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |   2 +-
 drivers/gpu/drm/i915/intel_sdvo.c                  |   2 +-
 drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
 drivers/gpu/drm/imx/parallel-display.c             |   2 +-
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |   6 +-
 drivers/gpu/drm/panel/panel-arm-versatile.c        |   2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c       |   8 +-
 drivers/gpu/drm/panel/panel-lvds.c                 |   4 +-
 .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  |   2 +-
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c        |   4 +-
 drivers/gpu/drm/panel/panel-simple.c               |   4 +-
 drivers/gpu/drm/pl111/pl111_display.c              |   4 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   2 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |   4 +-
 drivers/gpu/drm/tve200/tve200_display.c            |   2 +-
 drivers/gpu/drm/vc4/vc4_dpi.c                      |   4 +-
 include/drm/drm_connector.h                        | 123 ++++++++++++---------
 36 files changed, 125 insertions(+), 106 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
index 74d2efaec52f..1ba72dc2a85b 100644
@@ -1927,7 +1927,7 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +1 -1
index 120dd3b26fc2..7e9f7f1ab1b1 100644
@@ -639,7 +639,7 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
 			   DRM_MODE_CONNECTOR_VIRTUAL);
 	drm_connector_helper_add(connector, &dce_virtual_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 	drm_connector_register(connector);
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
index d73281095fac..2d18c8ef22a0 100644
@@ -238,7 +238,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state)
 	crtc = drm_crtc_to_atmel_hlcdc_crtc(state->crtc);
 
 	for_each_new_connector_in_state(state->state, connector, cstate, i) {
-		struct drm_display_info *info = &connector->display_info;
+		struct drm_static_display_info *info = &connector->static_display_info;
 		unsigned int supported_fmts = 0;
 		int j;
 
drivers/gpu/drm/bridge/sii902x.c +1 -1
index b1ab4ab09532..abd0bce9c31e 100644
@@ -174,7 +174,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
 		kfree(edid);
 	}
 
-	ret = drm_display_info_set_bus_formats(&connector->display_info,
+	ret = drm_display_info_set_bus_formats(&connector->static_display_info,
 					       &bus_format, 1);
 	if (ret)
 		return ret;
drivers/gpu/drm/bridge/tc358767.c +1 -1
index 08ab7d6aea65..042ded9ca749 100644
@@ -1193,7 +1193,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
 	if (tc->panel)
 		drm_panel_attach(tc->panel, &tc->connector);
 
-	drm_display_info_set_bus_formats(&tc->connector.display_info,
+	drm_display_info_set_bus_formats(&tc->connector.static_display_info,
 					 &bus_format, 1);
 	drm_mode_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
 
drivers/gpu/drm/drm_connector.c +6 -6
index b3cde897cd80..d73e97ed7dff 100644
@@ -237,7 +237,7 @@ int drm_connector_init(struct drm_device *dev,
 	mutex_init(&connector->mutex);
 	connector->edid_blob_ptr = NULL;
 	connector->status = connector_status_unknown;
-	connector->display_info.panel_orientation =
+	connector->static_display_info.panel_orientation =
 		DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
 
 	drm_connector_get_cmdline_mode(connector);
@@ -366,7 +366,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 	ida_simple_remove(&dev->mode_config.connector_ida,
 			  connector->index);
 
-	kfree(connector->display_info.bus_formats);
+	kfree(connector->static_display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
 	kfree(connector->name);
 	connector->name = NULL;
@@ -674,7 +674,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
 
 /**
  * drm_display_info_set_bus_formats - set the supported bus formats
- * @info: display info to store bus formats in
+ * @info: fixed display info to store bus formats in
  * @formats: array containing the supported bus formats
  * @num_formats: the number of entries in the fmts array
  *
@@ -682,7 +682,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
  * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
  * a full list of available formats.
  */
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
 				     const u32 *formats,
 				     unsigned int num_formats)
 {
@@ -1460,7 +1460,7 @@ int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_display_info *info = &connector->display_info;
+	struct drm_static_display_info *info = &connector->static_display_info;
 	struct drm_property *prop;
 	int orientation_quirk;
 
@@ -1602,7 +1602,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
 	out_resp->mm_width = connector->display_info.width_mm;
 	out_resp->mm_height = connector->display_info.height_mm;
-	out_resp->subpixel = connector->display_info.subpixel_order;
+	out_resp->subpixel = connector->static_display_info.subpixel_order;
 	out_resp->connection = connector->status;
 
 	/* delayed so we get modes regardless of pre-fill_modes state */
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 035784ddd133..18cb63b30e33 100644
@@ -2433,7 +2433,7 @@ static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
 
 	fb_crtc->rotation = DRM_MODE_ROTATE_0;
 
-	switch (connector->display_info.panel_orientation) {
+	switch (connector->static_display_info.panel_orientation) {
 	case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
 		rotation = DRM_MODE_ROTATE_180;
 		break;
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +1 -1
index 0e3752437e44..2444c14639ef 100644
@@ -99,7 +99,7 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	vsw = mode->vsync_end - mode->vsync_start;
 
 	/* INV_PXCK as default (most display sample data on rising edge) */
-	if (!(con->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
+	if (!(con->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
 		pol |= DCU_SYN_POL_INV_PXCK;
 
 	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -1
index 563f193fcfac..6d608ce26076 100644
@@ -322,7 +322,7 @@ void cdv_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_hdmi_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_hdmi_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/cdv_intel_lvds.c +1 -1
index e64960db3224..290221f73cbf 100644
@@ -637,7 +637,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/mdfld_dsi_output.c +1 -1
index 41e7f25ba7e0..605c86ded14f 100644
@@ -555,7 +555,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 						DRM_MODE_CONNECTOR_LVDS);
 	drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
index 8b2eb32ee988..c4e16ab25d1a 100644
@@ -661,7 +661,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
 	drm_connector_helper_add(connector, &oaktrail_hdmi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 	drm_connector_register(connector);
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -1
index e6943fef0611..4b8d2b6e7202 100644
@@ -331,7 +331,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_lvds.c +1 -1
index be3eefec5152..fe4667eba85f 100644
@@ -706,7 +706,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
index 84507912be84..3b31dde4c05a 100644
@@ -2016,7 +2016,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 0;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
 
 	connector->base.save = psb_intel_sdvo_save;
 	connector->base.restore = psb_intel_sdvo_restore;
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 33fbf3965309..ed36b4e6e4ae 100644
@@ -2972,7 +2972,7 @@ static void intel_connector_info(struct seq_file *m,
 			   connector->display_info.width_mm,
 			   connector->display_info.height_mm);
 		seq_printf(m, "\tsubpixel order: %s\n",
-			   drm_get_subpixel_order_name(connector->display_info.subpixel_order));
+			   drm_get_subpixel_order_name(connector->static_display_info.subpixel_order));
 		seq_printf(m, "\tCEA rev: %d\n",
 			   connector->display_info.cea_rev);
 	}
drivers/gpu/drm/i915/intel_dsi.c +2 -2
index c8cf3d5c7783..3eaf9bb8498d 100644
@@ -1702,7 +1702,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
 
 		connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
 
-		connector->base.display_info.panel_orientation =
+		connector->base.static_display_info.panel_orientation =
 			intel_dsi_get_panel_orientation(connector);
 		drm_connector_init_panel_orientation_property(
 				&connector->base,
@@ -1826,7 +1826,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 
 	drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_dvo.c +1 -1
index eb0c559b2715..68fe4587441f 100644
@@ -520,7 +520,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
 
 		drm_connector_helper_add(connector,
 					 &intel_dvo_connector_helper_funcs);
-		connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+		connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 		connector->interlace_allowed = false;
 		connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_lvds.c +1 -1
index cdae4934b885..c35f84642c79 100644
@@ -1050,7 +1050,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
 		intel_encoder->crtc_mask = (1 << 1);
 
 	drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
index 0c14d1c04cbd..6309a1d9f87e 100644
@@ -2440,7 +2440,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 1;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->base.get_hw_state = intel_sdvo_connector_get_hw_state;
 
 	intel_connector_attach_encoder(&connector->base, &encoder->base);
drivers/gpu/drm/imx/imx-ldb.c +2 -2
index 56dd7a9a8e25..4909fe89e167 100644
@@ -299,7 +299,7 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder,
 
 	if (!bus_format) {
 		struct drm_connector *connector = connector_state->connector;
-		struct drm_display_info *di = &connector->display_info;
+		struct drm_static_display_info *di = &connector->static_display_info;
 
 		if (di->num_bus_formats)
 			bus_format = di->bus_formats[0];
@@ -358,7 +358,7 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
 	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
 	u32 bus_format = imx_ldb_ch->bus_format;
 
 	/* Bus format description in DT overrides connector display info. */
drivers/gpu/drm/imx/parallel-display.c +1 -1
index aedecda9728a..2aa80484a39d 100644
@@ -118,7 +118,7 @@ static int imx_pd_encoder_atomic_check(struct drm_encoder *encoder,
 				       struct drm_connector_state *conn_state)
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
 	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
 	if (!imxpd->bus_format && di->num_bus_formats) {
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +3 -3
index 0abe77675b76..0429006288d6 100644
@@ -101,8 +101,8 @@ static void mxsfb_set_bus_fmt(struct mxsfb_drm_private *mxsfb)
 
 	reg = readl(mxsfb->base + LCDC_CTRL);
 
-	if (mxsfb->connector.display_info.num_bus_formats)
-		bus_format = mxsfb->connector.display_info.bus_formats[0];
+	if (mxsfb->connector.static_display_info.num_bus_formats)
+		bus_format = mxsfb->connector.static_display_info.bus_formats[0];
 
 	reg &= ~CTRL_BUS_WIDTH_MASK;
 	switch (bus_format) {
@@ -199,7 +199,7 @@ static int mxsfb_reset_block(void __iomem *reset_addr)
 static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
 {
 	struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
-	const u32 bus_flags = mxsfb->connector.display_info.bus_flags;
+	const u32 bus_flags = mxsfb->connector.static_display_info.bus_flags;
 	u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
 	int err;
 
drivers/gpu/drm/panel/panel-arm-versatile.c +1 -1
index b428c4678106..25958bc4c5ca 100644
@@ -268,7 +268,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel)
 		DRM_DISPLAY_INFO_LEN);
 	connector->display_info.width_mm = vpanel->panel_type->width_mm;
 	connector->display_info.height_mm = vpanel->panel_type->height_mm;
-	connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
+	connector->static_display_info.bus_flags = vpanel->panel_type->bus_flags;
 
 	mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode);
 	drm_mode_set_name(mode);
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +4 -4
index b4ec0ecff807..1ba893942a2b 100644
@@ -411,19 +411,19 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
 	 */
 	if (ili->conf->dclk_active_high) {
 		reg = ILI9322_POL_DCLK;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_POSEDGE;
 	} else {
 		reg = 0;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_NEGEDGE;
 	}
 	if (ili->conf->de_active_high) {
 		reg |= ILI9322_POL_DE;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_HIGH;
 	} else {
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_LOW;
 	}
 	if (ili->conf->hsync_active_high)
drivers/gpu/drm/panel/panel-lvds.c +2 -2
index b5e3994f0aa8..b52095666bda 100644
@@ -127,9 +127,9 @@ static int panel_lvds_get_modes(struct drm_panel *panel)
 
 	connector->display_info.width_mm = lvds->width;
 	connector->display_info.height_mm = lvds->height;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &lvds->bus_format, 1);
-	connector->display_info.bus_flags = lvds->data_mirror
+	connector->static_display_info.bus_flags = lvds->data_mirror
 					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
 					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
 
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +1 -1
index d964d454e4ae..9526461c0eb3 100644
@@ -356,7 +356,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel)
 	connector->display_info.bpc = 8;
 	connector->display_info.width_mm = 154;
 	connector->display_info.height_mm = 86;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &bus_format, 1);
 
 	return num;
drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +2 -2
index 71c09ed436ae..ffa9d1b6f863 100644
@@ -115,9 +115,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;
 }
drivers/gpu/drm/panel/panel-simple.c +2 -2
index 5591984a392b..ba3f85b7338f 100644
@@ -152,9 +152,9 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;
 }
drivers/gpu/drm/pl111/pl111_display.c +2 -2
index 5b8368c76734..affd050ee409 100644
@@ -148,10 +148,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 		tim2 |= TIM2_IVS;
 
 	if (connector) {
-		if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+		if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
 			tim2 |= TIM2_IOE;
 
-		if (connector->display_info.bus_flags &
+		if (connector->static_display_info.bus_flags &
 		    DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 			tim2 |= TIM2_IPC;
 	}
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
index 2e2ca3c6b47d..c8a0f856f84e 100644
@@ -2363,7 +2363,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
@@ -2526,7 +2526,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 }
 
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +1 -1
index ba8d2804c1d1..72723a80b1e3 100644
@@ -102,7 +102,7 @@ static void rcar_du_encoder_mode_set(struct drm_encoder *encoder,
 				     struct drm_connector_state *conn_state)
 {
 	struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
-	struct drm_display_info *info = &conn_state->connector->display_info;
+	struct drm_static_display_info *info = &conn_state->connector->static_display_info;
 	enum rcar_lvds_mode mode;
 
 	rcar_du_crtc_route_output(crtc_state->crtc, renc->output);
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -2
index 1d714c06ec9d..d20a876ba4c6 100644
@@ -55,13 +55,13 @@ static struct drm_connector *sun4i_tcon_get_connector(const struct drm_encoder *
 static int sun4i_tcon_get_pixel_depth(const struct drm_encoder *encoder)
 {
 	struct drm_connector *connector;
-	struct drm_display_info *info;
+	struct drm_static_display_info *info;
 
 	connector = sun4i_tcon_get_connector(encoder);
 	if (!connector)
 		return -EINVAL;
 
-	info = &connector->display_info;
+	info = &connector->static_display_info;
 	if (info->num_bus_formats != 1)
 		return -EINVAL;
 
drivers/gpu/drm/tve200/tve200_display.c +1 -1
index db397fcb345a..aa805e2bc0fe 100644
@@ -148,7 +148,7 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
 	/* Vsync IRQ at start of Vsync at first */
 	ctrl1 |= TVE200_VSTSTYPE_VSYNC;
 
-	if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
+	if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 		ctrl1 |= TVE200_CTRL_TVCLKP;
 
 	if ((mode->hdisplay == 352 && mode->vdisplay == 240) || /* SIF(525) */
drivers/gpu/drm/vc4/vc4_dpi.c +2 -2
index 72c9dbd81d7f..a757a2670353 100644
@@ -170,8 +170,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 	u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE;
 	int ret;
 
-	if (dpi->connector->display_info.num_bus_formats) {
-		u32 bus_format = dpi->connector->display_info.bus_formats[0];
+	if (dpi->connector->static_display_info.num_bus_formats) {
+		u32 bus_format = dpi->connector->static_display_info.bus_formats[0];
 
 		switch (bus_format) {
 		case MEDIA_BUS_FMT_RGB888_1X24:
include/drm/drm_connector.h +71 -52

181 lines not on this page · raw message

Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 4/11
#5 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

Quoted 27 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Quoted 8 lines
Cc Marek Vasut <[email protected]>
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>

For sun4i,

Thanks!
Maxime

Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 4/11
#6 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 18 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes().

For other drivers this stuff even gets frobbed at
runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

[...]

Quoted 2 lines
 drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
 drivers/gpu/drm/imx/parallel-display.c             |   2 +-

For imx-drm,

regards
Philipp
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 4/11
#7 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 17 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

[...]

Quoted 19 lines
drivers/gpu/drm/bridge/sii902x.c +1 -1
index b1ab4ab09532..abd0bce9c31e 100644
@@ -174,7 +174,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
  		kfree(edid);
  	}
 
-	ret = drm_display_info_set_bus_formats(&connector->display_info,
+	ret = drm_display_info_set_bus_formats(&connector->static_display_info,
  					       &bus_format, 1);
  	if (ret)
  		return ret;
drivers/gpu/drm/bridge/tc358767.c +0 -0
index 08ab7d6aea65..042ded9ca749 100644

drivers/gpu/drm/bridge/tc358767.c static int tc_bridge_attach(struct drm_bridge *bridge) · line 1199

Quoted 8 lines
drivers/gpu/drm/bridge/tc358767.c +1 -1
@@ -1193,7 +1193,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
  	if (tc->panel)
  		drm_panel_attach(tc->panel, &tc->connector);
 
-	drm_display_info_set_bus_formats(&tc->connector.display_info,
+	drm_display_info_set_bus_formats(&tc->connector.static_display_info,
  					 &bus_format, 1);
  	drm_mode_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
 

The sii902x driver sets the bus_formats in get_modes, but it's a fixed value and we may as well do it in bridge's attach op.

For the bridge drivers:

Thanks,
Archit

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala

for I915: Acked-by: Shashank Sharma <[email protected]>

Regards
Shashank

Quoted 832 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     |   2 +-
  drivers/gpu/drm/amd/amdgpu/dce_virtual.c           |   2 +-
  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |   2 +-
  drivers/gpu/drm/bridge/sii902x.c                   |   2 +-
  drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
  drivers/gpu/drm/drm_connector.c                    |  12 +-
  drivers/gpu/drm/drm_fb_helper.c                    |   2 +-
  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-
  drivers/gpu/drm/gma500/cdv_intel_hdmi.c            |   2 +-
  drivers/gpu/drm/gma500/cdv_intel_lvds.c            |   2 +-
  drivers/gpu/drm/gma500/mdfld_dsi_output.c          |   2 +-
  drivers/gpu/drm/gma500/oaktrail_hdmi.c             |   2 +-
  drivers/gpu/drm/gma500/oaktrail_lvds.c             |   2 +-
  drivers/gpu/drm/gma500/psb_intel_lvds.c            |   2 +-
  drivers/gpu/drm/gma500/psb_intel_sdvo.c            |   2 +-
  drivers/gpu/drm/i915/i915_debugfs.c                |   2 +-
  drivers/gpu/drm/i915/intel_dsi.c                   |   4 +-
  drivers/gpu/drm/i915/intel_dvo.c                   |   2 +-
  drivers/gpu/drm/i915/intel_lvds.c                  |   2 +-
  drivers/gpu/drm/i915/intel_sdvo.c                  |   2 +-
  drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
  drivers/gpu/drm/imx/parallel-display.c             |   2 +-
  drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |   6 +-
  drivers/gpu/drm/panel/panel-arm-versatile.c        |   2 +-
  drivers/gpu/drm/panel/panel-ilitek-ili9322.c       |   8 +-
  drivers/gpu/drm/panel/panel-lvds.c                 |   4 +-
  .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  |   2 +-
  drivers/gpu/drm/panel/panel-seiko-43wvf1g.c        |   4 +-
  drivers/gpu/drm/panel/panel-simple.c               |   4 +-
  drivers/gpu/drm/pl111/pl111_display.c              |   4 +-
  drivers/gpu/drm/radeon/radeon_connectors.c         |   4 +-
  drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   2 +-
  drivers/gpu/drm/sun4i/sun4i_tcon.c                 |   4 +-
  drivers/gpu/drm/tve200/tve200_display.c            |   2 +-
  drivers/gpu/drm/vc4/vc4_dpi.c                      |   4 +-
  include/drm/drm_connector.h                        | 123 ++++++++++++---------
  36 files changed, 125 insertions(+), 106 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
index 74d2efaec52f..1ba72dc2a85b 100644
@@ -1927,7 +1927,7 @@ amdgpu_connector_add(struct amdgpu_device *adev,
  	} else
  		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
  	drm_connector_register(connector);
 
  	if (has_aux)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +1 -1
index 120dd3b26fc2..7e9f7f1ab1b1 100644
@@ -639,7 +639,7 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
  	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
  			   DRM_MODE_CONNECTOR_VIRTUAL);
  	drm_connector_helper_add(connector, &dce_virtual_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
  	drm_connector_register(connector);
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
index d73281095fac..2d18c8ef22a0 100644
@@ -238,7 +238,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state)
  	crtc = drm_crtc_to_atmel_hlcdc_crtc(state->crtc);
 
  	for_each_new_connector_in_state(state->state, connector, cstate, i) {
-		struct drm_display_info *info = &connector->display_info;
+		struct drm_static_display_info *info = &connector->static_display_info;
  		unsigned int supported_fmts = 0;
  		int j;
 
drivers/gpu/drm/bridge/sii902x.c +1 -1
index b1ab4ab09532..abd0bce9c31e 100644
@@ -174,7 +174,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
  		kfree(edid);
  	}
 
-	ret = drm_display_info_set_bus_formats(&connector->display_info,
+	ret = drm_display_info_set_bus_formats(&connector->static_display_info,
  					       &bus_format, 1);
  	if (ret)
  		return ret;
drivers/gpu/drm/bridge/tc358767.c +1 -1
index 08ab7d6aea65..042ded9ca749 100644
@@ -1193,7 +1193,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
  	if (tc->panel)
  		drm_panel_attach(tc->panel, &tc->connector);
 
-	drm_display_info_set_bus_formats(&tc->connector.display_info,
+	drm_display_info_set_bus_formats(&tc->connector.static_display_info,
  					 &bus_format, 1);
  	drm_mode_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
 
drivers/gpu/drm/drm_connector.c +6 -6
index b3cde897cd80..d73e97ed7dff 100644
@@ -237,7 +237,7 @@ int drm_connector_init(struct drm_device *dev,
  	mutex_init(&connector->mutex);
  	connector->edid_blob_ptr = NULL;
  	connector->status = connector_status_unknown;
-	connector->display_info.panel_orientation =
+	connector->static_display_info.panel_orientation =
  		DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
 
  	drm_connector_get_cmdline_mode(connector);
@@ -366,7 +366,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
  	ida_simple_remove(&dev->mode_config.connector_ida,
  			  connector->index);
 
-	kfree(connector->display_info.bus_formats);
+	kfree(connector->static_display_info.bus_formats);
  	drm_mode_object_unregister(dev, &connector->base);
  	kfree(connector->name);
  	connector->name = NULL;
@@ -674,7 +674,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
 
  /**
   * drm_display_info_set_bus_formats - set the supported bus formats
- * @info: display info to store bus formats in
+ * @info: fixed display info to store bus formats in
   * @formats: array containing the supported bus formats
   * @num_formats: the number of entries in the fmts array
   *
@@ -682,7 +682,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
   * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
   * a full list of available formats.
   */
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
  				     const u32 *formats,
  				     unsigned int num_formats)
  {
@@ -1460,7 +1460,7 @@ int drm_connector_init_panel_orientation_property(
  	struct drm_connector *connector, int width, int height)
  {
  	struct drm_device *dev = connector->dev;
-	struct drm_display_info *info = &connector->display_info;
+	struct drm_static_display_info *info = &connector->static_display_info;
  	struct drm_property *prop;
  	int orientation_quirk;
 
@@ -1602,7 +1602,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
  	out_resp->mm_width = connector->display_info.width_mm;
  	out_resp->mm_height = connector->display_info.height_mm;
-	out_resp->subpixel = connector->display_info.subpixel_order;
+	out_resp->subpixel = connector->static_display_info.subpixel_order;
  	out_resp->connection = connector->status;
 
  	/* delayed so we get modes regardless of pre-fill_modes state */
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 035784ddd133..18cb63b30e33 100644
@@ -2433,7 +2433,7 @@ static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
 
  	fb_crtc->rotation = DRM_MODE_ROTATE_0;
 
-	switch (connector->display_info.panel_orientation) {
+	switch (connector->static_display_info.panel_orientation) {
  	case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
  		rotation = DRM_MODE_ROTATE_180;
  		break;
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +1 -1
index 0e3752437e44..2444c14639ef 100644
@@ -99,7 +99,7 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
  	vsw = mode->vsync_end - mode->vsync_start;
 
  	/* INV_PXCK as default (most display sample data on rising edge) */
-	if (!(con->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
+	if (!(con->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
  		pol |= DCU_SYN_POL_INV_PXCK;
 
  	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -1
index 563f193fcfac..6d608ce26076 100644
@@ -322,7 +322,7 @@ void cdv_hdmi_init(struct drm_device *dev,
  	drm_encoder_helper_add(encoder, &cdv_hdmi_helper_funcs);
  	drm_connector_helper_add(connector,
  				 &cdv_hdmi_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/cdv_intel_lvds.c +1 -1
index e64960db3224..290221f73cbf 100644
@@ -637,7 +637,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
  	drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
  	drm_connector_helper_add(connector,
  				 &cdv_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/mdfld_dsi_output.c +1 -1
index 41e7f25ba7e0..605c86ded14f 100644
@@ -555,7 +555,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
  						DRM_MODE_CONNECTOR_LVDS);
  	drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
index 8b2eb32ee988..c4e16ab25d1a 100644
@@ -661,7 +661,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
  	drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
  	drm_connector_helper_add(connector, &oaktrail_hdmi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
  	drm_connector_register(connector);
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -1
index e6943fef0611..4b8d2b6e7202 100644
@@ -331,7 +331,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
  	drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
  	drm_connector_helper_add(connector,
  				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_lvds.c +1 -1
index be3eefec5152..fe4667eba85f 100644
@@ -706,7 +706,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
  	drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
  	drm_connector_helper_add(connector,
  				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
index 84507912be84..3b31dde4c05a 100644
@@ -2016,7 +2016,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
 
  	connector->base.base.interlace_allowed = 0;
  	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
 
  	connector->base.save = psb_intel_sdvo_save;
  	connector->base.restore = psb_intel_sdvo_restore;
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 33fbf3965309..ed36b4e6e4ae 100644
@@ -2972,7 +2972,7 @@ static void intel_connector_info(struct seq_file *m,
  			   connector->display_info.width_mm,
  			   connector->display_info.height_mm);
  		seq_printf(m, "\tsubpixel order: %s\n",
-			   drm_get_subpixel_order_name(connector->display_info.subpixel_order));
+			   drm_get_subpixel_order_name(connector->static_display_info.subpixel_order));
  		seq_printf(m, "\tCEA rev: %d\n",
  			   connector->display_info.cea_rev);
  	}
drivers/gpu/drm/i915/intel_dsi.c +2 -2
index c8cf3d5c7783..3eaf9bb8498d 100644
@@ -1702,7 +1702,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
 
  		connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
 
-		connector->base.display_info.panel_orientation =
+		connector->base.static_display_info.panel_orientation =
  			intel_dsi_get_panel_orientation(connector);
  		drm_connector_init_panel_orientation_property(
  				&connector->base,
@@ -1826,7 +1826,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 
  	drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_dvo.c +1 -1
index eb0c559b2715..68fe4587441f 100644
@@ -520,7 +520,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
 
  		drm_connector_helper_add(connector,
  					 &intel_dvo_connector_helper_funcs);
-		connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+		connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  		connector->interlace_allowed = false;
  		connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_lvds.c +1 -1
index cdae4934b885..c35f84642c79 100644
@@ -1050,7 +1050,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
  		intel_encoder->crtc_mask = (1 << 1);
 
  	drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->interlace_allowed = false;
  	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
index 0c14d1c04cbd..6309a1d9f87e 100644
@@ -2440,7 +2440,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
 
  	connector->base.base.interlace_allowed = 1;
  	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
  	connector->base.get_hw_state = intel_sdvo_connector_get_hw_state;
 
  	intel_connector_attach_encoder(&connector->base, &encoder->base);
drivers/gpu/drm/imx/imx-ldb.c +2 -2
index 56dd7a9a8e25..4909fe89e167 100644
@@ -299,7 +299,7 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder,
 
  	if (!bus_format) {
  		struct drm_connector *connector = connector_state->connector;
-		struct drm_display_info *di = &connector->display_info;
+		struct drm_static_display_info *di = &connector->static_display_info;
 
  		if (di->num_bus_formats)
  			bus_format = di->bus_formats[0];
@@ -358,7 +358,7 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
  {
  	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
  	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
  	u32 bus_format = imx_ldb_ch->bus_format;
 
  	/* Bus format description in DT overrides connector display info. */
drivers/gpu/drm/imx/parallel-display.c +1 -1
index aedecda9728a..2aa80484a39d 100644
@@ -118,7 +118,7 @@ static int imx_pd_encoder_atomic_check(struct drm_encoder *encoder,
  				       struct drm_connector_state *conn_state)
  {
  	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
  	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
  	if (!imxpd->bus_format && di->num_bus_formats) {
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +3 -3
index 0abe77675b76..0429006288d6 100644
@@ -101,8 +101,8 @@ static void mxsfb_set_bus_fmt(struct mxsfb_drm_private *mxsfb)
 
  	reg = readl(mxsfb->base + LCDC_CTRL);
 
-	if (mxsfb->connector.display_info.num_bus_formats)
-		bus_format = mxsfb->connector.display_info.bus_formats[0];
+	if (mxsfb->connector.static_display_info.num_bus_formats)
+		bus_format = mxsfb->connector.static_display_info.bus_formats[0];
 
  	reg &= ~CTRL_BUS_WIDTH_MASK;
  	switch (bus_format) {
@@ -199,7 +199,7 @@ static int mxsfb_reset_block(void __iomem *reset_addr)
  static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
  {
  	struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
-	const u32 bus_flags = mxsfb->connector.display_info.bus_flags;
+	const u32 bus_flags = mxsfb->connector.static_display_info.bus_flags;
  	u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
  	int err;
 
drivers/gpu/drm/panel/panel-arm-versatile.c +1 -1
index b428c4678106..25958bc4c5ca 100644
@@ -268,7 +268,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel)
  		DRM_DISPLAY_INFO_LEN);
  	connector->display_info.width_mm = vpanel->panel_type->width_mm;
  	connector->display_info.height_mm = vpanel->panel_type->height_mm;
-	connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
+	connector->static_display_info.bus_flags = vpanel->panel_type->bus_flags;
 
  	mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode);
  	drm_mode_set_name(mode);
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +4 -4
index b4ec0ecff807..1ba893942a2b 100644
@@ -411,19 +411,19 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
  	 */
  	if (ili->conf->dclk_active_high) {
  		reg = ILI9322_POL_DCLK;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
  			DRM_BUS_FLAG_PIXDATA_POSEDGE;
  	} else {
  		reg = 0;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
  			DRM_BUS_FLAG_PIXDATA_NEGEDGE;
  	}
  	if (ili->conf->de_active_high) {
  		reg |= ILI9322_POL_DE;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
  			DRM_BUS_FLAG_DE_HIGH;
  	} else {
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
  			DRM_BUS_FLAG_DE_LOW;
  	}
  	if (ili->conf->hsync_active_high)
drivers/gpu/drm/panel/panel-lvds.c +2 -2
index b5e3994f0aa8..b52095666bda 100644
@@ -127,9 +127,9 @@ static int panel_lvds_get_modes(struct drm_panel *panel)
 
  	connector->display_info.width_mm = lvds->width;
  	connector->display_info.height_mm = lvds->height;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
  					 &lvds->bus_format, 1);
-	connector->display_info.bus_flags = lvds->data_mirror
+	connector->static_display_info.bus_flags = lvds->data_mirror
  					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
  					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
 
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +1 -1
index d964d454e4ae..9526461c0eb3 100644
@@ -356,7 +356,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel)
  	connector->display_info.bpc = 8;
  	connector->display_info.width_mm = 154;
  	connector->display_info.height_mm = 86;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
  					 &bus_format, 1);
 
  	return num;
drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +2 -2
index 71c09ed436ae..ffa9d1b6f863 100644
@@ -115,9 +115,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel)
  	connector->display_info.width_mm = panel->desc->size.width;
  	connector->display_info.height_mm = panel->desc->size.height;
  	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
  						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
  	return num;
  }
drivers/gpu/drm/panel/panel-simple.c +2 -2
index 5591984a392b..ba3f85b7338f 100644
@@ -152,9 +152,9 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
  	connector->display_info.width_mm = panel->desc->size.width;
  	connector->display_info.height_mm = panel->desc->size.height;
  	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
  						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
  	return num;
  }
drivers/gpu/drm/pl111/pl111_display.c +2 -2
index 5b8368c76734..affd050ee409 100644
@@ -148,10 +148,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
  		tim2 |= TIM2_IVS;
 
  	if (connector) {
-		if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+		if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
  			tim2 |= TIM2_IOE;
 
-		if (connector->display_info.bus_flags &
+		if (connector->static_display_info.bus_flags &
  		    DRM_BUS_FLAG_PIXDATA_NEGEDGE)
  			tim2 |= TIM2_IPC;
  	}
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
index 2e2ca3c6b47d..c8a0f856f84e 100644
@@ -2363,7 +2363,7 @@ radeon_add_atom_connector(struct drm_device *dev,
  	} else
  		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
  	drm_connector_register(connector);
 
  	if (has_aux)
@@ -2526,7 +2526,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
  	} else
  		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
  	drm_connector_register(connector);
  }
 
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +1 -1
index ba8d2804c1d1..72723a80b1e3 100644
@@ -102,7 +102,7 @@ static void rcar_du_encoder_mode_set(struct drm_encoder *encoder,
  				     struct drm_connector_state *conn_state)
  {
  	struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
-	struct drm_display_info *info = &conn_state->connector->display_info;
+	struct drm_static_display_info *info = &conn_state->connector->static_display_info;
  	enum rcar_lvds_mode mode;
 
  	rcar_du_crtc_route_output(crtc_state->crtc, renc->output);
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -2
index 1d714c06ec9d..d20a876ba4c6 100644
@@ -55,13 +55,13 @@ static struct drm_connector *sun4i_tcon_get_connector(const struct drm_encoder *
  static int sun4i_tcon_get_pixel_depth(const struct drm_encoder *encoder)
  {
  	struct drm_connector *connector;
-	struct drm_display_info *info;
+	struct drm_static_display_info *info;
 
  	connector = sun4i_tcon_get_connector(encoder);
  	if (!connector)
  		return -EINVAL;
 
-	info = &connector->display_info;
+	info = &connector->static_display_info;
  	if (info->num_bus_formats != 1)
  		return -EINVAL;
 
drivers/gpu/drm/tve200/tve200_display.c +1 -1
index db397fcb345a..aa805e2bc0fe 100644
@@ -148,7 +148,7 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
  	/* Vsync IRQ at start of Vsync at first */
  	ctrl1 |= TVE200_VSTSTYPE_VSYNC;
 
-	if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
+	if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
  		ctrl1 |= TVE200_CTRL_TVCLKP;
 
  	if ((mode->hdisplay == 352 && mode->vdisplay == 240) || /* SIF(525) */
drivers/gpu/drm/vc4/vc4_dpi.c +2 -2
index 72c9dbd81d7f..a757a2670353 100644
@@ -170,8 +170,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
  	u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE;
  	int ret;
 
-	if (dpi->connector->display_info.num_bus_formats) {
-		u32 bus_format = dpi->connector->display_info.bus_formats[0];
+	if (dpi->connector->static_display_info.num_bus_formats) {
+		u32 bus_format = dpi->connector->static_display_info.bus_formats[0];
 
  		switch (bus_format) {
  		case MEDIA_BUS_FMT_RGB888_1X24:
include/drm/drm_connector.h +68 -52
index 675cc3f8cf85..aad3258facf2 100644
@@ -177,7 +177,7 @@ enum drm_link_status {
  };
 
  /**
- * enum drm_panel_orientation - panel_orientation info for &drm_display_info
+ * enum drm_panel_orientation - panel_orientation info for &drm_static_display_info
   *
   * This enum is used to track the (LCD) panel orientation. There are no
   * separate #defines for the uapi!
@@ -206,14 +206,67 @@ enum drm_panel_orientation {
  };
 
  /**
- * struct drm_display_info - runtime data about the connected sink
+ * struct drm_static_display_info - data about the connected sink
+ *
+ * Static data (as in not parsed from EDID) about the connected sink.
+ * This will not be reset once set, so drivers can safely populate this
+ * at connector init time. They can also adjust it dynamically as long
+ * as the don't leave stale garbage behind.
+ */
+struct drm_static_display_info {
+	/**
+	 * @subpixel_order: Subpixel order of LCD panels.
+	 */
+	enum subpixel_order subpixel_order;
+
+	/**
+	 * @panel_orientation: Read only connector property for built-in panels,
+	 * indicating the orientation of the panel vs the device's casing.
+	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
+	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
+	 * fb to compensate and gets exported as prop to userspace.
+	 */
+	int panel_orientation;
+
+	/**
+	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
+	 * @color_formats. Array of size @num_bus_formats encoded using
+	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
+	 */
+	const u32 *bus_formats;
+	/**
+	 * @num_bus_formats: Size of @bus_formats array.
+	 */
+	unsigned int num_bus_formats;
+
+#define DRM_BUS_FLAG_DE_LOW		(1<<0)
+#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
+/* drive data on pos. edge */
+#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
+/* drive data on neg. edge */
+#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
+/* data is transmitted MSB to LSB on the bus */
+#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
+/* data is transmitted LSB to MSB on the bus */
+#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
+
+	/**
+	 * @bus_flags: Additional information (like pixel signal polarity) for
+	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
+	 */
+	u32 bus_flags;
+};
+
+/**
+ * struct drm_display_info - Dynamic data about the connected sink
   *
   * Describes a given display (e.g. CRT or flat panel) and its limitations. For
   * fixed display sinks like built-in panels there's not much difference between
   * this and &struct drm_connector. But for sinks with a real cable this
   * structure is meant to describe all the things at the other end of the cable.
   *
- * For sinks which provide an EDID this can be filled out by calling
+ * This should be filled out by the connector .fill_modes()/.get_modes()
+ * hooks. For sinks which provide an EDID this can be filled out by calling
   * drm_add_edid_modes().
   */
  struct drm_display_info {
@@ -225,7 +278,7 @@ struct drm_display_info {
  	/**
  	 * @width_mm: Physical width in mm.
  	 */
-        unsigned int width_mm;
+	unsigned int width_mm;
  	/**
  	 * @height_mm: Physical height in mm.
  	 */
@@ -242,26 +295,12 @@ struct drm_display_info {
  	 */
  	unsigned int bpc;
 
-	/**
-	 * @subpixel_order: Subpixel order of LCD panels.
-	 */
-	enum subpixel_order subpixel_order;
-
  #define DRM_COLOR_FORMAT_RGB444		(1<<0)
  #define DRM_COLOR_FORMAT_YCRCB444	(1<<1)
  #define DRM_COLOR_FORMAT_YCRCB422	(1<<2)
  #define DRM_COLOR_FORMAT_YCRCB420	(1<<3)
 
  	/**
-	 * @panel_orientation: Read only connector property for built-in panels,
-	 * indicating the orientation of the panel vs the device's casing.
-	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
-	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
-	 * fb to compensate and gets exported as prop to userspace.
-	 */
-	int panel_orientation;
-
-	/**
  	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
  	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
  	 * as used to describe the pixel format in framebuffers, and also don't
@@ -270,34 +309,6 @@ struct drm_display_info {
  	u32 color_formats;
 
  	/**
-	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
-	 * @color_formats. Array of size @num_bus_formats encoded using
-	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
-	 */
-	const u32 *bus_formats;
-	/**
-	 * @num_bus_formats: Size of @bus_formats array.
-	 */
-	unsigned int num_bus_formats;
-
-#define DRM_BUS_FLAG_DE_LOW		(1<<0)
-#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
-/* drive data on pos. edge */
-#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
-/* drive data on neg. edge */
-#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
-/* data is transmitted MSB to LSB on the bus */
-#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
-/* data is transmitted LSB to MSB on the bus */
-#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
-
-	/**
-	 * @bus_flags: Additional information (like pixel signal polarity) for
-	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
-	 */
-	u32 bus_flags;
-
-	/**
  	 * @max_tmds_clock: Maximum TMDS clock rate supported by the
  	 * sink in kHz. 0 means undefined.
  	 */
@@ -335,7 +346,7 @@ struct drm_display_info {
  	bool non_desktop;
  };
 
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
  				     const u32 *formats,
  				     unsigned int num_formats);
 
@@ -851,15 +862,23 @@ struct drm_connector {
  	struct list_head probed_modes;
 
  	/**
-	 * @display_info: Display information is filled from EDID information
-	 * when a display is detected. For non hot-pluggable displays such as
-	 * flat panels in embedded systems, the driver should initialize the
-	 * &drm_display_info.width_mm and &drm_display_info.height_mm fields
-	 * with the physical size of the display.
+	 * @static_display_info: Display information is filled by the driver
+	 *
+	 * Protected by &drm_mode_config.mutex.
+	 */
+	struct drm_static_display_info static_display_info;
+	/**
+	 * @display_info: Dynamic display information is filled from EDID
+	 * information when a display is detected. For non hot-pluggable
+	 * displays such as flat panels in embedded systems, the driver
+	 * should initialize the &drm_display_info.width_mm and

include/drm/drm_connector.h struct drm_connector { · line 884

Quoted 10 lines
include/drm/drm_connector.h +3 -0
+	 * &drm_display_info.height_mm fields with the physical size of
+	 * the display.
  	 *
  	 * Protected by &drm_mode_config.mutex.
  	 */
  	struct drm_display_info display_info;
+
  	const struct drm_connector_funcs *funcs;
 
  	struct drm_property_blob *edid_blob_ptr;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Reviewed-by Acked-by on v1 4/11
#9 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 10 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Quoted 6 lines

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Back when I introduced bus flags it was meant to be a static information.

So for the general idea/drm_connector.h:

[...]

Quoted 1 line
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-

For fsl-dcu:

--
Stefan

Quoted 846 lines
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c            |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/mdfld_dsi_output.c          |   2 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi.c             |   2 +-
 drivers/gpu/drm/gma500/oaktrail_lvds.c             |   2 +-
 drivers/gpu/drm/gma500/psb_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/psb_intel_sdvo.c            |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |   2 +-
 drivers/gpu/drm/i915/intel_dsi.c                   |   4 +-
 drivers/gpu/drm/i915/intel_dvo.c                   |   2 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |   2 +-
 drivers/gpu/drm/i915/intel_sdvo.c                  |   2 +-
 drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
 drivers/gpu/drm/imx/parallel-display.c             |   2 +-
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |   6 +-
 drivers/gpu/drm/panel/panel-arm-versatile.c        |   2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c       |   8 +-
 drivers/gpu/drm/panel/panel-lvds.c                 |   4 +-
 .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  |   2 +-
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c        |   4 +-
 drivers/gpu/drm/panel/panel-simple.c               |   4 +-
 drivers/gpu/drm/pl111/pl111_display.c              |   4 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   2 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |   4 +-
 drivers/gpu/drm/tve200/tve200_display.c            |   2 +-
 drivers/gpu/drm/vc4/vc4_dpi.c                      |   4 +-
 include/drm/drm_connector.h                        | 123 ++++++++++++---------
 36 files changed, 125 insertions(+), 106 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
index 74d2efaec52f..1ba72dc2a85b 100644
@@ -1927,7 +1927,7 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +1 -1
index 120dd3b26fc2..7e9f7f1ab1b1 100644
@@ -639,7 +639,7 @@ static int
 dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
 			   DRM_MODE_CONNECTOR_VIRTUAL);
 	drm_connector_helper_add(connector, &dce_virtual_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +0 -0
 	drm_connector_register(connector);
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
index d73281095fac..2d18c8ef22a0 100644
@@ -238,7 +238,7 @@ static int
 atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state)
 	crtc = drm_crtc_to_atmel_hlcdc_crtc(state->crtc);
 
 	for_each_new_connector_in_state(state->state, connector, cstate, i) {
-		struct drm_display_info *info = &connector->display_info;
+		struct drm_static_display_info *info = &connector->static_display_info;
 		unsigned int supported_fmts = 0;
 		int j;
drivers/gpu/drm/bridge/sii902x.c +1 -1
index b1ab4ab09532..abd0bce9c31e 100644
@@ -174,7 +174,7 @@ static int sii902x_get_modes(struct drm_connector
 *connector)
 		kfree(edid);
 	}
 
-	ret = drm_display_info_set_bus_formats(&connector->display_info,
+	ret = drm_display_info_set_bus_formats(&connector->static_display_info,
 					       &bus_format, 1);
 	if (ret)
drivers/gpu/drm/bridge/sii902x.c +0 -0
 		return ret;
drivers/gpu/drm/bridge/tc358767.c +1 -1
index 08ab7d6aea65..042ded9ca749 100644
@@ -1193,7 +1193,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
 	if (tc->panel)
 		drm_panel_attach(tc->panel, &tc->connector);
 
-	drm_display_info_set_bus_formats(&tc->connector.display_info,
+	drm_display_info_set_bus_formats(&tc->connector.static_display_info,
 					 &bus_format, 1);
 	drm_mode_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
 
drivers/gpu/drm/drm_connector.c +3 -3
index b3cde897cd80..d73e97ed7dff 100644
@@ -237,7 +237,7 @@ int drm_connector_init(struct drm_device *dev,
 	mutex_init(&connector->mutex);
 	connector->edid_blob_ptr = NULL;
 	connector->status = connector_status_unknown;
-	connector->display_info.panel_orientation =
+	connector->static_display_info.panel_orientation =
 		DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
 
 	drm_connector_get_cmdline_mode(connector);
@@ -366,7 +366,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 	ida_simple_remove(&dev->mode_config.connector_ida,
 			  connector->index);
 
-	kfree(connector->display_info.bus_formats);
+	kfree(connector->static_display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
 	kfree(connector->name);
 	connector->name = NULL;
@@ -674,7 +674,7 @@ static const struct drm_prop_enum_list
 drm_link_status_enum_list[] = {
 
 /**
  * drm_display_info_set_bus_formats - set the supported bus formats
- * @info: display info to store bus formats in
+ * @info: fixed display info to store bus formats in
  * @formats: array containing the supported bus formats
  * @num_formats: the number of entries in the fmts array

*

drivers/gpu/drm/drm_connector.c +1 -1
@@ -682,7 +682,7 @@ static const struct drm_prop_enum_list
 drm_link_status_enum_list[] = {
  * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
  * a full list of available formats.
  */
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
 				     const u32 *formats,
 				     unsigned int num_formats)

{

drivers/gpu/drm/drm_connector.c +2 -2
@@ -1460,7 +1460,7 @@ int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_display_info *info = &connector->display_info;
+	struct drm_static_display_info *info = &connector->static_display_info;
 	struct drm_property *prop;
 	int orientation_quirk;
 
@@ -1602,7 +1602,7 @@ int drm_mode_getconnector(struct drm_device
 *dev, void *data,
 
 	out_resp->mm_width = connector->display_info.width_mm;
 	out_resp->mm_height = connector->display_info.height_mm;
-	out_resp->subpixel = connector->display_info.subpixel_order;
+	out_resp->subpixel = connector->static_display_info.subpixel_order;
 	out_resp->connection = connector->status;
 
drivers/gpu/drm/drm_connector.c +0 -0
 	/* delayed so we get modes regardless of pre-fill_modes state */
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 035784ddd133..18cb63b30e33 100644
@@ -2433,7 +2433,7 @@ static void drm_setup_crtc_rotation(struct
 drm_fb_helper *fb_helper,
 
 	fb_crtc->rotation = DRM_MODE_ROTATE_0;
 
-	switch (connector->display_info.panel_orientation) {
+	switch (connector->static_display_info.panel_orientation) {
 	case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
 		rotation = DRM_MODE_ROTATE_180;
drivers/gpu/drm/drm_fb_helper.c +0 -0
 		break;
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +1 -1
index 0e3752437e44..2444c14639ef 100644
@@ -99,7 +99,7 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct
 drm_crtc *crtc)
 	vsw = mode->vsync_end - mode->vsync_start;
 
 	/* INV_PXCK as default (most display sample data on rising edge) */
-	if (!(con->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
+	if (!(con->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
 		pol |= DCU_SYN_POL_INV_PXCK;
 
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +0 -0
 	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -1
index 563f193fcfac..6d608ce26076 100644
@@ -322,7 +322,7 @@ void cdv_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_hdmi_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_hdmi_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/cdv_intel_lvds.c +1 -1
index e64960db3224..290221f73cbf 100644
@@ -637,7 +637,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/mdfld_dsi_output.c +1 -1
index 41e7f25ba7e0..605c86ded14f 100644
@@ -555,7 +555,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 						DRM_MODE_CONNECTOR_LVDS);
 	drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
index 8b2eb32ee988..c4e16ab25d1a 100644
@@ -661,7 +661,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
 	drm_connector_helper_add(connector, &oaktrail_hdmi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 	drm_connector_register(connector);
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -1
index e6943fef0611..4b8d2b6e7202 100644
@@ -331,7 +331,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_lvds.c +1 -1
index be3eefec5152..fe4667eba85f 100644
@@ -706,7 +706,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
index 84507912be84..3b31dde4c05a 100644
@@ -2016,7 +2016,7 @@ psb_intel_sdvo_connector_init(struct
 psb_intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 0;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order =
 SubPixelHorizontalRGB;
 
drivers/gpu/drm/gma500/psb_intel_sdvo.c +0 -0
 	connector->base.save = psb_intel_sdvo_save;
 	connector->base.restore = psb_intel_sdvo_restore;
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 33fbf3965309..ed36b4e6e4ae 100644
@@ -2972,7 +2972,7 @@ static void intel_connector_info(struct seq_file *m,
 			   connector->display_info.width_mm,
 			   connector->display_info.height_mm);
 		seq_printf(m, "\tsubpixel order: %s\n",
-			   drm_get_subpixel_order_name(connector->display_info.subpixel_order));
+			  
 drm_get_subpixel_order_name(connector->static_display_info.subpixel_order));
 		seq_printf(m, "\tCEA rev: %d\n",
 			   connector->display_info.cea_rev);
drivers/gpu/drm/i915/i915_debugfs.c +0 -0
 	}
drivers/gpu/drm/i915/intel_dsi.c +1 -1
index c8cf3d5c7783..3eaf9bb8498d 100644
@@ -1702,7 +1702,7 @@ static void intel_dsi_add_properties(struct
 intel_connector *connector)
 
 		connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
 
-		connector->base.display_info.panel_orientation =
+		connector->base.static_display_info.panel_orientation =
 			intel_dsi_get_panel_orientation(connector);
 		drm_connector_init_panel_orientation_property(
drivers/gpu/drm/i915/intel_dsi.c +1 -1
 				&connector->base,
@@ -1826,7 +1826,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 
 	drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_dvo.c +1 -1
index eb0c559b2715..68fe4587441f 100644
@@ -520,7 +520,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
 
 		drm_connector_helper_add(connector,
 					 &intel_dvo_connector_helper_funcs);
-		connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+		connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 		connector->interlace_allowed = false;
 		connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_lvds.c +1 -1
index cdae4934b885..c35f84642c79 100644
@@ -1050,7 +1050,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
 		intel_encoder->crtc_mask = (1 << 1);
 
 	drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
index 0c14d1c04cbd..6309a1d9f87e 100644
@@ -2440,7 +2440,7 @@ intel_sdvo_connector_init(struct
 intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 1;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order =
 SubPixelHorizontalRGB;
 	connector->base.get_hw_state = intel_sdvo_connector_get_hw_state;
drivers/gpu/drm/i915/intel_sdvo.c +0 -0
 	intel_connector_attach_encoder(&connector->base, &encoder->base);
drivers/gpu/drm/imx/imx-ldb.c +2 -2
index 56dd7a9a8e25..4909fe89e167 100644
@@ -299,7 +299,7 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder,
 
 	if (!bus_format) {
 		struct drm_connector *connector = connector_state->connector;
-		struct drm_display_info *di = &connector->display_info;
+		struct drm_static_display_info *di = &connector->static_display_info;
 
 		if (di->num_bus_formats)
 			bus_format = di->bus_formats[0];
@@ -358,7 +358,7 @@ static int imx_ldb_encoder_atomic_check(struct
 drm_encoder *encoder,
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
 	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di =
 &conn_state->connector->static_display_info;
 	u32 bus_format = imx_ldb_ch->bus_format;
drivers/gpu/drm/imx/imx-ldb.c +0 -0
 	/* Bus format description in DT overrides connector display info. */
drivers/gpu/drm/imx/parallel-display.c +1 -1
index aedecda9728a..2aa80484a39d 100644
@@ -118,7 +118,7 @@ static int imx_pd_encoder_atomic_check(struct
 drm_encoder *encoder,
 				       struct drm_connector_state *conn_state)
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di =
 &conn_state->connector->static_display_info;
 	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
drivers/gpu/drm/imx/parallel-display.c +0 -0
 	if (!imxpd->bus_format && di->num_bus_formats) {
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +2 -2
index 0abe77675b76..0429006288d6 100644
@@ -101,8 +101,8 @@ static void mxsfb_set_bus_fmt(struct
 mxsfb_drm_private *mxsfb)
 
 	reg = readl(mxsfb->base + LCDC_CTRL);
 
-	if (mxsfb->connector.display_info.num_bus_formats)
-		bus_format = mxsfb->connector.display_info.bus_formats[0];
+	if (mxsfb->connector.static_display_info.num_bus_formats)
+		bus_format = mxsfb->connector.static_display_info.bus_formats[0];
 
 	reg &= ~CTRL_BUS_WIDTH_MASK;
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +1 -1
 	switch (bus_format) {
@@ -199,7 +199,7 @@ static int mxsfb_reset_block(void __iomem *reset_addr)
 static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
 {
 	struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
-	const u32 bus_flags = mxsfb->connector.display_info.bus_flags;
+	const u32 bus_flags = mxsfb->connector.static_display_info.bus_flags;
 	u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
 	int err;
 
drivers/gpu/drm/panel/panel-arm-versatile.c +1 -1
index b428c4678106..25958bc4c5ca 100644
@@ -268,7 +268,7 @@ static int versatile_panel_get_modes(struct
 drm_panel *panel)
 		DRM_DISPLAY_INFO_LEN);
 	connector->display_info.width_mm = vpanel->panel_type->width_mm;
 	connector->display_info.height_mm = vpanel->panel_type->height_mm;
-	connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
+	connector->static_display_info.bus_flags = vpanel->panel_type->bus_flags;
 
 	mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode);
drivers/gpu/drm/panel/panel-arm-versatile.c +0 -0
 	drm_mode_set_name(mode);
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +4 -4
index b4ec0ecff807..1ba893942a2b 100644
@@ -411,19 +411,19 @@ static int ili9322_init(struct drm_panel *panel,
 struct ili9322 *ili)
 	 */
 	if (ili->conf->dclk_active_high) {
 		reg = ILI9322_POL_DCLK;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_POSEDGE;
 	} else {
 		reg = 0;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_NEGEDGE;
 	}
 	if (ili->conf->de_active_high) {
 		reg |= ILI9322_POL_DE;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_HIGH;
 	} else {
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_LOW;
 	}
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +0 -0
 	if (ili->conf->hsync_active_high)
drivers/gpu/drm/panel/panel-lvds.c +2 -2
index b5e3994f0aa8..b52095666bda 100644
@@ -127,9 +127,9 @@ static int panel_lvds_get_modes(struct drm_panel *panel)
 
 	connector->display_info.width_mm = lvds->width;
 	connector->display_info.height_mm = lvds->height;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &lvds->bus_format, 1);
-	connector->display_info.bus_flags = lvds->data_mirror
+	connector->static_display_info.bus_flags = lvds->data_mirror
 					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
 					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
 
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +1 -1
index d964d454e4ae..9526461c0eb3 100644
@@ -356,7 +356,7 @@ static int rpi_touchscreen_get_modes(struct
 drm_panel *panel)
 	connector->display_info.bpc = 8;
 	connector->display_info.width_mm = 154;
 	connector->display_info.height_mm = 86;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &bus_format, 1);
 
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +0 -0
 	return num;
drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +2 -2
index 71c09ed436ae..ffa9d1b6f863 100644
@@ -115,9 +115,9 @@ static int seiko_panel_get_fixed_modes(struct
 seiko_panel *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;

}

drivers/gpu/drm/panel/panel-simple.c +2 -2
index 5591984a392b..ba3f85b7338f 100644
@@ -152,9 +152,9 @@ static int panel_simple_get_fixed_modes(struct
 panel_simple *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;

}

drivers/gpu/drm/pl111/pl111_display.c +2 -2
index 5b8368c76734..affd050ee409 100644
@@ -148,10 +148,10 @@ static void pl111_display_enable(struct
 drm_simple_display_pipe *pipe,
 		tim2 |= TIM2_IVS;
 
 	if (connector) {
-		if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+		if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
 			tim2 |= TIM2_IOE;
 
-		if (connector->display_info.bus_flags &
+		if (connector->static_display_info.bus_flags &
 		    DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 			tim2 |= TIM2_IPC;
drivers/gpu/drm/pl111/pl111_display.c +0 -0
 	}
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
index 2e2ca3c6b47d..c8a0f856f84e 100644
@@ -2363,7 +2363,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
@@ -2526,7 +2526,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 }
 
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +1 -1
index ba8d2804c1d1..72723a80b1e3 100644
@@ -102,7 +102,7 @@ static void rcar_du_encoder_mode_set(struct
 drm_encoder *encoder,
 				     struct drm_connector_state *conn_state)
 {
 	struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
-	struct drm_display_info *info = &conn_state->connector->display_info;
+	struct drm_static_display_info *info =
 &conn_state->connector->static_display_info;
 	enum rcar_lvds_mode mode;
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +0 -0
 	rcar_du_crtc_route_output(crtc_state->crtc, renc->output);
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -2
index 1d714c06ec9d..d20a876ba4c6 100644
@@ -55,13 +55,13 @@ static struct drm_connector
 *sun4i_tcon_get_connector(const struct drm_encoder *
 static int sun4i_tcon_get_pixel_depth(const struct drm_encoder *encoder)
 {
 	struct drm_connector *connector;
-	struct drm_display_info *info;
+	struct drm_static_display_info *info;
 
 	connector = sun4i_tcon_get_connector(encoder);
 	if (!connector)
 		return -EINVAL;
 
-	info = &connector->display_info;
+	info = &connector->static_display_info;
 	if (info->num_bus_formats != 1)
 		return -EINVAL;
drivers/gpu/drm/tve200/tve200_display.c +1 -1
index db397fcb345a..aa805e2bc0fe 100644
@@ -148,7 +148,7 @@ static void tve200_display_enable(struct
 drm_simple_display_pipe *pipe,
 	/* Vsync IRQ at start of Vsync at first */
 	ctrl1 |= TVE200_VSTSTYPE_VSYNC;
 
-	if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
+	if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 		ctrl1 |= TVE200_CTRL_TVCLKP;
 
drivers/gpu/drm/tve200/tve200_display.c +0 -0
 	if ((mode->hdisplay == 352 && mode->vdisplay == 240) || /* SIF(525) */
drivers/gpu/drm/vc4/vc4_dpi.c +2 -2
index 72c9dbd81d7f..a757a2670353 100644
@@ -170,8 +170,8 @@ static void vc4_dpi_encoder_enable(struct
 drm_encoder *encoder)
 	u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE;
 	int ret;
 
-	if (dpi->connector->display_info.num_bus_formats) {
-		u32 bus_format = dpi->connector->display_info.bus_formats[0];
+	if (dpi->connector->static_display_info.num_bus_formats) {
+		u32 bus_format = dpi->connector->static_display_info.bus_formats[0];
 
 		switch (bus_format) {
drivers/gpu/drm/vc4/vc4_dpi.c +0 -0
 		case MEDIA_BUS_FMT_RGB888_1X24:
include/drm/drm_connector.h +1 -1
index 675cc3f8cf85..aad3258facf2 100644
@@ -177,7 +177,7 @@ enum drm_link_status {
 };
 
 /**
- * enum drm_panel_orientation - panel_orientation info for &drm_display_info
+ * enum drm_panel_orientation - panel_orientation info for

&drm_static_display_info
*
* This enum is used to track the (LCD) panel orientation. There are no
* separate #defines for the uapi!

include/drm/drm_connector.h +67 -51
@@ -206,14 +206,67 @@ enum drm_panel_orientation {
 };
 
 /**
- * struct drm_display_info - runtime data about the connected sink
+ * struct drm_static_display_info - data about the connected sink
+ *
+ * Static data (as in not parsed from EDID) about the connected sink.
+ * This will not be reset once set, so drivers can safely populate this
+ * at connector init time. They can also adjust it dynamically as long
+ * as the don't leave stale garbage behind.
+ */
+struct drm_static_display_info {
+	/**
+	 * @subpixel_order: Subpixel order of LCD panels.
+	 */
+	enum subpixel_order subpixel_order;
+
+	/**
+	 * @panel_orientation: Read only connector property for built-in panels,
+	 * indicating the orientation of the panel vs the device's casing.
+	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
+	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
+	 * fb to compensate and gets exported as prop to userspace.
+	 */
+	int panel_orientation;
+
+	/**
+	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
+	 * @color_formats. Array of size @num_bus_formats encoded using
+	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
+	 */
+	const u32 *bus_formats;
+	/**
+	 * @num_bus_formats: Size of @bus_formats array.
+	 */
+	unsigned int num_bus_formats;
+
+#define DRM_BUS_FLAG_DE_LOW		(1<<0)
+#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
+/* drive data on pos. edge */
+#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
+/* drive data on neg. edge */
+#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
+/* data is transmitted MSB to LSB on the bus */
+#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
+/* data is transmitted LSB to MSB on the bus */
+#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
+
+	/**
+	 * @bus_flags: Additional information (like pixel signal polarity) for
+	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
+	 */
+	u32 bus_flags;
+};
+
+/**
+ * struct drm_display_info - Dynamic data about the connected sink
  *
  * Describes a given display (e.g. CRT or flat panel) and its limitations. For
  * fixed display sinks like built-in panels there's not much difference between
  * this and &struct drm_connector. But for sinks with a real cable this
  * structure is meant to describe all the things at the other end of the cable.
  *
- * For sinks which provide an EDID this can be filled out by calling
+ * This should be filled out by the connector .fill_modes()/.get_modes()
+ * hooks. For sinks which provide an EDID this can be filled out by calling
  * drm_add_edid_modes().
  */
 struct drm_display_info {
@@ -225,7 +278,7 @@ struct drm_display_info {
 	/**
 	 * @width_mm: Physical width in mm.
 	 */
-        unsigned int width_mm;
+	unsigned int width_mm;
 	/**
 	 * @height_mm: Physical height in mm.
 	 */
@@ -242,26 +295,12 @@ struct drm_display_info {
 	 */
 	unsigned int bpc;
 
-	/**
-	 * @subpixel_order: Subpixel order of LCD panels.
-	 */
-	enum subpixel_order subpixel_order;
-
 #define DRM_COLOR_FORMAT_RGB444		(1<<0)
 #define DRM_COLOR_FORMAT_YCRCB444	(1<<1)
 #define DRM_COLOR_FORMAT_YCRCB422	(1<<2)
 #define DRM_COLOR_FORMAT_YCRCB420	(1<<3)
 
 	/**
-	 * @panel_orientation: Read only connector property for built-in panels,
-	 * indicating the orientation of the panel vs the device's casing.
-	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
-	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
-	 * fb to compensate and gets exported as prop to userspace.
-	 */
-	int panel_orientation;
-
-	/**
 	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
 	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
 	 * as used to describe the pixel format in framebuffers, and also don't
@@ -270,34 +309,6 @@ struct drm_display_info {
 	u32 color_formats;
 
 	/**
-	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
-	 * @color_formats. Array of size @num_bus_formats encoded using
-	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
-	 */
-	const u32 *bus_formats;
-	/**
-	 * @num_bus_formats: Size of @bus_formats array.
-	 */
-	unsigned int num_bus_formats;
-
-#define DRM_BUS_FLAG_DE_LOW		(1<<0)
-#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
-/* drive data on pos. edge */
-#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
-/* drive data on neg. edge */
-#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
-/* data is transmitted MSB to LSB on the bus */
-#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
-/* data is transmitted LSB to MSB on the bus */
-#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
-
-	/**
-	 * @bus_flags: Additional information (like pixel signal polarity) for
-	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
-	 */
-	u32 bus_flags;
-
-	/**
 	 * @max_tmds_clock: Maximum TMDS clock rate supported by the
 	 * sink in kHz. 0 means undefined.
 	 */
@@ -335,7 +346,7 @@ struct drm_display_info {
 	bool non_desktop;
 };
 
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
 				     const u32 *formats,
 				     unsigned int num_formats);
 
@@ -851,15 +862,23 @@ struct drm_connector {
 	struct list_head probed_modes;
 
 	/**
-	 * @display_info: Display information is filled from EDID information
-	 * when a display is detected. For non hot-pluggable displays such as
-	 * flat panels in embedded systems, the driver should initialize the
-	 * &drm_display_info.width_mm and &drm_display_info.height_mm fields
-	 * with the physical size of the display.
+	 * @static_display_info: Display information is filled by the driver
+	 *
+	 * Protected by &drm_mode_config.mutex.
+	 */
+	struct drm_static_display_info static_display_info;
+	/**
+	 * @display_info: Dynamic display information is filled from EDID
+	 * information when a display is detected. For non hot-pluggable
+	 * displays such as flat panels in embedded systems, the driver
+	 * should initialize the &drm_display_info.width_mm and

include/drm/drm_connector.h struct drm_connector { · line 884

Quoted 10 lines
include/drm/drm_connector.h +3 -0
+	 * &drm_display_info.height_mm fields with the physical size of
+	 * the display.
 	 *
 	 * Protected by &drm_mode_config.mutex.
 	 */
 	struct drm_display_info display_info;
+
 	const struct drm_connector_funcs *funcs;
 
 	struct drm_property_blob *edid_blob_ptr;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 4/11
#10 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 28 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Quoted 8 lines
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 4/11
#11 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 28 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Quoted 8 lines
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw

Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts

In reply to Ville Syrjala
Quoted 10 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Currently we have a mix of static and dynamic information stored in the display info structure. That makes it rather difficult to repopulate the dynamic parts when a new EDID appears. Let's make life easier by splitting the structure up into static and dynamic parts.

The static part will consist of subpixel_order, panel_orientation, and bus_formats.

Quoted 6 lines

Actually I'm not sure where bus_formats & co. fit in all this. For some drivers those seem to be static, even though they might fill them out from .get_modes(). For other drivers this stuff even gets frobbed at runtime, making it more some kind of a bastard encoder/connector state. I'll just stick it into the static side so that the behaviour doesn't change when I start clear out the entire dynamic state with memset().

If we go with my suggestion for the next patch to not reset display info for panels, then this problem disappears. Because all the stuff you identified as static is relevant for panels, and for panels _everything_ is static.

I think with the next patch changed per my suggestion you could drop this one here outright, and still retain all the benefits of your cleanup. -Daniel

Quoted 829 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Hans de Goede <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Philipp Zabel <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Manfred Schlaegl <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Archit Taneja <[email protected]>
Cc Andrzej Hajda <[email protected]>
Cc Alison Wang <[email protected]>
Cc Eric Anholt <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c     |   2 +-
 drivers/gpu/drm/amd/amdgpu/dce_virtual.c           |   2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c     |   2 +-
 drivers/gpu/drm/bridge/sii902x.c                   |   2 +-
 drivers/gpu/drm/bridge/tc358767.c                  |   2 +-
 drivers/gpu/drm/drm_connector.c                    |  12 +-
 drivers/gpu/drm/drm_fb_helper.c                    |   2 +-
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c            |   2 +-
 drivers/gpu/drm/gma500/cdv_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/mdfld_dsi_output.c          |   2 +-
 drivers/gpu/drm/gma500/oaktrail_hdmi.c             |   2 +-
 drivers/gpu/drm/gma500/oaktrail_lvds.c             |   2 +-
 drivers/gpu/drm/gma500/psb_intel_lvds.c            |   2 +-
 drivers/gpu/drm/gma500/psb_intel_sdvo.c            |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c                |   2 +-
 drivers/gpu/drm/i915/intel_dsi.c                   |   4 +-
 drivers/gpu/drm/i915/intel_dvo.c                   |   2 +-
 drivers/gpu/drm/i915/intel_lvds.c                  |   2 +-
 drivers/gpu/drm/i915/intel_sdvo.c                  |   2 +-
 drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
 drivers/gpu/drm/imx/parallel-display.c             |   2 +-
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c                 |   6 +-
 drivers/gpu/drm/panel/panel-arm-versatile.c        |   2 +-
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c       |   8 +-
 drivers/gpu/drm/panel/panel-lvds.c                 |   4 +-
 .../gpu/drm/panel/panel-raspberrypi-touchscreen.c  |   2 +-
 drivers/gpu/drm/panel/panel-seiko-43wvf1g.c        |   4 +-
 drivers/gpu/drm/panel/panel-simple.c               |   4 +-
 drivers/gpu/drm/pl111/pl111_display.c              |   4 +-
 drivers/gpu/drm/radeon/radeon_connectors.c         |   4 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          |   2 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |   4 +-
 drivers/gpu/drm/tve200/tve200_display.c            |   2 +-
 drivers/gpu/drm/vc4/vc4_dpi.c                      |   4 +-
 include/drm/drm_connector.h                        | 123 ++++++++++++---------
 36 files changed, 125 insertions(+), 106 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
index 74d2efaec52f..1ba72dc2a85b 100644
@@ -1927,7 +1927,7 @@ amdgpu_connector_add(struct amdgpu_device *adev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +1 -1
index 120dd3b26fc2..7e9f7f1ab1b1 100644
@@ -639,7 +639,7 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev,
 	drm_connector_init(adev->ddev, connector, &dce_virtual_connector_funcs,
 			   DRM_MODE_CONNECTOR_VIRTUAL);
 	drm_connector_helper_add(connector, &dce_virtual_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 	drm_connector_register(connector);
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +1 -1
index d73281095fac..2d18c8ef22a0 100644
@@ -238,7 +238,7 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state)
 	crtc = drm_crtc_to_atmel_hlcdc_crtc(state->crtc);
 
 	for_each_new_connector_in_state(state->state, connector, cstate, i) {
-		struct drm_display_info *info = &connector->display_info;
+		struct drm_static_display_info *info = &connector->static_display_info;
 		unsigned int supported_fmts = 0;
 		int j;
 
drivers/gpu/drm/bridge/sii902x.c +1 -1
index b1ab4ab09532..abd0bce9c31e 100644
@@ -174,7 +174,7 @@ static int sii902x_get_modes(struct drm_connector *connector)
 		kfree(edid);
 	}
 
-	ret = drm_display_info_set_bus_formats(&connector->display_info,
+	ret = drm_display_info_set_bus_formats(&connector->static_display_info,
 					       &bus_format, 1);
 	if (ret)
 		return ret;
drivers/gpu/drm/bridge/tc358767.c +1 -1
index 08ab7d6aea65..042ded9ca749 100644
@@ -1193,7 +1193,7 @@ static int tc_bridge_attach(struct drm_bridge *bridge)
 	if (tc->panel)
 		drm_panel_attach(tc->panel, &tc->connector);
 
-	drm_display_info_set_bus_formats(&tc->connector.display_info,
+	drm_display_info_set_bus_formats(&tc->connector.static_display_info,
 					 &bus_format, 1);
 	drm_mode_connector_attach_encoder(&tc->connector, tc->bridge.encoder);
 
drivers/gpu/drm/drm_connector.c +6 -6
index b3cde897cd80..d73e97ed7dff 100644
@@ -237,7 +237,7 @@ int drm_connector_init(struct drm_device *dev,
 	mutex_init(&connector->mutex);
 	connector->edid_blob_ptr = NULL;
 	connector->status = connector_status_unknown;
-	connector->display_info.panel_orientation =
+	connector->static_display_info.panel_orientation =
 		DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
 
 	drm_connector_get_cmdline_mode(connector);
@@ -366,7 +366,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 	ida_simple_remove(&dev->mode_config.connector_ida,
 			  connector->index);
 
-	kfree(connector->display_info.bus_formats);
+	kfree(connector->static_display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
 	kfree(connector->name);
 	connector->name = NULL;
@@ -674,7 +674,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
 
 /**
  * drm_display_info_set_bus_formats - set the supported bus formats
- * @info: display info to store bus formats in
+ * @info: fixed display info to store bus formats in
  * @formats: array containing the supported bus formats
  * @num_formats: the number of entries in the fmts array
  *
@@ -682,7 +682,7 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = {
  * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
  * a full list of available formats.
  */
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
 				     const u32 *formats,
 				     unsigned int num_formats)
 {
@@ -1460,7 +1460,7 @@ int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height)
 {
 	struct drm_device *dev = connector->dev;
-	struct drm_display_info *info = &connector->display_info;
+	struct drm_static_display_info *info = &connector->static_display_info;
 	struct drm_property *prop;
 	int orientation_quirk;
 
@@ -1602,7 +1602,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
 	out_resp->mm_width = connector->display_info.width_mm;
 	out_resp->mm_height = connector->display_info.height_mm;
-	out_resp->subpixel = connector->display_info.subpixel_order;
+	out_resp->subpixel = connector->static_display_info.subpixel_order;
 	out_resp->connection = connector->status;
 
 	/* delayed so we get modes regardless of pre-fill_modes state */
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 035784ddd133..18cb63b30e33 100644
@@ -2433,7 +2433,7 @@ static void drm_setup_crtc_rotation(struct drm_fb_helper *fb_helper,
 
 	fb_crtc->rotation = DRM_MODE_ROTATE_0;
 
-	switch (connector->display_info.panel_orientation) {
+	switch (connector->static_display_info.panel_orientation) {
 	case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
 		rotation = DRM_MODE_ROTATE_180;
 		break;
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c +1 -1
index 0e3752437e44..2444c14639ef 100644
@@ -99,7 +99,7 @@ static void fsl_dcu_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	vsw = mode->vsync_end - mode->vsync_start;
 
 	/* INV_PXCK as default (most display sample data on rising edge) */
-	if (!(con->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
+	if (!(con->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE))
 		pol |= DCU_SYN_POL_INV_PXCK;
 
 	if (mode->flags & DRM_MODE_FLAG_NHSYNC)
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -1
index 563f193fcfac..6d608ce26076 100644
@@ -322,7 +322,7 @@ void cdv_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_hdmi_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_hdmi_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/cdv_intel_lvds.c +1 -1
index e64960db3224..290221f73cbf 100644
@@ -637,7 +637,7 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &cdv_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &cdv_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/mdfld_dsi_output.c +1 -1
index 41e7f25ba7e0..605c86ded14f 100644
@@ -555,7 +555,7 @@ void mdfld_dsi_output_init(struct drm_device *dev,
 						DRM_MODE_CONNECTOR_LVDS);
 	drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/oaktrail_hdmi.c +1 -1
index 8b2eb32ee988..c4e16ab25d1a 100644
@@ -661,7 +661,7 @@ void oaktrail_hdmi_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_hdmi_helper_funcs);
 	drm_connector_helper_add(connector, &oaktrail_hdmi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 	drm_connector_register(connector);
drivers/gpu/drm/gma500/oaktrail_lvds.c +1 -1
index e6943fef0611..4b8d2b6e7202 100644
@@ -331,7 +331,7 @@ void oaktrail_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &oaktrail_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_lvds.c +1 -1
index be3eefec5152..fe4667eba85f 100644
@@ -706,7 +706,7 @@ void psb_intel_lvds_init(struct drm_device *dev,
 	drm_encoder_helper_add(encoder, &psb_intel_lvds_helper_funcs);
 	drm_connector_helper_add(connector,
 				 &psb_intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
index 84507912be84..3b31dde4c05a 100644
@@ -2016,7 +2016,7 @@ psb_intel_sdvo_connector_init(struct psb_intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 0;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
 
 	connector->base.save = psb_intel_sdvo_save;
 	connector->base.restore = psb_intel_sdvo_restore;
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 33fbf3965309..ed36b4e6e4ae 100644
@@ -2972,7 +2972,7 @@ static void intel_connector_info(struct seq_file *m,
 			   connector->display_info.width_mm,
 			   connector->display_info.height_mm);
 		seq_printf(m, "\tsubpixel order: %s\n",
-			   drm_get_subpixel_order_name(connector->display_info.subpixel_order));
+			   drm_get_subpixel_order_name(connector->static_display_info.subpixel_order));
 		seq_printf(m, "\tCEA rev: %d\n",
 			   connector->display_info.cea_rev);
 	}
drivers/gpu/drm/i915/intel_dsi.c +2 -2
index c8cf3d5c7783..3eaf9bb8498d 100644
@@ -1702,7 +1702,7 @@ static void intel_dsi_add_properties(struct intel_connector *connector)
 
 		connector->base.state->scaling_mode = DRM_MODE_SCALE_ASPECT;
 
-		connector->base.display_info.panel_orientation =
+		connector->base.static_display_info.panel_orientation =
 			intel_dsi_get_panel_orientation(connector);
 		drm_connector_init_panel_orientation_property(
 				&connector->base,
@@ -1826,7 +1826,7 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
 
 	drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
 
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_dvo.c +1 -1
index eb0c559b2715..68fe4587441f 100644
@@ -520,7 +520,7 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
 
 		drm_connector_helper_add(connector,
 					 &intel_dvo_connector_helper_funcs);
-		connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+		connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 		connector->interlace_allowed = false;
 		connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_lvds.c +1 -1
index cdae4934b885..c35f84642c79 100644
@@ -1050,7 +1050,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
 		intel_encoder->crtc_mask = (1 << 1);
 
 	drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs);
-	connector->display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
drivers/gpu/drm/i915/intel_sdvo.c +1 -1
index 0c14d1c04cbd..6309a1d9f87e 100644
@@ -2440,7 +2440,7 @@ intel_sdvo_connector_init(struct intel_sdvo_connector *connector,
 
 	connector->base.base.interlace_allowed = 1;
 	connector->base.base.doublescan_allowed = 0;
-	connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB;
+	connector->base.base.static_display_info.subpixel_order = SubPixelHorizontalRGB;
 	connector->base.get_hw_state = intel_sdvo_connector_get_hw_state;
 
 	intel_connector_attach_encoder(&connector->base, &encoder->base);
drivers/gpu/drm/imx/imx-ldb.c +2 -2
index 56dd7a9a8e25..4909fe89e167 100644
@@ -299,7 +299,7 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder,
 
 	if (!bus_format) {
 		struct drm_connector *connector = connector_state->connector;
-		struct drm_display_info *di = &connector->display_info;
+		struct drm_static_display_info *di = &connector->static_display_info;
 
 		if (di->num_bus_formats)
 			bus_format = di->bus_formats[0];
@@ -358,7 +358,7 @@ static int imx_ldb_encoder_atomic_check(struct drm_encoder *encoder,
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
 	struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
 	u32 bus_format = imx_ldb_ch->bus_format;
 
 	/* Bus format description in DT overrides connector display info. */
drivers/gpu/drm/imx/parallel-display.c +1 -1
index aedecda9728a..2aa80484a39d 100644
@@ -118,7 +118,7 @@ static int imx_pd_encoder_atomic_check(struct drm_encoder *encoder,
 				       struct drm_connector_state *conn_state)
 {
 	struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
-	struct drm_display_info *di = &conn_state->connector->display_info;
+	struct drm_static_display_info *di = &conn_state->connector->static_display_info;
 	struct imx_parallel_display *imxpd = enc_to_imxpd(encoder);
 
 	if (!imxpd->bus_format && di->num_bus_formats) {
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +3 -3
index 0abe77675b76..0429006288d6 100644
@@ -101,8 +101,8 @@ static void mxsfb_set_bus_fmt(struct mxsfb_drm_private *mxsfb)
 
 	reg = readl(mxsfb->base + LCDC_CTRL);
 
-	if (mxsfb->connector.display_info.num_bus_formats)
-		bus_format = mxsfb->connector.display_info.bus_formats[0];
+	if (mxsfb->connector.static_display_info.num_bus_formats)
+		bus_format = mxsfb->connector.static_display_info.bus_formats[0];
 
 	reg &= ~CTRL_BUS_WIDTH_MASK;
 	switch (bus_format) {
@@ -199,7 +199,7 @@ static int mxsfb_reset_block(void __iomem *reset_addr)
 static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
 {
 	struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
-	const u32 bus_flags = mxsfb->connector.display_info.bus_flags;
+	const u32 bus_flags = mxsfb->connector.static_display_info.bus_flags;
 	u32 vdctrl0, vsync_pulse_len, hsync_pulse_len;
 	int err;
 
drivers/gpu/drm/panel/panel-arm-versatile.c +1 -1
index b428c4678106..25958bc4c5ca 100644
@@ -268,7 +268,7 @@ static int versatile_panel_get_modes(struct drm_panel *panel)
 		DRM_DISPLAY_INFO_LEN);
 	connector->display_info.width_mm = vpanel->panel_type->width_mm;
 	connector->display_info.height_mm = vpanel->panel_type->height_mm;
-	connector->display_info.bus_flags = vpanel->panel_type->bus_flags;
+	connector->static_display_info.bus_flags = vpanel->panel_type->bus_flags;
 
 	mode = drm_mode_duplicate(panel->drm, &vpanel->panel_type->mode);
 	drm_mode_set_name(mode);
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +4 -4
index b4ec0ecff807..1ba893942a2b 100644
@@ -411,19 +411,19 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili)
 	 */
 	if (ili->conf->dclk_active_high) {
 		reg = ILI9322_POL_DCLK;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_POSEDGE;
 	} else {
 		reg = 0;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_PIXDATA_NEGEDGE;
 	}
 	if (ili->conf->de_active_high) {
 		reg |= ILI9322_POL_DE;
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_HIGH;
 	} else {
-		connector->display_info.bus_flags |=
+		connector->static_display_info.bus_flags |=
 			DRM_BUS_FLAG_DE_LOW;
 	}
 	if (ili->conf->hsync_active_high)
drivers/gpu/drm/panel/panel-lvds.c +2 -2
index b5e3994f0aa8..b52095666bda 100644
@@ -127,9 +127,9 @@ static int panel_lvds_get_modes(struct drm_panel *panel)
 
 	connector->display_info.width_mm = lvds->width;
 	connector->display_info.height_mm = lvds->height;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &lvds->bus_format, 1);
-	connector->display_info.bus_flags = lvds->data_mirror
+	connector->static_display_info.bus_flags = lvds->data_mirror
 					  ? DRM_BUS_FLAG_DATA_LSB_TO_MSB
 					  : DRM_BUS_FLAG_DATA_MSB_TO_LSB;
 
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +1 -1
index d964d454e4ae..9526461c0eb3 100644
@@ -356,7 +356,7 @@ static int rpi_touchscreen_get_modes(struct drm_panel *panel)
 	connector->display_info.bpc = 8;
 	connector->display_info.width_mm = 154;
 	connector->display_info.height_mm = 86;
-	drm_display_info_set_bus_formats(&connector->display_info,
+	drm_display_info_set_bus_formats(&connector->static_display_info,
 					 &bus_format, 1);
 
 	return num;
drivers/gpu/drm/panel/panel-seiko-43wvf1g.c +2 -2
index 71c09ed436ae..ffa9d1b6f863 100644
@@ -115,9 +115,9 @@ static int seiko_panel_get_fixed_modes(struct seiko_panel *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;
 }
drivers/gpu/drm/panel/panel-simple.c +2 -2
index 5591984a392b..ba3f85b7338f 100644
@@ -152,9 +152,9 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 	connector->display_info.width_mm = panel->desc->size.width;
 	connector->display_info.height_mm = panel->desc->size.height;
 	if (panel->desc->bus_format)
-		drm_display_info_set_bus_formats(&connector->display_info,
+		drm_display_info_set_bus_formats(&connector->static_display_info,
 						 &panel->desc->bus_format, 1);
-	connector->display_info.bus_flags = panel->desc->bus_flags;
+	connector->static_display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;
 }
drivers/gpu/drm/pl111/pl111_display.c +2 -2
index 5b8368c76734..affd050ee409 100644
@@ -148,10 +148,10 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
 		tim2 |= TIM2_IVS;
 
 	if (connector) {
-		if (connector->display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
+		if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_DE_LOW)
 			tim2 |= TIM2_IOE;
 
-		if (connector->display_info.bus_flags &
+		if (connector->static_display_info.bus_flags &
 		    DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 			tim2 |= TIM2_IPC;
 	}
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
index 2e2ca3c6b47d..c8a0f856f84e 100644
@@ -2363,7 +2363,7 @@ radeon_add_atom_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 
 	if (has_aux)
@@ -2526,7 +2526,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
 	} else
 		connector->polled = DRM_CONNECTOR_POLL_HPD;
 
-	connector->display_info.subpixel_order = subpixel_order;
+	connector->static_display_info.subpixel_order = subpixel_order;
 	drm_connector_register(connector);
 }
 
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +1 -1
index ba8d2804c1d1..72723a80b1e3 100644
@@ -102,7 +102,7 @@ static void rcar_du_encoder_mode_set(struct drm_encoder *encoder,
 				     struct drm_connector_state *conn_state)
 {
 	struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
-	struct drm_display_info *info = &conn_state->connector->display_info;
+	struct drm_static_display_info *info = &conn_state->connector->static_display_info;
 	enum rcar_lvds_mode mode;
 
 	rcar_du_crtc_route_output(crtc_state->crtc, renc->output);
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -2
index 1d714c06ec9d..d20a876ba4c6 100644
@@ -55,13 +55,13 @@ static struct drm_connector *sun4i_tcon_get_connector(const struct drm_encoder *
 static int sun4i_tcon_get_pixel_depth(const struct drm_encoder *encoder)
 {
 	struct drm_connector *connector;
-	struct drm_display_info *info;
+	struct drm_static_display_info *info;
 
 	connector = sun4i_tcon_get_connector(encoder);
 	if (!connector)
 		return -EINVAL;
 
-	info = &connector->display_info;
+	info = &connector->static_display_info;
 	if (info->num_bus_formats != 1)
 		return -EINVAL;
 
drivers/gpu/drm/tve200/tve200_display.c +1 -1
index db397fcb345a..aa805e2bc0fe 100644
@@ -148,7 +148,7 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe,
 	/* Vsync IRQ at start of Vsync at first */
 	ctrl1 |= TVE200_VSTSTYPE_VSYNC;
 
-	if (connector->display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
+	if (connector->static_display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
 		ctrl1 |= TVE200_CTRL_TVCLKP;
 
 	if ((mode->hdisplay == 352 && mode->vdisplay == 240) || /* SIF(525) */
drivers/gpu/drm/vc4/vc4_dpi.c +2 -2
index 72c9dbd81d7f..a757a2670353 100644
@@ -170,8 +170,8 @@ static void vc4_dpi_encoder_enable(struct drm_encoder *encoder)
 	u32 dpi_c = DPI_ENABLE | DPI_OUTPUT_ENABLE_MODE;
 	int ret;
 
-	if (dpi->connector->display_info.num_bus_formats) {
-		u32 bus_format = dpi->connector->display_info.bus_formats[0];
+	if (dpi->connector->static_display_info.num_bus_formats) {
+		u32 bus_format = dpi->connector->static_display_info.bus_formats[0];
 
 		switch (bus_format) {
 		case MEDIA_BUS_FMT_RGB888_1X24:
include/drm/drm_connector.h +71 -52
index 675cc3f8cf85..aad3258facf2 100644
@@ -177,7 +177,7 @@ enum drm_link_status {
 };
 
 /**
- * enum drm_panel_orientation - panel_orientation info for &drm_display_info
+ * enum drm_panel_orientation - panel_orientation info for &drm_static_display_info
  *
  * This enum is used to track the (LCD) panel orientation. There are no
  * separate #defines for the uapi!
@@ -206,14 +206,67 @@ enum drm_panel_orientation {
 };
 
 /**
- * struct drm_display_info - runtime data about the connected sink
+ * struct drm_static_display_info - data about the connected sink
+ *
+ * Static data (as in not parsed from EDID) about the connected sink.
+ * This will not be reset once set, so drivers can safely populate this
+ * at connector init time. They can also adjust it dynamically as long
+ * as the don't leave stale garbage behind.
+ */
+struct drm_static_display_info {
+	/**
+	 * @subpixel_order: Subpixel order of LCD panels.
+	 */
+	enum subpixel_order subpixel_order;
+
+	/**
+	 * @panel_orientation: Read only connector property for built-in panels,
+	 * indicating the orientation of the panel vs the device's casing.
+	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
+	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
+	 * fb to compensate and gets exported as prop to userspace.
+	 */
+	int panel_orientation;
+
+	/**
+	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
+	 * @color_formats. Array of size @num_bus_formats encoded using
+	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
+	 */
+	const u32 *bus_formats;
+	/**
+	 * @num_bus_formats: Size of @bus_formats array.
+	 */
+	unsigned int num_bus_formats;
+
+#define DRM_BUS_FLAG_DE_LOW		(1<<0)
+#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
+/* drive data on pos. edge */
+#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
+/* drive data on neg. edge */
+#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
+/* data is transmitted MSB to LSB on the bus */
+#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
+/* data is transmitted LSB to MSB on the bus */
+#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
+
+	/**
+	 * @bus_flags: Additional information (like pixel signal polarity) for
+	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
+	 */
+	u32 bus_flags;
+};
+
+/**
+ * struct drm_display_info - Dynamic data about the connected sink
  *
  * Describes a given display (e.g. CRT or flat panel) and its limitations. For
  * fixed display sinks like built-in panels there's not much difference between
  * this and &struct drm_connector. But for sinks with a real cable this
  * structure is meant to describe all the things at the other end of the cable.
  *
- * For sinks which provide an EDID this can be filled out by calling
+ * This should be filled out by the connector .fill_modes()/.get_modes()
+ * hooks. For sinks which provide an EDID this can be filled out by calling
  * drm_add_edid_modes().
  */
 struct drm_display_info {
@@ -225,7 +278,7 @@ struct drm_display_info {
 	/**
 	 * @width_mm: Physical width in mm.
 	 */
-        unsigned int width_mm;
+	unsigned int width_mm;
 	/**
 	 * @height_mm: Physical height in mm.
 	 */
@@ -242,26 +295,12 @@ struct drm_display_info {
 	 */
 	unsigned int bpc;
 
-	/**
-	 * @subpixel_order: Subpixel order of LCD panels.
-	 */
-	enum subpixel_order subpixel_order;
-
 #define DRM_COLOR_FORMAT_RGB444		(1<<0)
 #define DRM_COLOR_FORMAT_YCRCB444	(1<<1)
 #define DRM_COLOR_FORMAT_YCRCB422	(1<<2)
 #define DRM_COLOR_FORMAT_YCRCB420	(1<<3)
 
 	/**
-	 * @panel_orientation: Read only connector property for built-in panels,
-	 * indicating the orientation of the panel vs the device's casing.
-	 * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
-	 * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
-	 * fb to compensate and gets exported as prop to userspace.
-	 */
-	int panel_orientation;
-
-	/**
 	 * @color_formats: HDMI Color formats, selects between RGB and YCrCb
 	 * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
 	 * as used to describe the pixel format in framebuffers, and also don't
@@ -270,34 +309,6 @@ struct drm_display_info {
 	u32 color_formats;
 
 	/**
-	 * @bus_formats: Pixel data format on the wire, somewhat redundant with
-	 * @color_formats. Array of size @num_bus_formats encoded using
-	 * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
-	 */
-	const u32 *bus_formats;
-	/**
-	 * @num_bus_formats: Size of @bus_formats array.
-	 */
-	unsigned int num_bus_formats;
-
-#define DRM_BUS_FLAG_DE_LOW		(1<<0)
-#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
-/* drive data on pos. edge */
-#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
-/* drive data on neg. edge */
-#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
-/* data is transmitted MSB to LSB on the bus */
-#define DRM_BUS_FLAG_DATA_MSB_TO_LSB	(1<<4)
-/* data is transmitted LSB to MSB on the bus */
-#define DRM_BUS_FLAG_DATA_LSB_TO_MSB	(1<<5)
-
-	/**
-	 * @bus_flags: Additional information (like pixel signal polarity) for
-	 * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
-	 */
-	u32 bus_flags;
-
-	/**
 	 * @max_tmds_clock: Maximum TMDS clock rate supported by the
 	 * sink in kHz. 0 means undefined.
 	 */
@@ -335,7 +346,7 @@ struct drm_display_info {
 	bool non_desktop;
 };
 
-int drm_display_info_set_bus_formats(struct drm_display_info *info,
+int drm_display_info_set_bus_formats(struct drm_static_display_info *info,
 				     const u32 *formats,
 				     unsigned int num_formats);
 
@@ -851,15 +862,23 @@ struct drm_connector {
 	struct list_head probed_modes;
 
 	/**
-	 * @display_info: Display information is filled from EDID information
-	 * when a display is detected. For non hot-pluggable displays such as
-	 * flat panels in embedded systems, the driver should initialize the
-	 * &drm_display_info.width_mm and &drm_display_info.height_mm fields
-	 * with the physical size of the display.
+	 * @static_display_info: Display information is filled by the driver
+	 *
+	 * Protected by &drm_mode_config.mutex.
+	 */
+	struct drm_static_display_info static_display_info;
+	/**
+	 * @display_info: Dynamic display information is filled from EDID
+	 * information when a display is detected. For non hot-pluggable
+	 * displays such as flat panels in embedded systems, the driver
+	 * should initialize the &drm_display_info.width_mm and
+	 * &drm_display_info.height_mm fields with the physical size of
+	 * the display.
 	 *
 	 * Protected by &drm_mode_config.mutex.
 	 */
 	struct drm_display_info display_info;
+
 	const struct drm_connector_funcs *funcs;
 
 	struct drm_property_blob *edid_blob_ptr;
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

RFC PATCH 5/11 drm/edid: Clear display info fully

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Now that we have split the display info into static and dynamic parts, we can just zero out the entire dynamic part with memset(). Previously we were just clearing parts of it, leaving stale data in other parts (eg. HDMI SCDC capabilities).

Also when the edid is NULL drm_add_edid_modes() bails out early skipping the call to drm_add_display_info(). Thus we would again leave stale data behind. To avoid that let's clear out the display info at the very start of drm_add_edid_modes().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shashank Sharma <[email protected]>
---
 drivers/gpu/drm/drm_connector.c |  3 +--
 drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
 2 files changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +1 -2
index d73e97ed7dff..ddd7d978f462 100644
@@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
+	drm_reset_display_info(connector);
 	if (edid)
 		drm_add_display_info(connector, edid);
-	else
-		drm_reset_display_info(connector);
 
 	drm_object_property_set_value(&connector->base,
 				      dev->mode_config.non_desktop_property,
drivers/gpu/drm/drm_edid.c +3 -20
index 788fee4b4bf9..78c1f37be3db 100644
@@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
-	info->width_mm = 0;
-	info->height_mm = 0;
-
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
-	info->non_desktop = 0;
+	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_reset_display_info);
 
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
-
 	u32 quirks = edid_get_quirks(edid);
 
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
 	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
 	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
@@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
+	drm_reset_display_info(connector);
+
 	if (edid == NULL) {
 		clear_eld(connector);
 		return 0;
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully

Regards

Shashank

Quoted 81 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Now that we have split the display info into static and dynamic parts, we can just zero out the entire dynamic part with memset(). Previously we were just clearing parts of it, leaving stale data in other parts (eg. HDMI SCDC capabilities).

Also when the edid is NULL drm_add_edid_modes() bails out early skipping the call to drm_add_display_info(). Thus we would again leave stale data behind. To avoid that let's clear out the display info at the very start of drm_add_edid_modes().

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shashank Sharma <[email protected]>
---
  drivers/gpu/drm/drm_connector.c |  3 +--
  drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
  2 files changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +1 -2
index d73e97ed7dff..ddd7d978f462 100644
@@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
  	 * duplicate it rather than attempt to ensure some arbitrary
  	 * ordering of calls.
  	 */
+	drm_reset_display_info(connector);
  	if (edid)
  		drm_add_display_info(connector, edid);
-	else
-		drm_reset_display_info(connector);
 
  	drm_object_property_set_value(&connector->base,
  				      dev->mode_config.non_desktop_property,
drivers/gpu/drm/drm_edid.c +1 -20
index 788fee4b4bf9..78c1f37be3db 100644
@@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
  {
  	struct drm_display_info *info = &connector->display_info;
 
-	info->width_mm = 0;
-	info->height_mm = 0;
-
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
-	info->non_desktop = 0;
+	memset(info, 0, sizeof(*info));
  }
  EXPORT_SYMBOL_GPL(drm_reset_display_info);
 
  u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
  {
  	struct drm_display_info *info = &connector->display_info;
-
  	u32 quirks = edid_get_quirks(edid);
 
  	info->width_mm = edid->width_cm * 10;
  	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
  	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
  	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);

drivers/gpu/drm/drm_edid.c int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) · line 4668

Quoted 4 lines
drivers/gpu/drm/drm_edid.c +1 -0
@@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
  	int num_modes = 0;
  	u32 quirks;
 
+	drm_reset_display_info(connector);

How about if we move the call to drm_reset_display_info() within drm_add_display_info() ? something like:
drm_add_display_info()

{
    struct drm_display_info *info = &connector->display_info;
    u32 quirks = edid_get_quirks(edid);

    drm_reset_display_info();

    info->width_mm = edid->width_cm * 10;
    info->height_mm = edid->height_cm * 10;
    info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);

    ......
}

- Shashank

drivers/gpu/drm/drm_edid.c int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) · line 4672

Quoted 4 lines
drivers/gpu/drm/drm_edid.c +1 -0
+
  	if (edid == NULL) {
  		clear_eld(connector);
  		return 0;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#15 lore raw

Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully

In reply to Ville Syrjala
Quoted 12 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Now that we have split the display info into static and dynamic parts, we can just zero out the entire dynamic part with memset(). Previously we were just clearing parts of it, leaving stale data in other parts (eg. HDMI SCDC capabilities).

Also when the edid is NULL drm_add_edid_modes() bails out early skipping the call to drm_add_display_info(). Thus we would again leave stale data behind. To avoid that let's clear out the display info at the very start of drm_add_edid_modes().

Quoted 4 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shashank Sharma <[email protected]>

I like the idea of this, but I think we need to refine it a bit. What about only doing this for external screens, but not panels? That would avoid a lot of surprises (there's really no need to reset the display info for fixed panels ever), and also avoid the need for the first 3 patches in your series.
-Daniel

Quoted 76 lines
---
 drivers/gpu/drm/drm_connector.c |  3 +--
 drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
 2 files changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +1 -2
index d73e97ed7dff..ddd7d978f462 100644
@@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
+	drm_reset_display_info(connector);
 	if (edid)
 		drm_add_display_info(connector, edid);
-	else
-		drm_reset_display_info(connector);
 
 	drm_object_property_set_value(&connector->base,
 				      dev->mode_config.non_desktop_property,
drivers/gpu/drm/drm_edid.c +3 -20
index 788fee4b4bf9..78c1f37be3db 100644
@@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
-	info->width_mm = 0;
-	info->height_mm = 0;
-
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
-	info->non_desktop = 0;
+	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_reset_display_info);
 
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
-
 	u32 quirks = edid_get_quirks(edid);
 
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
 	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
 	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
@@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
+	drm_reset_display_info(connector);
+
 	if (edid == NULL) {
 		clear_eld(connector);
 		return 0;
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#16 lore raw

Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully

Quoted 18 lines · Daniel Vetter
Quoted 12 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Now that we have split the display info into static and dynamic parts, we can just zero out the entire dynamic part with memset(). Previously we were just clearing parts of it, leaving stale data in other parts (eg. HDMI SCDC capabilities).

Also when the edid is NULL drm_add_edid_modes() bails out early skipping the call to drm_add_display_info(). Thus we would again leave stale data behind. To avoid that let's clear out the display info at the very start of drm_add_edid_modes().

Quoted 4 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shashank Sharma <[email protected]>
Quoted 5 lines

I like the idea of this, but I think we need to refine it a bit. What about only doing this for external screens, but not panels? That would avoid a lot of surprises (there's really no need to reset the display info for fixed panels ever), and also avoid the need for the first 3 patches in your series.

Probably best to extract a drm_connector_is_panel function into drm_connector.c for that, and also use it in drm_helper_move_panel_connectors_to_head. Just to make sure we only have 1 definition of what a panel is.
-Daniel

Quoted 83 lines

-Daniel

Quoted 76 lines
---
 drivers/gpu/drm/drm_connector.c |  3 +--
 drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
 2 files changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +1 -2
index d73e97ed7dff..ddd7d978f462 100644
@@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
+	drm_reset_display_info(connector);
 	if (edid)
 		drm_add_display_info(connector, edid);
-	else
-		drm_reset_display_info(connector);
 
 	drm_object_property_set_value(&connector->base,
 				      dev->mode_config.non_desktop_property,
drivers/gpu/drm/drm_edid.c +3 -20
index 788fee4b4bf9..78c1f37be3db 100644
@@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
-	info->width_mm = 0;
-	info->height_mm = 0;
-
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
-	info->non_desktop = 0;
+	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_reset_display_info);
 
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
-
 	u32 quirks = edid_get_quirks(edid);
 
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
 	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
 	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
@@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
+	drm_reset_display_info(connector);
+
 	if (edid == NULL) {
 		clear_eld(connector);
 		return 0;
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully

In reply to Daniel Vetter
Quoted 18 lines · Daniel Vetter
Quoted 12 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Now that we have split the display info into static and dynamic parts, we can just zero out the entire dynamic part with memset(). Previously we were just clearing parts of it, leaving stale data in other parts (eg. HDMI SCDC capabilities).

Also when the edid is NULL drm_add_edid_modes() bails out early skipping the call to drm_add_display_info(). Thus we would again leave stale data behind. To avoid that let's clear out the display info at the very start of drm_add_edid_modes().

Quoted 4 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Shashank Sharma <[email protected]>
Quoted 5 lines

I like the idea of this, but I think we need to refine it a bit. What about only doing this for external screens, but not panels? That would avoid a lot of surprises (there's really no need to reset the display info for fixed panels ever), and also avoid the need for the first 3 patches in your series.

Just realized I replied to the wrong patch, this was meant for the forced clearing of all display_info data in one of the later patches. But it is also somewhat relevant here ...
-Daniel

Quoted 83 lines

-Daniel

Quoted 76 lines
---
 drivers/gpu/drm/drm_connector.c |  3 +--
 drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
 2 files changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +1 -2
index d73e97ed7dff..ddd7d978f462 100644
@@ -1389,10 +1389,9 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
+	drm_reset_display_info(connector);
 	if (edid)
 		drm_add_display_info(connector, edid);
-	else
-		drm_reset_display_info(connector);
 
 	drm_object_property_set_value(&connector->base,
 				      dev->mode_config.non_desktop_property,
drivers/gpu/drm/drm_edid.c +3 -20
index 788fee4b4bf9..78c1f37be3db 100644
@@ -4443,37 +4443,18 @@ drm_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
-	info->width_mm = 0;
-	info->height_mm = 0;
-
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
-	info->non_desktop = 0;
+	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_reset_display_info);
 
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
-
 	u32 quirks = edid_get_quirks(edid);
 
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
-	/* driver figures it out in this case */
-	info->bpc = 0;
-	info->color_formats = 0;
-	info->cea_rev = 0;
-	info->max_tmds_clock = 0;
-	info->dvi_dual = false;
-	info->has_hdmi_infoframe = false;
-
 	info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
 
 	DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
@@ -4684,6 +4665,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
+	drm_reset_display_info(connector);
+
 	if (edid == NULL) {
 		clear_eld(connector);
 		return 0;
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#18 lore raw

RFC PATCH 6/11 drm/edid: Don't call drm_add_display_info() with an invalid EDID

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

drm_mode_connector_update_edid_property() will call drm_add_display_info() if an invalid edid is passed in. This differs from the behaviour of drm_add_edid_modes() which doesn't try to populate the display info from an invalid edid. Adjust drm_mode_connector_update_edid_property() to match that behaviour.

Unfortunately we have to pass the edid as non-const to drm_mode_connector_update_edid_property() because drm_edid_is_valid() may need to modify it :( Would be nice to one day fix up the EDID code to not do crazy things like that.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 4 ++--
 include/drm/drm_connector.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_connector.c +2 -2
index ddd7d978f462..d8c3ef4f17da 100644
@@ -1368,7 +1368,7 @@ EXPORT_SYMBOL(drm_mode_connector_set_tile_property);
  * Zero on success, negative errno on failure.
  */
 int drm_mode_connector_update_edid_property(struct drm_connector *connector,
-					    const struct edid *edid)
+					    struct edid *edid)
 {
 	struct drm_device *dev = connector->dev;
 	size_t size = 0;
@@ -1390,7 +1390,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * ordering of calls.
 	 */
 	drm_reset_display_info(connector);
-	if (edid)
+	if (edid && drm_edid_is_valid(edid))
 		drm_add_display_info(connector, edid);
 
 	drm_object_property_set_value(&connector->base,
include/drm/drm_connector.h +1 -1
index aad3258facf2..8815ef1ce429 100644
@@ -1119,7 +1119,7 @@ int drm_mode_connector_set_path_property(struct drm_connector *connector,
 					 const char *path);
 int drm_mode_connector_set_tile_property(struct drm_connector *connector);
 int drm_mode_connector_update_edid_property(struct drm_connector *connector,
-					    const struct edid *edid);
+					    struct edid *edid);
 void drm_mode_connector_set_link_status_property(struct drm_connector *connector,
 						 uint64_t link_status);
 int drm_connector_init_panel_orientation_property(
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 6/11
#19 lore raw

Re: [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID

Quoted 9 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

drm_mode_connector_update_edid_property() will call drm_add_display_info() if an invalid edid is passed in. This differs from the behaviour of drm_add_edid_modes() which doesn't try to populate the display info from an invalid edid. Adjust drm_mode_connector_update_edid_property() to match that behaviour.

Quoted 4 lines

Unfortunately we have to pass the edid as non-const to drm_mode_connector_update_edid_property() because drm_edid_is_valid() may need to modify it :( Would be nice to one day fix up the EDID code to not do crazy things like that.

I guess we could put the EDID validation into the EDID reading helpers and just pray that any fixed EDID (from vbt or wherever) is actually valid?

Meanwhile this makes sense to me.

Quoted 47 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 4 ++--
 include/drm/drm_connector.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_connector.c +2 -2
index ddd7d978f462..d8c3ef4f17da 100644
@@ -1368,7 +1368,7 @@ EXPORT_SYMBOL(drm_mode_connector_set_tile_property);
  * Zero on success, negative errno on failure.
  */
 int drm_mode_connector_update_edid_property(struct drm_connector *connector,
-					    const struct edid *edid)
+					    struct edid *edid)
 {
 	struct drm_device *dev = connector->dev;
 	size_t size = 0;
@@ -1390,7 +1390,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * ordering of calls.
 	 */
 	drm_reset_display_info(connector);
-	if (edid)
+	if (edid && drm_edid_is_valid(edid))
 		drm_add_display_info(connector, edid);
 
 	drm_object_property_set_value(&connector->base,
include/drm/drm_connector.h +1 -1
index aad3258facf2..8815ef1ce429 100644
@@ -1119,7 +1119,7 @@ int drm_mode_connector_set_path_property(struct drm_connector *connector,
 					 const char *path);
 int drm_mode_connector_set_tile_property(struct drm_connector *connector);
 int drm_mode_connector_update_edid_property(struct drm_connector *connector,
-					    const struct edid *edid);
+					    struct edid *edid);
 void drm_mode_connector_set_link_status_property(struct drm_connector *connector,
 						 uint64_t link_status);
 int drm_connector_init_panel_orientation_property(
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

RFC PATCH 7/11 drm/probe-helper: Avoid iterating the list twice on ww backoff

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

If we have to backoff there's no point in going over the mode list again to mark all the modes as stale. We can defer that until we're ready to refresh the mode list. Avoids multiple list walks if we have to do the locking backoff.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +4 -4
index 527743394150..7dc7e635d7e4 100644
@@ -415,10 +415,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	} else
 		WARN_ON(ret < 0);
 
-	/* set all old modes to the stale state */
-	list_for_each_entry(mode, &connector->modes, head)
-		mode->status = MODE_STALE;
-
 	old_status = connector->status;
 
 	if (connector->force) {
@@ -472,6 +468,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
 	dev->mode_config.poll_running = drm_kms_helper_poll;
 
+	/* set all old modes to the stale state */
+	list_for_each_entry(mode, &connector->modes, head)
+		mode->status = MODE_STALE;
+
 	if (connector->status == connector_status_disconnected) {
 		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
 			connector->base.id, connector->name);
Signature · 6 lines
2.13.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 7/11
#21 lore raw

Re: [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff

Quoted 10 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

If we have to backoff there's no point in going over the mode list again to mark all the modes as stale. We can defer that until we're ready to refresh the mode list. Avoids multiple list walks if we have to do the locking backoff.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>

Some drivers add modes from their ->detect callbacks I think, won't this break them? At least I'm never sure about what different drivers are supposed to do in each case.

Otoh the kerneldoc is fairly clear, and this patch is easy to revert, and it might help in forcing drivers to be more consistent.

If you add a note about my concerns (as a hint in case we bisect a regression to this patch), then this is:

Quoted 33 lines
---
 drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +4 -4
index 527743394150..7dc7e635d7e4 100644
@@ -415,10 +415,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	} else
 		WARN_ON(ret < 0);
 
-	/* set all old modes to the stale state */
-	list_for_each_entry(mode, &connector->modes, head)
-		mode->status = MODE_STALE;
-
 	old_status = connector->status;
 
 	if (connector->force) {
@@ -472,6 +468,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
 	dev->mode_config.poll_running = drm_kms_helper_poll;
 
+	/* set all old modes to the stale state */
+	list_for_each_entry(mode, &connector->modes, head)
+		mode->status = MODE_STALE;
+
 	if (connector->status == connector_status_disconnected) {
 		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
 			connector->base.id, connector->name);
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#22 lore raw

Re: [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff

Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

If we have to backoff there's no point in going over the mode list again to mark all the modes as stale. We can defer that until we're ready to refresh the mode list. Avoids multiple list walks if we have to do the locking backoff.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 6 lines

Some drivers add modes from their ->detect callbacks I think, won't this break them? At least I'm never sure about what different drivers are supposed to do in each case.

Otoh the kerneldoc is fairly clear, and this patch is easy to revert, and it might help in forcing drivers to be more consistent.

Hmm. Yeah I didn't actually make sure that drivers aren't adding stuff to the ->modes list directly. They shouldn't but who knows.

Quoted 3 lines

If you add a note about my concerns (as a hint in case we bisect a regression to this patch), then this is:

Sure, I'll try to add something.

Quoted 42 lines
Quoted 33 lines
---
 drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +4 -4
index 527743394150..7dc7e635d7e4 100644
@@ -415,10 +415,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	} else
 		WARN_ON(ret < 0);
 
-	/* set all old modes to the stale state */
-	list_for_each_entry(mode, &connector->modes, head)
-		mode->status = MODE_STALE;
-
 	old_status = connector->status;
 
 	if (connector->force) {
@@ -472,6 +468,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 
 	dev->mode_config.poll_running = drm_kms_helper_poll;
 
+	/* set all old modes to the stale state */
+	list_for_each_entry(mode, &connector->modes, head)
+		mode->status = MODE_STALE;
+
 	if (connector->status == connector_status_disconnected) {
 		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
 			connector->base.id, connector->name);
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

RFC PATCH 8/11 drm: Add drm_connector_fill_modes()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Wrap the ->fill_modes() call in a small helper that first clears out the stale data from connector->display_info. This should guarantee that we get consistent display_info whether or not the drivers use the EDID based stuff to clear and fill it.

TODO: what about just after init, before anyone has called ->fill_modes()? In that case userspace could see stale data if they do the cheap getconnector ioctl. Not sure if that's a valid concern though.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 44 +++++++++++++++++++++++++++++++++++++----
 drivers/gpu/drm/drm_edid.c      | 14 +------------
 drivers/gpu/drm/drm_fb_helper.c |  2 +-
 drivers/gpu/drm/drm_sysfs.c     |  6 +++---
 include/drm/drm_connector.h     |  3 +++
 include/drm/drm_edid.h          |  1 -
 6 files changed, 48 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +40 -4
index d8c3ef4f17da..2bf19a37dbac 100644
@@ -1389,7 +1389,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 	if (edid && drm_edid_is_valid(edid))
 		drm_add_display_info(connector, edid);
 
@@ -1594,9 +1594,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
 	mutex_lock(&dev->mode_config.mutex);
 	if (out_resp->count_modes == 0) {
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	out_resp->mm_width = connector->display_info.width_mm;
@@ -1759,3 +1759,39 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
 	return tg;
 }
 EXPORT_SYMBOL(drm_mode_create_tile_group);
+
+/**
+ * drm_connector_reset_display_info - reset the connector's display info
+ * @connector: DRM connector
+ *
+ * Clear the old display info for @connector allowing the driver to
+ * repopulate it based on fresh data.
+ */
+void drm_connector_reset_display_info(struct drm_connector *connector)
+{
+	struct drm_display_info *info = &connector->display_info;
+
+	memset(info, 0, sizeof(*info));
+}
+EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
+
+/**
+ * drm_connector_fill_modes - fill connector mode list and dynamic display info
+ * @connector: DRM connector
+ * @max_width: max width for modes
+ * @max_height: max height for modes
+ *
+ * Reset the display info and calls &drm_connector_funcs.fill_modes() vfunc
+ * repopulate it and and the mode list.
+ *
+ * RETURNS:
+ * The number of modes found on @connector.
+ */
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height)
+{
+	drm_connector_reset_display_info(connector);
+
+	return connector->funcs->fill_modes(connector, max_width, max_height);
+}
+EXPORT_SYMBOL(drm_connector_fill_modes);
drivers/gpu/drm/drm_edid.c +1 -13
index 78c1f37be3db..618093c4a039 100644
@@ -4435,18 +4435,6 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 	}
 }
 
-/* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
- * all of the values which would have been set from EDID
- */
-void
-drm_reset_display_info(struct drm_connector *connector)
-{
-	struct drm_display_info *info = &connector->display_info;
-
-	memset(info, 0, sizeof(*info));
-}
-EXPORT_SYMBOL_GPL(drm_reset_display_info);
-
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
@@ -4665,7 +4653,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 
 	if (edid == NULL) {
 		clear_eld(connector);
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 18cb63b30e33..f3eddbbd0616 100644
@@ -2027,7 +2027,7 @@ static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
 
 	drm_fb_helper_for_each_connector(fb_helper, i) {
 		connector = fb_helper->connector_info[i]->connector;
-		count += connector->funcs->fill_modes(connector, maxX, maxY);
+		count += drm_connector_fill_modes(connector, maxX, maxY);
 	}
 
 	return count;
drivers/gpu/drm/drm_sysfs.c +3 -3
index 1c5b5ce1fd7f..3c6e800b66a0 100644
@@ -130,9 +130,9 @@ static ssize_t status_store(struct device *device,
 			      connector->name,
 			      old_force, connector->force);
 
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	mutex_unlock(&dev->mode_config.mutex);
include/drm/drm_connector.h +3 -0
index 8815ef1ce429..bf14474c83f5 100644
@@ -1124,6 +1124,9 @@ void drm_mode_connector_set_link_status_property(struct drm_connector *connector
 						 uint64_t link_status);
 int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height);
+void drm_connector_reset_display_info(struct drm_connector *connector);
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height);
 
 /**
  * struct drm_tile_group - Tile group metadata
include/drm/drm_edid.h +0 -1
index 8d89a9c3748d..db5e6a990c2d 100644
@@ -465,7 +465,6 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
 				     struct i2c_adapter *adapter);
 struct edid *drm_edid_duplicate(const struct edid *edid);
-void drm_reset_display_info(struct drm_connector *connector);
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
 
Signature · 6 lines
2.13.6

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#24 lore raw

Re: [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes()

Quoted 7 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Wrap the ->fill_modes() call in a small helper that first clears out the stale data from connector->display_info. This should guarantee that we get consistent display_info whether or not the drivers use the EDID based stuff to clear and fill it.

Quoted 7 lines

TODO: what about just after init, before anyone has called ->fill_modes()? In that case userspace could see stale data if they do the cheap getconnector ioctl. Not sure if that's a valid concern though.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>

Some thoughts:
- I think unconditionally resetting for panels is the wrong thing to do.
- We're not resetting in even more places, can't we just condense them all down to 1?
- I'm undecided on whether this should be in the core, or in the helpers. Atm the core is the one that implements the "just give me the current mode list, don't reprobe" logic, but then we punt everything else to ->fill_modes (including setting all modes to stale and all that stuff). I'm slightly leaning towards doing this in the helper code, not the core code. Any reasons for doing this in core?

Cheers, Daniel

Quoted 166 lines
---
 drivers/gpu/drm/drm_connector.c | 44 +++++++++++++++++++++++++++++++++++++----
 drivers/gpu/drm/drm_edid.c      | 14 +------------
 drivers/gpu/drm/drm_fb_helper.c |  2 +-
 drivers/gpu/drm/drm_sysfs.c     |  6 +++---
 include/drm/drm_connector.h     |  3 +++
 include/drm/drm_edid.h          |  1 -
 6 files changed, 48 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +40 -4
index d8c3ef4f17da..2bf19a37dbac 100644
@@ -1389,7 +1389,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 	if (edid && drm_edid_is_valid(edid))
 		drm_add_display_info(connector, edid);
 
@@ -1594,9 +1594,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
 	mutex_lock(&dev->mode_config.mutex);
 	if (out_resp->count_modes == 0) {
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	out_resp->mm_width = connector->display_info.width_mm;
@@ -1759,3 +1759,39 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
 	return tg;
 }
 EXPORT_SYMBOL(drm_mode_create_tile_group);
+
+/**
+ * drm_connector_reset_display_info - reset the connector's display info
+ * @connector: DRM connector
+ *
+ * Clear the old display info for @connector allowing the driver to
+ * repopulate it based on fresh data.
+ */
+void drm_connector_reset_display_info(struct drm_connector *connector)
+{
+	struct drm_display_info *info = &connector->display_info;
+
+	memset(info, 0, sizeof(*info));
+}
+EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
+
+/**
+ * drm_connector_fill_modes - fill connector mode list and dynamic display info
+ * @connector: DRM connector
+ * @max_width: max width for modes
+ * @max_height: max height for modes
+ *
+ * Reset the display info and calls &drm_connector_funcs.fill_modes() vfunc
+ * repopulate it and and the mode list.
+ *
+ * RETURNS:
+ * The number of modes found on @connector.
+ */
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height)
+{
+	drm_connector_reset_display_info(connector);
+
+	return connector->funcs->fill_modes(connector, max_width, max_height);
+}
+EXPORT_SYMBOL(drm_connector_fill_modes);
drivers/gpu/drm/drm_edid.c +1 -13
index 78c1f37be3db..618093c4a039 100644
@@ -4435,18 +4435,6 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 	}
 }
 
-/* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
- * all of the values which would have been set from EDID
- */
-void
-drm_reset_display_info(struct drm_connector *connector)
-{
-	struct drm_display_info *info = &connector->display_info;
-
-	memset(info, 0, sizeof(*info));
-}
-EXPORT_SYMBOL_GPL(drm_reset_display_info);
-
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
@@ -4665,7 +4653,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 
 	if (edid == NULL) {
 		clear_eld(connector);
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 18cb63b30e33..f3eddbbd0616 100644
@@ -2027,7 +2027,7 @@ static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
 
 	drm_fb_helper_for_each_connector(fb_helper, i) {
 		connector = fb_helper->connector_info[i]->connector;
-		count += connector->funcs->fill_modes(connector, maxX, maxY);
+		count += drm_connector_fill_modes(connector, maxX, maxY);
 	}
 
 	return count;
drivers/gpu/drm/drm_sysfs.c +3 -3
index 1c5b5ce1fd7f..3c6e800b66a0 100644
@@ -130,9 +130,9 @@ static ssize_t status_store(struct device *device,
 			      connector->name,
 			      old_force, connector->force);
 
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	mutex_unlock(&dev->mode_config.mutex);
include/drm/drm_connector.h +3 -0
index 8815ef1ce429..bf14474c83f5 100644
@@ -1124,6 +1124,9 @@ void drm_mode_connector_set_link_status_property(struct drm_connector *connector
 						 uint64_t link_status);
 int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height);
+void drm_connector_reset_display_info(struct drm_connector *connector);
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height);
 
 /**
  * struct drm_tile_group - Tile group metadata
include/drm/drm_edid.h +0 -1
index 8d89a9c3748d..db5e6a990c2d 100644
@@ -465,7 +465,6 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
 				     struct i2c_adapter *adapter);
 struct edid *drm_edid_duplicate(const struct edid *edid);
-void drm_reset_display_info(struct drm_connector *connector);
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
 
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#25 lore raw

Re: [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes()

Quoted 12 lines · Daniel Vetter
Quoted 11 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Wrap the ->fill_modes() call in a small helper that first clears out the stale data from connector->display_info. This should guarantee that we get consistent display_info whether or not the drivers use the EDID based stuff to clear and fill it.

TODO: what about just after init, before anyone has called ->fill_modes()? In that case userspace could see stale data if they do the cheap getconnector ioctl. Not sure if that's a valid concern though.

Quoted 6 lines
Quoted 3 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>

Some thoughts:
- I think unconditionally resetting for panels is the wrong thing to do.a

I think we do fill it dynamically at least for eDP. I suppose not resetting and just overwriting with the same data could work, but in theory it could also lead to inconsistent behaviour if the code that fills the info assumes that things stay at 0 until filled.

Quoted 8 lines

- We're not resetting in even more places, can't we just condense them all down to 1?
- I'm undecided on whether this should be in the core, or in the helpers. Atm the core is the one that implements the "just give me the current mode list, don't reprobe" logic, but then we punt everything else to ->fill_modes (including setting all modes to stale and all that stuff). I'm slightly leaning towards doing this in the helper code, not the core code. Any reasons for doing this in core?

I was pretty much just hoping to force everyone down one path. Having multiple ways of doing things can lead to inconsistent behaviour, especially when people are unsure which one to choose. And at least I don't particularly enjoy having to remind myself about the internal vs. external differences all the time.

But I must admit to not having really thought this thing through, so I might be on the wrong track here.

Quoted 173 lines

Cheers, Daniel

Quoted 166 lines
---
 drivers/gpu/drm/drm_connector.c | 44 +++++++++++++++++++++++++++++++++++++----
 drivers/gpu/drm/drm_edid.c      | 14 +------------
 drivers/gpu/drm/drm_fb_helper.c |  2 +-
 drivers/gpu/drm/drm_sysfs.c     |  6 +++---
 include/drm/drm_connector.h     |  3 +++
 include/drm/drm_edid.h          |  1 -
 6 files changed, 48 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_connector.c +40 -4
index d8c3ef4f17da..2bf19a37dbac 100644
@@ -1389,7 +1389,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	 * duplicate it rather than attempt to ensure some arbitrary
 	 * ordering of calls.
 	 */
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 	if (edid && drm_edid_is_valid(edid))
 		drm_add_display_info(connector, edid);
 
@@ -1594,9 +1594,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 
 	mutex_lock(&dev->mode_config.mutex);
 	if (out_resp->count_modes == 0) {
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	out_resp->mm_width = connector->display_info.width_mm;
@@ -1759,3 +1759,39 @@ struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
 	return tg;
 }
 EXPORT_SYMBOL(drm_mode_create_tile_group);
+
+/**
+ * drm_connector_reset_display_info - reset the connector's display info
+ * @connector: DRM connector
+ *
+ * Clear the old display info for @connector allowing the driver to
+ * repopulate it based on fresh data.
+ */
+void drm_connector_reset_display_info(struct drm_connector *connector)
+{
+	struct drm_display_info *info = &connector->display_info;
+
+	memset(info, 0, sizeof(*info));
+}
+EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
+
+/**
+ * drm_connector_fill_modes - fill connector mode list and dynamic display info
+ * @connector: DRM connector
+ * @max_width: max width for modes
+ * @max_height: max height for modes
+ *
+ * Reset the display info and calls &drm_connector_funcs.fill_modes() vfunc
+ * repopulate it and and the mode list.
+ *
+ * RETURNS:
+ * The number of modes found on @connector.
+ */
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height)
+{
+	drm_connector_reset_display_info(connector);
+
+	return connector->funcs->fill_modes(connector, max_width, max_height);
+}
+EXPORT_SYMBOL(drm_connector_fill_modes);
drivers/gpu/drm/drm_edid.c +1 -13
index 78c1f37be3db..618093c4a039 100644
@@ -4435,18 +4435,6 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
 	}
 }
 
-/* A connector has no EDID information, so we've got no EDID to compute quirks from. Reset
- * all of the values which would have been set from EDID
- */
-void
-drm_reset_display_info(struct drm_connector *connector)
-{
-	struct drm_display_info *info = &connector->display_info;
-
-	memset(info, 0, sizeof(*info));
-}
-EXPORT_SYMBOL_GPL(drm_reset_display_info);
-
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
 {
 	struct drm_display_info *info = &connector->display_info;
@@ -4665,7 +4653,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 	int num_modes = 0;
 	u32 quirks;
 
-	drm_reset_display_info(connector);
+	drm_connector_reset_display_info(connector);
 
 	if (edid == NULL) {
 		clear_eld(connector);
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 18cb63b30e33..f3eddbbd0616 100644
@@ -2027,7 +2027,7 @@ static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
 
 	drm_fb_helper_for_each_connector(fb_helper, i) {
 		connector = fb_helper->connector_info[i]->connector;
-		count += connector->funcs->fill_modes(connector, maxX, maxY);
+		count += drm_connector_fill_modes(connector, maxX, maxY);
 	}
 
 	return count;
drivers/gpu/drm/drm_sysfs.c +3 -3
index 1c5b5ce1fd7f..3c6e800b66a0 100644
@@ -130,9 +130,9 @@ static ssize_t status_store(struct device *device,
 			      connector->name,
 			      old_force, connector->force);
 
-		connector->funcs->fill_modes(connector,
-					     dev->mode_config.max_width,
-					     dev->mode_config.max_height);
+		drm_connector_fill_modes(connector,
+					 dev->mode_config.max_width,
+					 dev->mode_config.max_height);
 	}
 
 	mutex_unlock(&dev->mode_config.mutex);
include/drm/drm_connector.h +3 -0
index 8815ef1ce429..bf14474c83f5 100644
@@ -1124,6 +1124,9 @@ void drm_mode_connector_set_link_status_property(struct drm_connector *connector
 						 uint64_t link_status);
 int drm_connector_init_panel_orientation_property(
 	struct drm_connector *connector, int width, int height);
+void drm_connector_reset_display_info(struct drm_connector *connector);
+int drm_connector_fill_modes(struct drm_connector *connector,
+			     unsigned int max_width, unsigned int max_height);
 
 /**
  * struct drm_tile_group - Tile group metadata
include/drm/drm_edid.h +0 -1
index 8d89a9c3748d..db5e6a990c2d 100644
@@ -465,7 +465,6 @@ struct edid *drm_get_edid(struct drm_connector *connector,
 struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
 				     struct i2c_adapter *adapter);
 struct edid *drm_edid_duplicate(const struct edid *edid);
-void drm_reset_display_info(struct drm_connector *connector);
 u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid);
 int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
 
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#26 lore raw

RFC PATCH 9/11 drm: Fix getconnector locking

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

The edid is protected by mode_config.mutex so extend the locking to protect the property readout part as well.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_connector.c +2 -3
index 2bf19a37dbac..122060792b6f 100644
@@ -1624,15 +1624,12 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 			if (copy_to_user(mode_ptr + copied,
 					 &u_mode, sizeof(u_mode))) {
 				ret = -EFAULT;
-				mutex_unlock(&dev->mode_config.mutex);
-
 				goto out;
 			}
 			copied++;
 		}
 	}
 	out_resp->count_modes = mode_count;
-	mutex_unlock(&dev->mode_config.mutex);
 
 	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	encoder = drm_connector_get_encoder(connector);
@@ -1650,6 +1647,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 	drm_modeset_unlock(&dev->mode_config.connection_mutex);
 
 out:
+	mutex_unlock(&dev->mode_config.mutex);
+
 	drm_connector_put(connector);
 
 	return ret;
Signature · 6 lines
2.13.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#27 lore raw

Re: [RFC][PATCH 09/11] drm: Fix getconnector locking

Quoted 8 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

The edid is protected by mode_config.mutex so extend the locking to protect the property readout part as well.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>

Ehrm no, properties have their own locking and are safe. drm_connector->edid is indeed protected by the mode_config.mutex, but that's not the thing we're looking at here. Maybe we need to patch up the struct drm_connector locking comments a bit to clarify this more? -Daniel

Quoted 36 lines
---
 drivers/gpu/drm/drm_connector.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_connector.c +2 -3
index 2bf19a37dbac..122060792b6f 100644
@@ -1624,15 +1624,12 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 			if (copy_to_user(mode_ptr + copied,
 					 &u_mode, sizeof(u_mode))) {
 				ret = -EFAULT;
-				mutex_unlock(&dev->mode_config.mutex);
-
 				goto out;
 			}
 			copied++;
 		}
 	}
 	out_resp->count_modes = mode_count;
-	mutex_unlock(&dev->mode_config.mutex);
 
 	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	encoder = drm_connector_get_encoder(connector);
@@ -1650,6 +1647,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 	drm_modeset_unlock(&dev->mode_config.connection_mutex);
 
 out:
+	mutex_unlock(&dev->mode_config.mutex);
+
 	drm_connector_put(connector);
 
 	return ret;
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#28 lore raw

RFC PATCH 10/11 drm: Fix debugfs edid_override locking

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

The edid is protected by mode_config.mutex. Grab the lock when frobbing the debugfs edid_override thing.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_debugfs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_debugfs.c +11 -1
index b2482818fee8..caac17145629 100644
@@ -275,11 +275,17 @@ static ssize_t connector_write(struct file *file, const char __user *ubuf,
 static int edid_show(struct seq_file *m, void *data)
 {
 	struct drm_connector *connector = m->private;
-	struct drm_property_blob *edid = connector->edid_blob_ptr;
+	struct drm_property_blob *edid;
+
+	mutex_lock(&connector->dev->mode_config.mutex);
+
+	edid = connector->edid_blob_ptr;
 
 	if (connector->override_edid && edid)
 		seq_write(m, edid->data, edid->length);
 
+	mutex_unlock(&connector->dev->mode_config.mutex);
+
 	return 0;
 }
 
@@ -305,6 +311,8 @@ static ssize_t edid_write(struct file *file, const char __user *ubuf,
 
 	edid = (struct edid *) buf;
 
+	mutex_lock(&connector->dev->mode_config.mutex);
+
 	if (len == 5 && !strncmp(buf, "reset", 5)) {
 		connector->override_edid = false;
 		ret = drm_mode_connector_update_edid_property(connector, NULL);
@@ -318,6 +326,8 @@ static ssize_t edid_write(struct file *file, const char __user *ubuf,
 			connector->override_edid = true;
 	}
 
+	mutex_unlock(&connector->dev->mode_config.mutex);
+
 	kfree(buf);
 
 	return (ret) ? ret : len;
Signature · 6 lines
2.13.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 10/11
#29 lore raw

Re: [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking

Quoted 8 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

The edid is protected by mode_config.mutex. Grab the lock when frobbing the debugfs edid_override thing.

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>

Yup, this looks correct. A kerneldoc patch to update the locking rules would be great.

Quoted 48 lines
---
 drivers/gpu/drm/drm_debugfs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_debugfs.c +11 -1
index b2482818fee8..caac17145629 100644
@@ -275,11 +275,17 @@ static ssize_t connector_write(struct file *file, const char __user *ubuf,
 static int edid_show(struct seq_file *m, void *data)
 {
 	struct drm_connector *connector = m->private;
-	struct drm_property_blob *edid = connector->edid_blob_ptr;
+	struct drm_property_blob *edid;
+
+	mutex_lock(&connector->dev->mode_config.mutex);
+
+	edid = connector->edid_blob_ptr;
 
 	if (connector->override_edid && edid)
 		seq_write(m, edid->data, edid->length);
 
+	mutex_unlock(&connector->dev->mode_config.mutex);
+
 	return 0;
 }
 
@@ -305,6 +311,8 @@ static ssize_t edid_write(struct file *file, const char __user *ubuf,
 
 	edid = (struct edid *) buf;
 
+	mutex_lock(&connector->dev->mode_config.mutex);
+
 	if (len == 5 && !strncmp(buf, "reset", 5)) {
 		connector->override_edid = false;
 		ret = drm_mode_connector_update_edid_property(connector, NULL);
@@ -318,6 +326,8 @@ static ssize_t edid_write(struct file *file, const char __user *ubuf,
 			connector->override_edid = true;
 	}
 
+	mutex_unlock(&connector->dev->mode_config.mutex);
+
 	kfree(buf);
 
 	return (ret) ? ret : len;
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#30 lore raw

RFC PATCH 11/11 drm: Sprinkle lockdep asserts for edid/display_info

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 6 lines
2.13.6

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#31 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 9 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 62 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#32 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

Quoted 8 lines
Quoted 4 lines

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

It was some MST thing I believe... (should have written it down)

amdgpu_dm_atomic_check() -> dm_update_crtcs_state() -> create_stream_for_sink() -> dm_dp_mst_dc_sink_create() -> get_edid/update_edid_property

Quoted 72 lines

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 62 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#33 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 16 lines · Ville Syrjälä
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

Quoted 8 lines
Quoted 4 lines

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

Quoted 6 lines

It was some MST thing I believe... (should have written it down)

amdgpu_dm_atomic_check() -> dm_update_crtcs_state() -> create_stream_for_sink() -> dm_dp_mst_dc_sink_create() -> get_edid/update_edid_property

Yeah, it's because the dc_sink carries the EDID and is only created at this point for us. It's bugged me ever since we did this. Might be time to think of a solution to it now.

Harry

Quoted 64 lines
Quoted 64 lines

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 59 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Quoted 9 lines
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#34 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 19 lines · Harry Wentland
Quoted 18 lines · Ville Syrjälä
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

Quoted 8 lines
Quoted 4 lines

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

It was some MST thing I believe... (should have written it down)

Quoted 8 lines
Quoted 4 lines

amdgpu_dm_atomic_check() -> dm_update_crtcs_state() -> create_stream_for_sink() -> dm_dp_mst_dc_sink_create() -> get_edid/update_edid_property

Yeah, it's because the dc_sink carries the EDID and is only created at this point for us. It's bugged me ever since we did this. Might be time to think of a solution to it now.

But how does this work? Userspace won't do a modeset without the EDID present and the modes listed, which means you'll never ever end up in atomic check. This really sounds rather wrong.

Only idea I can come up with is that you're abusing the regular pageflip request as a worker thread, but that's some seriously backwards design. -Daniel

Quoted 76 lines

Harry

Quoted 73 lines
Quoted 72 lines

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 62 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#35 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 25 lines · Daniel Vetter
Quoted 24 lines · Harry Wentland
Quoted 22 lines · Ville Syrjälä
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

Quoted 8 lines
Quoted 4 lines

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

It was some MST thing I believe... (should have written it down)

amdgpu_dm_atomic_check() -> dm_update_crtcs_state() -> create_stream_for_sink() -> dm_dp_mst_dc_sink_create() -> get_edid/update_edid_property

Quoted 8 lines
Quoted 3 lines

Yeah, it's because the dc_sink carries the EDID and is only created at this point for us. It's bugged me ever since we did this. Might be time to think of a solution to it now.

But how does this work? Userspace won't do a modeset without the EDID present and the modes listed, which means you'll never ever end up in atomic check. This really sounds rather wrong.

Not sure if this works correctly with atomic userspace.

I think with legacy userspace we might rely on the get_connector call doing .fill_modes > drm_helper_probe_single_connector_modes > .get_modes > dm_dp_mst_get_modes > drm_dp_mst_get_edid

Harry

Quoted 81 lines

Only idea I can come up with is that you're abusing the regular pageflip request as a worker thread, but that's some seriously backwards design. -Daniel

Quoted 76 lines

Harry

Quoted 73 lines
Quoted 72 lines

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 62 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#36 lore raw

Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info

Quoted 37 lines · Harry Wentland
Quoted 25 lines · Daniel Vetter
Quoted 24 lines · Harry Wentland
Quoted 22 lines · Ville Syrj??l??
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · Ville Syrjala

From: Ville Syrj??l?? <[email protected]>

edid and display_info are protected by mode_config.mutex. Add lockdep asserts to make sure we're not accessing things w/o the lock.

Quoted 8 lines
Quoted 4 lines

FIXME: pretty sure this will blow up with amdgpu as they seem to be doing edid updates even from the modeset path. Need to figure out what to do about that. Maybe protect the edid/display info with with connection_mutex instead of mode_config.mutex?

Imo not doing EDID udpates from the modeset path is the right fix. I can't think of any reasonable reason to do that at least. Can you point me at the relevant amdgpu code pls (I'm lazy, sry)?

It was some MST thing I believe... (should have written it down)

amdgpu_dm_atomic_check() -> dm_update_crtcs_state() -> create_stream_for_sink() -> dm_dp_mst_dc_sink_create() -> get_edid/update_edid_property

Quoted 8 lines
Quoted 3 lines

Yeah, it's because the dc_sink carries the EDID and is only created at this point for us. It's bugged me ever since we did this. Might be time to think of a solution to it now.

But how does this work? Userspace won't do a modeset without the EDID present and the modes listed, which means you'll never ever end up in atomic check. This really sounds rather wrong.

Quoted 5 lines

Not sure if this works correctly with atomic userspace.

I think with legacy userspace we might rely on the get_connector call doing .fill_modes > drm_helper_probe_single_connector_modes > .get_modes

Quoted 1 line

dm_dp_mst_get_modes > drm_dp_mst_get_edid

Atomic userspace users the exact same ioctls for connector probing, no change there.

That leaves me wondering why exactly you're doing this in atomic_check. Just nuke it?
-Daniel

Quoted 85 lines

Harry

Quoted 81 lines

Only idea I can come up with is that you're abusing the regular pageflip request as a worker thread, but that's some seriously backwards design. -Daniel

Quoted 76 lines

Harry

Quoted 73 lines
Quoted 72 lines

Otherwise I think this is a real good patch.

Thanks, Daniel

Quoted 62 lines
Cc Keith Packard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/drm_connector.c    | 4 ++++
 drivers/gpu/drm/drm_edid.c         | 2 ++
 drivers/gpu/drm/drm_probe_helper.c | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +4 -0
index 122060792b6f..a9f3536f4e94 100644
@@ -1374,6 +1374,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
 	size_t size = 0;
 	int ret;
 
+	lockdep_assert_held(&dev->mode_config.mutex);
+
 	/* ignore requests to set edid when overridden */
 	if (connector->override_edid)
 		return 0;
@@ -1770,6 +1772,8 @@ void drm_connector_reset_display_info(struct drm_connector *connector)
 {
 	struct drm_display_info *info = &connector->display_info;
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	memset(info, 0, sizeof(*info));
 }
 EXPORT_SYMBOL_GPL(drm_connector_reset_display_info);
drivers/gpu/drm/drm_edid.c +2 -0
index 618093c4a039..7f9e9236114b 100644
@@ -4440,6 +4440,8 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 	struct drm_display_info *info = &connector->display_info;
 	u32 quirks = edid_get_quirks(edid);
 
+	lockdep_assert_held(&connector->dev->mode_config.mutex);
+
 	info->width_mm = edid->width_cm * 10;
 	info->height_mm = edid->height_cm * 10;
 
drivers/gpu/drm/drm_probe_helper.c +1 -1
index 7dc7e635d7e4..2a2afcf72788 100644
@@ -400,7 +400,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	enum drm_connector_status old_status;
 	struct drm_modeset_acquire_ctx ctx;
 
-	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	lockdep_assert_held(&dev->mode_config.mutex);
 
 	drm_modeset_acquire_init(&ctx, 0);
 
Signature · 1 line
2.13.6
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#37 lore raw

✓ Fi.CI.BAT: success for drm: Try to make display info less nuts

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm: Try to make display info less nuts
URL : https://patchwork.freedesktop.org/series/39046/
State : success

== Summary ==

Series 39046v1 drm: Try to make display info less nuts
https://patchwork.freedesktop.org/api/1.0/series/39046/revisions/1/mbox/

---- Possible new issues:

Test kms_force_connector_basic:

        Subgroup force-connector-state:
                skip       -> PASS       (fi-ivb-3520m)
        Subgroup force-edid:
                skip       -> PASS       (fi-ivb-3520m)
        Subgroup force-load-detect:
                skip       -> PASS       (fi-ivb-3520m)
        Subgroup prune-stale-modes:
                skip       -> PASS       (fi-ivb-3520m)

---- Known issues:

Test gem_mmap_gtt:

        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                incomplete -> PASS       (fi-bxt-dsi) fdo#103927
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> FAIL       (fi-byt-n2820) fdo#104008

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:288  pass:265  dwarn:0   dfail:0   fail:2   skip:21  time:435s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:372s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:482s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:283s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:481s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:480s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:463s
fi-byt-n2820     total:288  pass:248  dwarn:0   dfail:0   fail:1   skip:39  time:453s
fi-cfl-8700k     total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:391s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:560s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:578s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:414s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:282s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:504s
fi-hsw-4770      total:288  pass:259  dwarn:0   dfail:0   fail:2   skip:27  time:406s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:407s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:452s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:410s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:449s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:492s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:445s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:496s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:587s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:425s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:500s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:516s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:484s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:485s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:407s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:427s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:524s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:397s

aea43a430276951b4e164501e2cf8da77f6b2171 drm-tip: 2018y-02m-27d-10h-49m-38s UTC integration manifest 6cf08f3a12a8 drm: Sprinkle lockdep asserts for edid/display_info
05c6e870f57c drm: Fix debugfs edid_override locking
12b7d587de55 drm: Fix getconnector locking
86d967f31887 drm: Add drm_connector_fill_modes()
42718b893517 drm/probe-helper: Avoid iterating the list twice on ww backoff 09bef27fea8e drm/edid: Don't call drm_add_display_info() with an invalid EDID c4973ec8caa9 drm/edid: Clear display info fully
32090968f316 drm: Split the display info into static and dynamic parts
3418965fb263 drm/shmobile: Don't fill display_info.{width, height}_mm at init time f85fbf074f2f drm/i915: Fill display_info.{width, height}_mm from .get_modes() 4b0f7558b828 drm/gma500: Fill display_info.{width, height}_mm from .get_modes()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8174/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#38 lore raw

✗ Fi.CI.IGT: failure for drm: Try to make display info less nuts

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm: Try to make display info less nuts
URL : https://patchwork.freedesktop.org/series/39046/
State : failure

== Summary ==

---- Possible new issues:

Test kms_vblank:

        Subgroup pipe-b-ts-continuation-suspend:
                skip       -> PASS       (shard-snb)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> FAIL       (shard-hsw)
        Subgroup debugfs-read:
                pass       -> FAIL       (shard-hsw)

---- Known issues:

Test gem_eio:

        Subgroup in-flight:
                incomplete -> PASS       (shard-apl) fdo#104945
Test kms_chv_cursor_fail:
        Subgroup pipe-b-128x128-right-edge:
                pass       -> DMESG-WARN (shard-snb) fdo#105185
Test kms_flip:
        Subgroup flip-vs-expired-vblank:
                fail       -> PASS       (shard-hsw) fdo#102887
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test perf:
        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715

fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715

shard-apl        total:3460 pass:1819 dwarn:1   dfail:0   fail:7   skip:1632 time:12264s
shard-hsw        total:3460 pass:1725 dwarn:1   dfail:0   fail:45  skip:1688 time:11974s
shard-snb        total:3460 pass:1357 dwarn:2   dfail:0   fail:2   skip:2099 time:6660s

Blacklisted hosts:
shard-kbl total:3442 pass:1924 dwarn:1 dfail:0 fail:7 skip:1509 time:9276s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8174/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx