All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 00/11] drm: Try to make display info less nuts
@ 2018-02-27 12:56 ` Ville Syrjala
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Alison Wang, Andrzej Hajda, Archit Taneja,
	Boris Brezillon, Daniel Vetter, Eric Anholt, Hans de Goede,
	Harry Wentland, Keith Packard, Laurent Pinchart, Linus Walleij,
	linux-renesas-soc, Manfred Schlaegl, Marek Vasut, Maxime Ripard,
	Patrik Jakobsson, Philipp Zabel, Shashank Sharma, Stefan Agner,
	Thierry Reding

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <alison.wang@freescale.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thierry Reding <thierry.reding@gmail.com>

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(-)

-- 
2.13.6

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [RFC][PATCH 00/11] drm: Try to make display info less nuts
@ 2018-02-27 12:56 ` Ville Syrjala
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, Archit Taneja, Daniel Vetter, intel-gfx,
	Alison Wang, Stefan Agner, linux-renesas-soc, Andrzej Hajda,
	Hans de Goede, Laurent Pinchart, Philipp Zabel, Manfred Schlaegl,
	Maxime Ripard, Harry Wentland, Linus Walleij

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <alison.wang@freescale.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: Marek Vasut <marex@denx.de>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thierry Reding <thierry.reding@gmail.com>

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(-)

-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [RFC][PATCH 01/11] drm/gma500: Fill display_info.{width, height}_mm from .get_modes()
  2018-02-27 12:56 ` Ville Syrjala
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  -1 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Keith Packard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/gma500/mdfld_dsi_output.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index acb3848ef1c9..41e7f25ba7e0 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -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;
 
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 02/11] drm/i915: Fill display_info.{width, height}_mm from .get_modes()
  2018-02-27 12:56 ` Ville Syrjala
  (?)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  -1 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 801a21b16004..edfcad276506 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -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);
 
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 51a1d6868b1e..c8cf3d5c7783 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -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);
 
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index d35d2d50f595..cdae4934b885 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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;
 		}
 	}
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width,height}_mm at init time
  2018-02-27 12:56 ` Ville Syrjala
@ 2018-02-27 12:56   ` Ville Syrjala
  -1 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Keith Packard, Daniel Vetter, Laurent Pinchart,
	linux-renesas-soc

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
index e7738939a86d..327b7965679a 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
@@ -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)
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width, height}_mm at init time
@ 2018-02-27 12:56   ` Ville Syrjala
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-renesas-soc, Daniel Vetter, intel-gfx, Laurent Pinchart

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
index e7738939a86d..327b7965679a 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c
@@ -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)
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56 ` Ville Syrjala
@ 2018-02-27 12:56   ` Ville Syrjala
  -1 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, Keith Packard, Daniel Vetter, Hans de Goede,
	Shashank Sharma, Stefan Agner, Thierry Reding, Boris Brezillon,
	Philipp Zabel, Laurent Pinchart, Manfred Schlaegl, Marek Vasut,
	Archit Taneja, Andrzej Hajda, Alison Wang, Eric Anholt,
	Linus Walleij, linux-renesas-soc, Maxime Ripard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: Marek Vasut <marex@denx.de>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Alison Wang <alison.wang@freescale.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 74d2efaec52f..1ba72dc2a85b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 120dd3b26fc2..7e9f7f1ab1b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -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);
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index d73281095fac..2d18c8ef22a0 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -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;
 
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index b1ab4ab09532..abd0bce9c31e 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -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;
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 08ab7d6aea65..042ded9ca749 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -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);
 
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index b3cde897cd80..d73e97ed7dff 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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 */
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 035784ddd133..18cb63b30e33 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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;
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
index 0e3752437e44..2444c14639ef 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
@@ -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)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 563f193fcfac..6d608ce26076 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index e64960db3224..290221f73cbf 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 41e7f25ba7e0..605c86ded14f 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
index 8b2eb32ee988..c4e16ab25d1a 100644
--- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
@@ -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);
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index e6943fef0611..4b8d2b6e7202 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index be3eefec5152..fe4667eba85f 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index 84507912be84..3b31dde4c05a 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 33fbf3965309..ed36b4e6e4ae 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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);
 	}
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index c8cf3d5c7783..3eaf9bb8498d 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index eb0c559b2715..68fe4587441f 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index cdae4934b885..c35f84642c79 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 0c14d1c04cbd..6309a1d9f87e 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -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);
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 56dd7a9a8e25..4909fe89e167 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -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. */
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index aedecda9728a..2aa80484a39d 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -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) {
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
index 0abe77675b76..0429006288d6 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
@@ -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;
 
diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
index b428c4678106..25958bc4c5ca 100644
--- a/drivers/gpu/drm/panel/panel-arm-versatile.c
+++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
@@ -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);
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index b4ec0ecff807..1ba893942a2b 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -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)
diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index b5e3994f0aa8..b52095666bda 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index d964d454e4ae..9526461c0eb3 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -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;
diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 71c09ed436ae..ffa9d1b6f863 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -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;
 }
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 5591984a392b..ba3f85b7338f 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -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;
 }
diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 5b8368c76734..affd050ee409 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -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;
 	}
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 2e2ca3c6b47d..c8a0f856f84e 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -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);
 }
 
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index ba8d2804c1d1..72723a80b1e3 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -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);
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 1d714c06ec9d..d20a876ba4c6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -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;
 
diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
index db397fcb345a..aa805e2bc0fe 100644
--- a/drivers/gpu/drm/tve200/tve200_display.c
+++ b/drivers/gpu/drm/tve200/tve200_display.c
@@ -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) */
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 72c9dbd81d7f..a757a2670353 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -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:
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 675cc3f8cf85..aad3258facf2 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -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;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-27 12:56   ` Ville Syrjala
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, linux-renesas-soc, Daniel Vetter, intel-gfx,
	Alison Wang, Archit Taneja, Stefan Agner, Andrzej Hajda,
	Hans de Goede, Laurent Pinchart, Philipp Zabel, Manfred Schlaegl,
	Maxime Ripard, Linus Walleij

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: Marek Vasut <marex@denx.de>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Alison Wang <alison.wang@freescale.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 74d2efaec52f..1ba72dc2a85b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -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)
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
index 120dd3b26fc2..7e9f7f1ab1b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
@@ -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);
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index d73281095fac..2d18c8ef22a0 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -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;
 
diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
index b1ab4ab09532..abd0bce9c31e 100644
--- a/drivers/gpu/drm/bridge/sii902x.c
+++ b/drivers/gpu/drm/bridge/sii902x.c
@@ -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;
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 08ab7d6aea65..042ded9ca749 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -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);
 
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index b3cde897cd80..d73e97ed7dff 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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 */
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 035784ddd133..18cb63b30e33 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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;
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
index 0e3752437e44..2444c14639ef 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
@@ -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)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 563f193fcfac..6d608ce26076 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index e64960db3224..290221f73cbf 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 41e7f25ba7e0..605c86ded14f 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
index 8b2eb32ee988..c4e16ab25d1a 100644
--- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
+++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
@@ -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);
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
index e6943fef0611..4b8d2b6e7202 100644
--- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
+++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index be3eefec5152..fe4667eba85f 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index 84507912be84..3b31dde4c05a 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -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;
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 33fbf3965309..ed36b4e6e4ae 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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);
 	}
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index c8cf3d5c7783..3eaf9bb8498d 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index eb0c559b2715..68fe4587441f 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index cdae4934b885..c35f84642c79 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 0c14d1c04cbd..6309a1d9f87e 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -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);
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 56dd7a9a8e25..4909fe89e167 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -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. */
diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
index aedecda9728a..2aa80484a39d 100644
--- a/drivers/gpu/drm/imx/parallel-display.c
+++ b/drivers/gpu/drm/imx/parallel-display.c
@@ -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) {
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
index 0abe77675b76..0429006288d6 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
@@ -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;
 
diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
index b428c4678106..25958bc4c5ca 100644
--- a/drivers/gpu/drm/panel/panel-arm-versatile.c
+++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
@@ -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);
diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index b4ec0ecff807..1ba893942a2b 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -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)
diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index b5e3994f0aa8..b52095666bda 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -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;
 
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index d964d454e4ae..9526461c0eb3 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -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;
diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
index 71c09ed436ae..ffa9d1b6f863 100644
--- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
+++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
@@ -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;
 }
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 5591984a392b..ba3f85b7338f 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -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;
 }
diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 5b8368c76734..affd050ee409 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -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;
 	}
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 2e2ca3c6b47d..c8a0f856f84e 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -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);
 }
 
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index ba8d2804c1d1..72723a80b1e3 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -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);
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 1d714c06ec9d..d20a876ba4c6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -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;
 
diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
index db397fcb345a..aa805e2bc0fe 100644
--- a/drivers/gpu/drm/tve200/tve200_display.c
+++ b/drivers/gpu/drm/tve200/tve200_display.c
@@ -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) */
diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
index 72c9dbd81d7f..a757a2670353 100644
--- a/drivers/gpu/drm/vc4/vc4_dpi.c
+++ b/drivers/gpu/drm/vc4/vc4_dpi.c
@@ -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:
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 675cc3f8cf85..aad3258facf2 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -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;
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 05/11] drm/edid: Clear display info fully
  2018-02-27 12:56 ` Ville Syrjala
                   ` (4 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-02-28  8:58   ` Sharma, Shashank
  2018-03-06  9:33   ` Daniel Vetter
  -1 siblings, 2 replies; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_connector.c |  3 +--
 drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index d73e97ed7dff..ddd7d978f462 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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,
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 788fee4b4bf9..78c1f37be3db 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -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;
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID
  2018-02-27 12:56 ` Ville Syrjala
                   ` (5 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-03-06  9:45   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_connector.c | 4 ++--
 include/drm/drm_connector.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index ddd7d978f462..d8c3ef4f17da 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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,
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index aad3258facf2..8815ef1ce429 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -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(
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff
  2018-02-27 12:56 ` Ville Syrjala
                   ` (6 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-03-06  9:49   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Keith Packard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 527743394150..7dc7e635d7e4 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -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);
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes()
  2018-02-27 12:56 ` Ville Syrjala
                   ` (7 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-03-06 10:00   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index d8c3ef4f17da..2bf19a37dbac 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 78c1f37be3db..618093c4a039 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -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);
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 18cb63b30e33..f3eddbbd0616 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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;
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 1c5b5ce1fd7f..3c6e800b66a0 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -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);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 8815ef1ce429..bf14474c83f5 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -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
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 8d89a9c3748d..db5e6a990c2d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -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);
 
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 09/11] drm: Fix getconnector locking
  2018-02-27 12:56 ` Ville Syrjala
                   ` (8 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-03-06  9:55   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Keith Packard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

Cc: Keith Packard <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_connector.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 2bf19a37dbac..122060792b6f 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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;
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking
  2018-02-27 12:56 ` Ville Syrjala
                   ` (9 preceding siblings ...)
  (?)
@ 2018-02-27 12:56 ` Ville Syrjala
  2018-03-06  9:56   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:56 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Keith Packard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

Cc: Keith Packard <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_debugfs.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index b2482818fee8..caac17145629 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -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;
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-02-27 12:56 ` Ville Syrjala
                   ` (10 preceding siblings ...)
  (?)
@ 2018-02-27 12:57 ` Ville Syrjala
  2018-03-06  9:31   ` Daniel Vetter
  -1 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjala @ 2018-02-27 12:57 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, intel-gfx, Keith Packard

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 122060792b6f..a9f3536f4e94 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -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);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 618093c4a039..7f9e9236114b 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -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;
 
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 7dc7e635d7e4..2a2afcf72788 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -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);
 
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-27 13:08     ` Maxime Ripard
  -1 siblings, 0 replies; 50+ messages in thread
From: Maxime Ripard @ 2018-02-27 13:08 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: dri-devel, intel-gfx, Keith Packard, Daniel Vetter,
	Hans de Goede, Shashank Sharma, Stefan Agner, Thierry Reding,
	Boris Brezillon, Philipp Zabel, Laurent Pinchart,
	Manfred Schlaegl, Marek Vasut, Archit Taneja, Andrzej Hajda,
	Alison Wang, Eric Anholt, Linus Walleij, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

On Tue, Feb 27, 2018 at 02:56:53PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>

For sun4i,
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-27 13:08     ` Maxime Ripard
  0 siblings, 0 replies; 50+ messages in thread
From: Maxime Ripard @ 2018-02-27 13:08 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Marek Vasut, linux-renesas-soc, Keith Packard, Laurent Pinchart,
	Boris Brezillon, Daniel Vetter, intel-gfx, Alison Wang,
	dri-devel, Hans de Goede, Thierry Reding


[-- Attachment #1.1: Type: text/plain, Size: 1972 bytes --]

On Tue, Feb 27, 2018 at 02:56:53PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>

For sun4i,
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-27 13:23     ` Philipp Zabel
  -1 siblings, 0 replies; 50+ messages in thread
From: Philipp Zabel @ 2018-02-27 13:23 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: intel-gfx, Keith Packard, Daniel Vetter, Hans de Goede,
	Shashank Sharma, Stefan Agner, Thierry Reding, Boris Brezillon,
	Laurent Pinchart, Manfred Schlaegl, Marek Vasut, Archit Taneja,
	Andrzej Hajda, Alison Wang, Eric Anholt, Linus Walleij,
	linux-renesas-soc, Maxime Ripard

On Tue, 2018-02-27 at 14:56 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().

[...]
>  drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
>  drivers/gpu/drm/imx/parallel-display.c             |   2 +-

For imx-drm,
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-27 13:23     ` Philipp Zabel
  0 siblings, 0 replies; 50+ messages in thread
From: Philipp Zabel @ 2018-02-27 13:23 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: Marek Vasut, linux-renesas-soc, Keith Packard, Boris Brezillon,
	Daniel Vetter, intel-gfx, Alison Wang, Hans de Goede,
	Thierry Reding, Laurent Pinchart, Maxime Ripard

On Tue, 2018-02-27 at 14:56 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().

[...]
>  drivers/gpu/drm/imx/imx-ldb.c                      |   4 +-
>  drivers/gpu/drm/imx/parallel-display.c             |   2 +-

For imx-drm,
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* ✓ Fi.CI.BAT: success for drm: Try to make display info less nuts
  2018-02-27 12:56 ` Ville Syrjala
                   ` (11 preceding siblings ...)
  (?)
@ 2018-02-27 14:06 ` Patchwork
  -1 siblings, 0 replies; 50+ messages in thread
From: Patchwork @ 2018-02-27 14:06 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* ✗ Fi.CI.IGT: failure for drm: Try to make display info less nuts
  2018-02-27 12:56 ` Ville Syrjala
                   ` (12 preceding siblings ...)
  (?)
@ 2018-02-27 20:14 ` Patchwork
  -1 siblings, 0 replies; 50+ messages in thread
From: Patchwork @ 2018-02-27 20:14 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-28  4:58     ` Archit Taneja
  -1 siblings, 0 replies; 50+ messages in thread
From: Archit Taneja @ 2018-02-28  4:58 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: intel-gfx, Keith Packard, Daniel Vetter, Hans de Goede,
	Shashank Sharma, Stefan Agner, Thierry Reding, Boris Brezillon,
	Philipp Zabel, Laurent Pinchart, Manfred Schlaegl, Marek Vasut,
	Andrzej Hajda, Alison Wang, Eric Anholt, Linus Walleij,
	linux-renesas-soc, Maxime Ripard



On Tuesday 27 February 2018 06:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().
>

[...]

>   
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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:

Reviewed-by: Archit Taneja <architt@codeaurora.org>

Thanks,
Archit

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-28  4:58     ` Archit Taneja
  0 siblings, 0 replies; 50+ messages in thread
From: Archit Taneja @ 2018-02-28  4:58 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: Marek Vasut, linux-renesas-soc, Keith Packard, Boris Brezillon,
	Daniel Vetter, intel-gfx, Alison Wang, Hans de Goede,
	Thierry Reding, Laurent Pinchart, Maxime Ripard



On Tuesday 27 February 2018 06:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().
>

[...]

>   
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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:

Reviewed-by: Archit Taneja <architt@codeaurora.org>

Thanks,
Archit

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-28  8:46     ` Sharma, Shashank
  -1 siblings, 0 replies; 50+ messages in thread
From: Sharma, Shashank @ 2018-02-28  8:46 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: intel-gfx, Keith Packard, Daniel Vetter, Hans de Goede,
	Stefan Agner, Thierry Reding, Boris Brezillon, Philipp Zabel,
	Laurent Pinchart, Manfred Schlaegl, Marek Vasut, Archit Taneja,
	Andrzej Hajda, Alison Wang, Eric Anholt, Linus Walleij,
	linux-renesas-soc, Maxime Ripard

for I915: Acked-by: Shashank Sharma <shashank.sharma@intel.com>

Regards
Shashank
On 2/27/2018 6:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   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(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>   
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>   	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>   }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>   }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>   	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>   }
>   
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-28  8:46     ` Sharma, Shashank
  0 siblings, 0 replies; 50+ messages in thread
From: Sharma, Shashank @ 2018-02-28  8:46 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel
  Cc: Marek Vasut, linux-renesas-soc, Daniel Vetter, intel-gfx,
	Alison Wang, Archit Taneja, Stefan Agner, Andrzej Hajda,
	Hans de Goede, Laurent Pinchart, Philipp Zabel, Manfred Schlaegl,
	Maxime Ripard, Linus Walleij

for I915: Acked-by: Shashank Sharma <shashank.sharma@intel.com>

Regards
Shashank
On 2/27/2018 6:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   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(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>   
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>   	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>   }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>   }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>   	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>   }
>   
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>   
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully
  2018-02-27 12:56 ` [RFC][PATCH 05/11] drm/edid: Clear display info fully Ville Syrjala
