arm-sdk

os build toolkit for various embedded devices
git clone https://git.parazyd.org/arm-sdk
Log | Files | Refs | Submodules | README | LICENSE

0010-drm-omap-panel-dsi-cm-add-physical-size-support.patch (2093B)


      1 From 7561ba59ec083593412b8794dd3221fdca2ab49e Mon Sep 17 00:00:00 2001
      2 From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
      3 Date: Mon, 24 Jul 2017 19:33:07 +0200
      4 Subject: [PATCH 10/17] drm/omap: panel-dsi-cm: add physical size support
      5 
      6 Add support to load physical size information from DT using
      7 the properties defined by the common panel binding.
      8 
      9 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
     10 ---
     11  drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 19 +++++++++++++++++++
     12  1 file changed, 19 insertions(+)
     13 
     14 diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
     15 index b98ea9e..8459139 100644
     16 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
     17 +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
     18 @@ -66,6 +66,9 @@ struct panel_drv_data {
     19  
     20  	bool use_dsi_backlight;
     21  
     22 +	int width_mm;
     23 +	int height_mm;
     24 +
     25  	struct omap_dsi_pin_config pin_config;
     26  
     27  	/* runtime variables */
     28 @@ -1163,6 +1166,15 @@ static int dsicm_check_timings(struct omap_dss_device *dssdev,
     29  	return ret;
     30  }
     31  
     32 +static void dsicm_get_size(struct omap_dss_device *dssdev,
     33 +			  unsigned int *width, unsigned int *height)
     34 +{
     35 +	struct panel_drv_data *ddata = to_panel_data(dssdev);
     36 +
     37 +	*width = ddata->width_mm;
     38 +	*height = ddata->height_mm;
     39 +}
     40 +
     41  static struct omap_dss_driver dsicm_ops = {
     42  	.connect	= dsicm_connect,
     43  	.disconnect	= dsicm_disconnect,
     44 @@ -1175,6 +1187,7 @@ static struct omap_dss_driver dsicm_ops = {
     45  
     46  	.get_timings	= dsicm_get_timings,
     47  	.check_timings	= dsicm_check_timings,
     48 +	.get_size	= dsicm_get_size,
     49  
     50  	.enable_te	= dsicm_enable_te,
     51  	.get_te		= dsicm_get_te,
     52 @@ -1216,6 +1229,12 @@ static int dsicm_probe_of(struct platform_device *pdev)
     53  			 "failed to get video timing, using defaults\n");
     54  	}
     55  
     56 +	ddata->width_mm = 0;
     57 +	of_property_read_u32(node, "width-mm", &ddata->width_mm);
     58 +
     59 +	ddata->height_mm = 0;
     60 +	of_property_read_u32(node, "height-mm", &ddata->height_mm);
     61 +
     62  	in = omapdss_of_find_source_for_first_ep(node);
     63  	if (IS_ERR(in)) {
     64  		dev_err(&pdev->dev, "failed to find video source\n");
     65 -- 
     66 2.1.4
     67