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

Ville Syrjala ville.syrjala at linux.intel.com
Tue Feb 27 12:56:50 UTC 2018


From: Ville Syrjälä <ville.syrjala at 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 at keithp.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Patrik Jakobsson <patrik.r.jakobsson at gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala at 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



More information about the dri-devel mailing list