@ 2018-02-28  8:58   ` Sharma, Shashank
  2018-03-06  9:33   ` Daniel Vetter
  1 sibling, 0 replies; 50+ messages in thread
From: Sharma, Shashank @ 2018-02-28  8:58 UTC (permalink / raw)
  To: Ville Syrjala, dri-devel; +Cc: Daniel Vetter, intel-gfx

Regards

Shashank


On 2/27/2018 6:26 PM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/drm_connector.c |  3 +--
>   drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
>   2 files changed, 4 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index d73e97ed7dff..ddd7d978f462 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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,
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 788fee4b4bf9..78c1f37be3db 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -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);
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
> +
>   	if (edid == NULL) {
>   		clear_eld(connector);
>   		return 0;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-28  9:17     ` Stefan Agner
  -1 siblings, 0 replies; 50+ messages in thread
From: Stefan Agner @ 2018-02-28  9:17 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: dri-devel, intel-gfx, Keith Packard, Daniel Vetter,
	Hans de Goede, Shashank Sharma, Thierry Reding, Boris Brezillon,
	Philipp Zabel, Laurent Pinchart, Manfred Schlaegl, Marek Vasut,
	Archit Taneja, Andrzej Hajda, Alison Wang, Eric Anholt,
	Linus Walleij, linux-renesas-soc, Maxime Ripard

On 27.02.2018 13:56, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().

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

So for the general idea/drm_connector.h:

Reviewed-by: Stefan Agner <stefan@agner.ch>

[...] 

>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-

For fsl-dcu:

Acked-by: Stefan Agner <stefan@agner.ch>

--
Stefan

>  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(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c
> b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>  
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>  	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c
> b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
> b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c
> b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c
> b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c
> b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c
> b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c
> b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>  	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
> b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>  }
>  
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c
> b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-28  9:17     ` Stefan Agner
  0 siblings, 0 replies; 50+ messages in thread
From: Stefan Agner @ 2018-02-28  9:17 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Marek Vasut, linux-renesas-soc, Keith Packard, Boris Brezillon,
	Daniel Vetter, intel-gfx, Alison Wang, dri-devel, Hans de Goede,
	Thierry Reding, Laurent Pinchart, Maxime Ripard

On 27.02.2018 13:56, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().

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

So for the general idea/drm_connector.h:

Reviewed-by: Stefan Agner <stefan@agner.ch>

[...] 

>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c         |   2 +-

For fsl-dcu:

Acked-by: Stefan Agner <stefan@agner.ch>

--
Stefan

>  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(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c
> b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>  
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>  	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c
> b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
> b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c
> b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c
> b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c
> b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c
> b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c
> b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>  	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c
> b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>  }
>  
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c
> b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-02-28 21:11     ` Alex Deucher
  -1 siblings, 0 replies; 50+ messages in thread
From: Alex Deucher @ 2018-02-28 21:11 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Maling list - DRI developers, Marek Vasut, linux-renesas-soc,
	Keith Packard, Boris Brezillon, Daniel Vetter,
	Intel Graphics Development, Alison Wang, Hans de Goede,
	Thierry Reding, Laurent Pinchart, Maxime Ripard

On Tue, Feb 27, 2018 at 7:56 AM, Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-02-28 21:11     ` Alex Deucher
  0 siblings, 0 replies; 50+ messages in thread
From: Alex Deucher @ 2018-02-28 21:11 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Marek Vasut, Keith Packard, Alison Wang, Maxime Ripard,
	Daniel Vetter, Intel Graphics Development,
	Maling list - DRI developers, linux-renesas-soc, Boris Brezillon,
	Thierry Reding, Hans de Goede, Laurent Pinchart

On Tue, Feb 27, 2018 at 7:56 AM, Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-03-02  7:59     ` Linus Walleij
  -1 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2018-03-02  7:59 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: open list:DRM PANEL DRIVERS, intel-gfx, Keith Packard,
	Daniel Vetter, Hans de Goede, Shashank Sharma, Stefan Agner,
	Thierry Reding, Boris Brezillon, Philipp Zabel, Laurent Pinchart,
	Manfred Schlaegl, Marek Vasut, Archit Taneja, Andrzej Hajda,
	Alison Wang, Eric Anholt, Linux-Renesas, Maxime Ripard

On Tue, Feb 27, 2018 at 1:56 PM, Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-03-02  7:59     ` Linus Walleij
  0 siblings, 0 replies; 50+ messages in thread
From: Linus Walleij @ 2018-03-02  7:59 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Marek Vasut, Linux-Renesas, Keith Packard, Laurent Pinchart,
	Boris Brezillon, Daniel Vetter, intel-gfx, Alison Wang,
	open list:DRM PANEL DRIVERS, Hans de Goede, Thierry Reding,
	Maxime Ripard

On Tue, Feb 27, 2018 at 1:56 PM, Ville Syrjala
<ville.syrjala@linux.intel.com> wrote:

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-02-27 12:57 ` [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info Ville Syrjala
@ 2018-03-06  9:31   ` Daniel Vetter
  2018-03-06 12:18     ` Ville Syrjälä
  0 siblings, 1 reply; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:31 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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

> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 122060792b6f..a9f3536f4e94 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 618093c4a039..7f9e9236114b 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 7dc7e635d7e4..2a2afcf72788 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -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);
>  
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully
  2018-02-27 12:56 ` [RFC][PATCH 05/11] drm/edid: Clear display info fully Ville Syrjala
  2018-02-28  8:58   ` Sharma, Shashank
@ 2018-03-06  9:33   ` Daniel Vetter
  2018-03-06  9:42     ` Daniel Vetter
  2018-03-06  9:52     ` Daniel Vetter
  1 sibling, 2 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:33 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Feb 27, 2018 at 02:56:54PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/drm_connector.c |  3 +--
>  drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
>  2 files changed, 4 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index d73e97ed7dff..ddd7d978f462 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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,
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 788fee4b4bf9..78c1f37be3db 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -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;
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
  2018-02-27 12:56   ` Ville Syrjala
@ 2018-03-06  9:41     ` Daniel Vetter
  -1 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:41 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: dri-devel, intel-gfx, Keith Packard, Daniel Vetter,
	Hans de Goede, Shashank Sharma, Stefan Agner, Thierry Reding,
	Boris Brezillon, Philipp Zabel, Laurent Pinchart,
	Manfred Schlaegl, Marek Vasut, Archit Taneja, Andrzej Hajda,
	Alison Wang, Eric Anholt, Linus Walleij, linux-renesas-soc,
	Maxime Ripard

On Tue, Feb 27, 2018 at 02:56:53PM +0200, Ville Syrjala wrote:
> From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> 
> 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().

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
> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>  
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>  	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>  	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>  }
>  
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts
@ 2018-03-06  9:41     ` Daniel Vetter
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:41 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: Marek Vasut, linux-renesas-soc, Keith Packard, Laurent Pinchart,
	Boris Brezillon, Daniel Vetter, intel-gfx, Alison Wang,
	dri-devel, Hans de Goede, Thierry Reding, Maxime Ripard

On Tue, Feb 27, 2018 at 02:56:53PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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().

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
> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Alison Wang <alison.wang@freescale.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> index 74d2efaec52f..1ba72dc2a85b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
> @@ -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)
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> index 120dd3b26fc2..7e9f7f1ab1b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c
> @@ -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);
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index d73281095fac..2d18c8ef22a0 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> index b1ab4ab09532..abd0bce9c31e 100644
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
> @@ -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;
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 08ab7d6aea65..042ded9ca749 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -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);
>  
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index b3cde897cd80..d73e97ed7dff 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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 */
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 035784ddd133..18cb63b30e33 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> index 0e3752437e44..2444c14639ef 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_crtc.c
> @@ -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)
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 563f193fcfac..6d608ce26076 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index e64960db3224..290221f73cbf 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> index 41e7f25ba7e0..605c86ded14f 100644
> --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> index 8b2eb32ee988..c4e16ab25d1a 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c
> @@ -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);
> diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds.c b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> index e6943fef0611..4b8d2b6e7202 100644
> --- a/drivers/gpu/drm/gma500/oaktrail_lvds.c
> +++ b/drivers/gpu/drm/gma500/oaktrail_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> index be3eefec5152..fe4667eba85f 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> index 84507912be84..3b31dde4c05a 100644
> --- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> +++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 33fbf3965309..ed36b4e6e4ae 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -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);
>  	}
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index c8cf3d5c7783..3eaf9bb8498d 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
> index eb0c559b2715..68fe4587441f 100644
> --- a/drivers/gpu/drm/i915/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/intel_dvo.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index cdae4934b885..c35f84642c79 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> index 0c14d1c04cbd..6309a1d9f87e 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -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);
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 56dd7a9a8e25..4909fe89e167 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -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. */
> diff --git a/drivers/gpu/drm/imx/parallel-display.c b/drivers/gpu/drm/imx/parallel-display.c
> index aedecda9728a..2aa80484a39d 100644
> --- a/drivers/gpu/drm/imx/parallel-display.c
> +++ b/drivers/gpu/drm/imx/parallel-display.c
> @@ -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) {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> index 0abe77675b76..0429006288d6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-arm-versatile.c b/drivers/gpu/drm/panel/panel-arm-versatile.c
> index b428c4678106..25958bc4c5ca 100644
> --- a/drivers/gpu/drm/panel/panel-arm-versatile.c
> +++ b/drivers/gpu/drm/panel/panel-arm-versatile.c
> @@ -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);
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index b4ec0ecff807..1ba893942a2b 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -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)
> diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
> index b5e3994f0aa8..b52095666bda 100644
> --- a/drivers/gpu/drm/panel/panel-lvds.c
> +++ b/drivers/gpu/drm/panel/panel-lvds.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> index d964d454e4ae..9526461c0eb3 100644
> --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
> @@ -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;
> diff --git a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> index 71c09ed436ae..ffa9d1b6f863 100644
> --- a/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> +++ b/drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 5591984a392b..ba3f85b7338f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -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;
>  }
> diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
> index 5b8368c76734..affd050ee409 100644
> --- a/drivers/gpu/drm/pl111/pl111_display.c
> +++ b/drivers/gpu/drm/pl111/pl111_display.c
> @@ -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;
>  	}
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2e2ca3c6b47d..c8a0f856f84e 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -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);
>  }
>  
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index ba8d2804c1d1..72723a80b1e3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -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);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 1d714c06ec9d..d20a876ba4c6 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c
> index db397fcb345a..aa805e2bc0fe 100644
> --- a/drivers/gpu/drm/tve200/tve200_display.c
> +++ b/drivers/gpu/drm/tve200/tve200_display.c
> @@ -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) */
> diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c
> index 72c9dbd81d7f..a757a2670353 100644
> --- a/drivers/gpu/drm/vc4/vc4_dpi.c
> +++ b/drivers/gpu/drm/vc4/vc4_dpi.c
> @@ -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:
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 675cc3f8cf85..aad3258facf2 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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;
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully
  2018-03-06  9:33   ` Daniel Vetter
@ 2018-03-06  9:42     ` Daniel Vetter
  2018-03-06  9:52     ` Daniel Vetter
  1 sibling, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:42 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Mar 06, 2018 at 10:33:31AM +0100, Daniel Vetter wrote:
> On Tue, Feb 27, 2018 at 02:56:54PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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 <keithp@keithp.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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

> -Daniel
> 
> > ---
> >  drivers/gpu/drm/drm_connector.c |  3 +--
> >  drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
> >  2 files changed, 4 insertions(+), 22 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index d73e97ed7dff..ddd7d978f462 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -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,
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 788fee4b4bf9..78c1f37be3db 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -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;
> > -- 
> > 2.13.6
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID
  2018-02-27 12:56 ` [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID Ville Syrjala
@ 2018-03-06  9:45   ` Daniel Vetter
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:45 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Feb 27, 2018 at 02:56:55PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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.

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.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_connector.c | 4 ++--
>  include/drm/drm_connector.h     | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index ddd7d978f462..d8c3ef4f17da 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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,
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index aad3258facf2..8815ef1ce429 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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(
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff
  2018-02-27 12:56 ` [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff Ville Syrjala
@ 2018-03-06  9:49   ` Daniel Vetter
  2018-03-06 11:48     ` Ville Syrjälä
  0 siblings, 1 reply; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:49 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Feb 27, 2018 at 02:56:56PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>


> ---
>  drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 527743394150..7dc7e635d7e4 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -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);
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 05/11] drm/edid: Clear display info fully
  2018-03-06  9:33   ` Daniel Vetter
  2018-03-06  9:42     ` Daniel Vetter
@ 2018-03-06  9:52     ` Daniel Vetter
  1 sibling, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:52 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Mar 06, 2018 at 10:33:31AM +0100, Daniel Vetter wrote:
> On Tue, Feb 27, 2018 at 02:56:54PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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 <keithp@keithp.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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

> -Daniel
> 
> > ---
> >  drivers/gpu/drm/drm_connector.c |  3 +--
> >  drivers/gpu/drm/drm_edid.c      | 23 +++--------------------
> >  2 files changed, 4 insertions(+), 22 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index d73e97ed7dff..ddd7d978f462 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -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,
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 788fee4b4bf9..78c1f37be3db 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -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;
> > -- 
> > 2.13.6
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 09/11] drm: Fix getconnector locking
  2018-02-27 12:56 ` [RFC][PATCH 09/11] drm: Fix getconnector locking Ville Syrjala
@ 2018-03-06  9:55   ` Daniel Vetter
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:55 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Feb 27, 2018 at 02:56:58PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The edid is protected by mode_config.mutex so extend the locking to
> protect the property readout part as well.
> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

> ---
>  drivers/gpu/drm/drm_connector.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 2bf19a37dbac..122060792b6f 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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;
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking
  2018-02-27 12:56 ` [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking Ville Syrjala
@ 2018-03-06  9:56   ` Daniel Vetter
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06  9:56 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Feb 27, 2018 at 02:56:59PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The edid is protected by mode_config.mutex. Grab the lock when frobbing
> the debugfs edid_override thing.
> 
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_debugfs.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index b2482818fee8..caac17145629 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -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;
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes()
  2018-02-27 12:56 ` [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes() Ville Syrjala
@ 2018-03-06 10:00   ` Daniel Vetter
  2018-03-06 10:30     ` Ville Syrjälä
  0 siblings, 1 reply; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06 10:00 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Feb 27, 2018 at 02:56:57PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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 <keithp@keithp.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

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
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index d8c3ef4f17da..2bf19a37dbac 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 78c1f37be3db..618093c4a039 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -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);
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 18cb63b30e33..f3eddbbd0616 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -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;
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index 1c5b5ce1fd7f..3c6e800b66a0 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -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);
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 8815ef1ce429..bf14474c83f5 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 8d89a9c3748d..db5e6a990c2d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -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);
>  
> -- 
> 2.13.6
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes()
  2018-03-06 10:00   ` Daniel Vetter
@ 2018-03-06 10:30     ` Ville Syrjälä
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjälä @ 2018-03-06 10:30 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Mar 06, 2018 at 11:00:30AM +0100, Daniel Vetter wrote:
> On Tue, Feb 27, 2018 at 02:56:57PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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 <keithp@keithp.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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.

> - 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.

> 
> Cheers, Daniel
> > ---
> >  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(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index d8c3ef4f17da..2bf19a37dbac 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 78c1f37be3db..618093c4a039 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> > index 18cb63b30e33..f3eddbbd0616 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -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;
> > diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> > index 1c5b5ce1fd7f..3c6e800b66a0 100644
> > --- a/drivers/gpu/drm/drm_sysfs.c
> > +++ b/drivers/gpu/drm/drm_sysfs.c
> > @@ -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);
> > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > index 8815ef1ce429..bf14474c83f5 100644
> > --- a/include/drm/drm_connector.h
> > +++ b/include/drm/drm_connector.h
> > @@ -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
> > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> > index 8d89a9c3748d..db5e6a990c2d 100644
> > --- a/include/drm/drm_edid.h
> > +++ b/include/drm/drm_edid.h
> > @@ -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);
> >  
> > -- 
> > 2.13.6
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff
  2018-03-06  9:49   ` Daniel Vetter
@ 2018-03-06 11:48     ` Ville Syrjälä
  0 siblings, 0 replies; 50+ messages in thread
From: Ville Syrjälä @ 2018-03-06 11:48 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Mar 06, 2018 at 10:49:43AM +0100, Daniel Vetter wrote:
> On Tue, Feb 27, 2018 at 02:56:56PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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 <keithp@keithp.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> 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.

> 
> 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.

> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> 
> > ---
> >  drivers/gpu/drm/drm_probe_helper.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index 527743394150..7dc7e635d7e4 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -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);
> > -- 
> > 2.13.6
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-03-06  9:31   ` Daniel Vetter
@ 2018-03-06 12:18     ` Ville Syrjälä
  2018-03-06 16:23       ` Harry Wentland
  0 siblings, 1 reply; 50+ messages in thread
From: Ville Syrjälä @ 2018-03-06 12:18 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, Keith Packard, dri-devel

On Tue, Mar 06, 2018 at 10:31:27AM +0100, Daniel Vetter wrote:
> On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > 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)?

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

> 
> Otherwise I think this is a real good patch.
> 
> Thanks, Daniel
> 
> > 
> > Cc: Keith Packard <keithp@keithp.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Harry Wentland <harry.wentland@amd.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  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(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index 122060792b6f..a9f3536f4e94 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -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);
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 618093c4a039..7f9e9236114b 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -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;
> >  
> > diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> > index 7dc7e635d7e4..2a2afcf72788 100644
> > --- a/drivers/gpu/drm/drm_probe_helper.c
> > +++ b/drivers/gpu/drm/drm_probe_helper.c
> > @@ -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);
> >  
> > -- 
> > 2.13.6
> > 
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-03-06 12:18     ` Ville Syrjälä
@ 2018-03-06 16:23       ` Harry Wentland
  2018-03-06 17:13         ` Daniel Vetter
  0 siblings, 1 reply; 50+ messages in thread
From: Harry Wentland @ 2018-03-06 16:23 UTC (permalink / raw)
  To: Ville Syrjälä, Daniel Vetter
  Cc: Daniel Vetter, intel-gfx, dri-devel

On 2018-03-06 07:18 AM, Ville Syrjälä wrote:
> On Tue, Mar 06, 2018 at 10:31:27AM +0100, Daniel Vetter wrote:
>> On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> 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)?
> 
> 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

>>
>> Otherwise I think this is a real good patch.
>>
>> Thanks, Daniel
>>
>>>
>>> Cc: Keith Packard <keithp@keithp.com>
>>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>>> Cc: Harry Wentland <harry.wentland@amd.com>
>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> ---
>>>  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(-)
>>>
>>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>>> index 122060792b6f..a9f3536f4e94 100644
>>> --- a/drivers/gpu/drm/drm_connector.c
>>> +++ b/drivers/gpu/drm/drm_connector.c
>>> @@ -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);
>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>> index 618093c4a039..7f9e9236114b 100644
>>> --- a/drivers/gpu/drm/drm_edid.c
>>> +++ b/drivers/gpu/drm/drm_edid.c
>>> @@ -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;
>>>  
>>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>>> index 7dc7e635d7e4..2a2afcf72788 100644
>>> --- a/drivers/gpu/drm/drm_probe_helper.c
>>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>>> @@ -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);
>>>  
>>> -- 
>>> 2.13.6
>>>
>>
>> -- 
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> http://blog.ffwll.ch
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-03-06 16:23       ` Harry Wentland
@ 2018-03-06 17:13         ` Daniel Vetter
  2018-03-06 18:32           ` Harry Wentland
  0 siblings, 1 reply; 50+ messages in thread
From: Daniel Vetter @ 2018-03-06 17:13 UTC (permalink / raw)
  To: Harry Wentland; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Mar 06, 2018 at 11:23:23AM -0500, Harry Wentland wrote:
> On 2018-03-06 07:18 AM, Ville Syrjälä wrote:
> > On Tue, Mar 06, 2018 at 10:31:27AM +0100, Daniel Vetter wrote:
> >> On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
> >>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>>
> >>> 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)?
> > 
> > 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.

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

> 
> Harry
> 
> >>
> >> Otherwise I think this is a real good patch.
> >>
> >> Thanks, Daniel
> >>
> >>>
> >>> Cc: Keith Packard <keithp@keithp.com>
> >>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>> Cc: Harry Wentland <harry.wentland@amd.com>
> >>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>> ---
> >>>  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(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> >>> index 122060792b6f..a9f3536f4e94 100644
> >>> --- a/drivers/gpu/drm/drm_connector.c
> >>> +++ b/drivers/gpu/drm/drm_connector.c
> >>> @@ -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);
> >>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >>> index 618093c4a039..7f9e9236114b 100644
> >>> --- a/drivers/gpu/drm/drm_edid.c
> >>> +++ b/drivers/gpu/drm/drm_edid.c
> >>> @@ -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;
> >>>  
> >>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> >>> index 7dc7e635d7e4..2a2afcf72788 100644
> >>> --- a/drivers/gpu/drm/drm_probe_helper.c
> >>> +++ b/drivers/gpu/drm/drm_probe_helper.c
> >>> @@ -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);
> >>>  
> >>> -- 
> >>> 2.13.6
> >>>
> >>
> >> -- 
> >> Daniel Vetter
> >> Software Engineer, Intel Corporation
> >> http://blog.ffwll.ch
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-03-06 17:13         ` Daniel Vetter
@ 2018-03-06 18:32           ` Harry Wentland
  2018-03-07 16:26             ` Daniel Vetter
  0 siblings, 1 reply; 50+ messages in thread
From: Harry Wentland @ 2018-03-06 18:32 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Keith Packard, Daniel Vetter, intel-gfx, dri-devel



On 2018-03-06 12:13 PM, Daniel Vetter wrote:
> On Tue, Mar 06, 2018 at 11:23:23AM -0500, Harry Wentland wrote:
>> On 2018-03-06 07:18 AM, Ville Syrjälä wrote:
>>> On Tue, Mar 06, 2018 at 10:31:27AM +0100, Daniel Vetter wrote:
>>>> On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
>>>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>>
>>>>> 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)?
>>>
>>> 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.
> 
> 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


> 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
> 
>>
>> Harry
>>
>>>>
>>>> Otherwise I think this is a real good patch.
>>>>
>>>> Thanks, Daniel
>>>>
>>>>>
>>>>> Cc: Keith Packard <keithp@keithp.com>
>>>>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>>>>> Cc: Harry Wentland <harry.wentland@amd.com>
>>>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>> ---
>>>>>  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(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>>>>> index 122060792b6f..a9f3536f4e94 100644
>>>>> --- a/drivers/gpu/drm/drm_connector.c
>>>>> +++ b/drivers/gpu/drm/drm_connector.c
>>>>> @@ -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);
>>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>>> index 618093c4a039..7f9e9236114b 100644
>>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>>> @@ -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;
>>>>>  
>>>>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>>>>> index 7dc7e635d7e4..2a2afcf72788 100644
>>>>> --- a/drivers/gpu/drm/drm_probe_helper.c
>>>>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>>>>> @@ -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);
>>>>>  
>>>>> -- 
>>>>> 2.13.6
>>>>>
>>>>
>>>> -- 
>>>> Daniel Vetter
>>>> Software Engineer, Intel Corporation
>>>> http://blog.ffwll.ch
>>>
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info
  2018-03-06 18:32           ` Harry Wentland
@ 2018-03-07 16:26             ` Daniel Vetter
  0 siblings, 0 replies; 50+ messages in thread
From: Daniel Vetter @ 2018-03-07 16:26 UTC (permalink / raw)
  To: Harry Wentland; +Cc: Daniel Vetter, intel-gfx, dri-devel

On Tue, Mar 06, 2018 at 01:32:21PM -0500, Harry Wentland wrote:
> 
> 
> On 2018-03-06 12:13 PM, Daniel Vetter wrote:
> > On Tue, Mar 06, 2018 at 11:23:23AM -0500, Harry Wentland wrote:
> >> On 2018-03-06 07:18 AM, Ville Syrj??l?? wrote:
> >>> On Tue, Mar 06, 2018 at 10:31:27AM +0100, Daniel Vetter wrote:
> >>>> On Tue, Feb 27, 2018 at 02:57:00PM +0200, Ville Syrjala wrote:
> >>>>> From: Ville Syrj??l?? <ville.syrjala@linux.intel.com>
> >>>>>
> >>>>> 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)?
> >>>
> >>> 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.
> > 
> > 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

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

> 
> Harry
> 
> 
> > 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
> > 
> >>
> >> Harry
> >>
> >>>>
> >>>> Otherwise I think this is a real good patch.
> >>>>
> >>>> Thanks, Daniel
> >>>>
> >>>>>
> >>>>> Cc: Keith Packard <keithp@keithp.com>
> >>>>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>>>> Cc: Harry Wentland <harry.wentland@amd.com>
> >>>>> Signed-off-by: Ville Syrj??l?? <ville.syrjala@linux.intel.com>
> >>>>> ---
> >>>>>  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(-)
> >>>>>
> >>>>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> >>>>> index 122060792b6f..a9f3536f4e94 100644
> >>>>> --- a/drivers/gpu/drm/drm_connector.c
> >>>>> +++ b/drivers/gpu/drm/drm_connector.c
> >>>>> @@ -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);
> >>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >>>>> index 618093c4a039..7f9e9236114b 100644
> >>>>> --- a/drivers/gpu/drm/drm_edid.c
> >>>>> +++ b/drivers/gpu/drm/drm_edid.c
> >>>>> @@ -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;
> >>>>>  
> >>>>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> >>>>> index 7dc7e635d7e4..2a2afcf72788 100644
> >>>>> --- a/drivers/gpu/drm/drm_probe_helper.c
> >>>>> +++ b/drivers/gpu/drm/drm_probe_helper.c
> >>>>> @@ -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);
> >>>>>  
> >>>>> -- 
> >>>>> 2.13.6
> >>>>>
> >>>>
> >>>> -- 
> >>>> Daniel Vetter
> >>>> Software Engineer, Intel Corporation
> >>>> http://blog.ffwll.ch
> >>>
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2018-03-07 16:26 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 12:56 [RFC][PATCH 00/11] drm: Try to make display info less nuts Ville Syrjala
2018-02-27 12:56 ` Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 01/11] drm/gma500: Fill display_info.{width, height}_mm from .get_modes() Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 02/11] drm/i915: " Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width,height}_mm at init time Ville Syrjala
2018-02-27 12:56   ` [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width, height}_mm " Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts Ville Syrjala
2018-02-27 12:56   ` Ville Syrjala
2018-02-27 13:08   ` Maxime Ripard
2018-02-27 13:08     ` Maxime Ripard
2018-02-27 13:23   ` Philipp Zabel
2018-02-27 13:23     ` Philipp Zabel
2018-02-28  4:58   ` Archit Taneja
2018-02-28  4:58     ` Archit Taneja
2018-02-28  8:46   ` Sharma, Shashank
2018-02-28  8:46     ` Sharma, Shashank
2018-02-28  9:17   ` Stefan Agner
2018-02-28  9:17     ` Stefan Agner
2018-02-28 21:11   ` Alex Deucher
2018-02-28 21:11     ` Alex Deucher
2018-03-02  7:59   ` Linus Walleij
2018-03-02  7:59     ` Linus Walleij
2018-03-06  9:41   ` Daniel Vetter
2018-03-06  9:41     ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 05/11] drm/edid: Clear display info fully Ville Syrjala
2018-02-28  8:58   ` Sharma, Shashank
2018-03-06  9:33   ` Daniel Vetter
2018-03-06  9:42     ` Daniel Vetter
2018-03-06  9:52     ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID Ville Syrjala
2018-03-06  9:45   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff Ville Syrjala
2018-03-06  9:49   ` Daniel Vetter
2018-03-06 11:48     ` Ville Syrjälä
2018-02-27 12:56 ` [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes() Ville Syrjala
2018-03-06 10:00   ` Daniel Vetter
2018-03-06 10:30     ` Ville Syrjälä
2018-02-27 12:56 ` [RFC][PATCH 09/11] drm: Fix getconnector locking Ville Syrjala
2018-03-06  9:55   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking Ville Syrjala
2018-03-06  9:56   ` Daniel Vetter
2018-02-27 12:57 ` [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info Ville Syrjala
2018-03-06  9:31   ` Daniel Vetter
2018-03-06 12:18     ` Ville Syrjälä
2018-03-06 16:23       ` Harry Wentland
2018-03-06 17:13         ` Daniel Vetter
2018-03-06 18:32           ` Harry Wentland
2018-03-07 16:26             ` Daniel Vetter
2018-02-27 14:06 ` ✓ Fi.CI.BAT: success for drm: Try to make display info less nuts Patchwork
2018-02-27 20:14 ` ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.