arm-sdk

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

0001-PATCHv2-5-8-drm-omap-add-support-for-orientation-hints-from-display-drivers.patch (3149B)


      1 From patchwork Thu Feb  8 18:30:32 2018
      2 Content-Type: text/plain; charset="utf-8"
      3 MIME-Version: 1.0
      4 Content-Transfer-Encoding: 7bit
      5 Subject: [PATCHv2,
      6  5/8] drm/omap: add support for orientation hints from display drivers
      7 From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
      8 X-Patchwork-Id: 10207733
      9 Message-Id: <20180208183035.8461-6-sebastian.reichel@collabora.co.uk>
     10 To: Sebastian Reichel <sre@kernel.org>,
     11  Tomi Valkeinen <tomi.valkeinen@ti.com>, Tony Lindgren <tony@atomide.com>
     12 Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
     13  Hans de Goede <hdegoede@redhat.com>, Rob Herring <robh+dt@kernel.org>,
     14  Mark Rutland <mark.rutland@arm.com>,
     15  dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
     16  linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
     17  kernel@collabora.com, Sebastian Reichel <sebastian.reichel@collabora.co.uk>
     18 Date: Thu,  8 Feb 2018 19:30:32 +0100
     19 
     20 This adds support for setting DRM panel orientation property
     21 based on information from the display driver.
     22 
     23 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
     24 ---
     25  drivers/gpu/drm/omapdrm/dss/omapdss.h    |  2 ++
     26  drivers/gpu/drm/omapdrm/omap_connector.c | 10 +++++++++-
     27  2 files changed, 11 insertions(+), 1 deletion(-)
     28 
     29 diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
     30 index f8f83e826a56..72ebd82409d3 100644
     31 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
     32 +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
     33 @@ -565,6 +565,8 @@ struct omap_dss_driver {
     34  			    struct videomode *vm);
     35  	void (*get_size)(struct omap_dss_device *dssdev,
     36  			 unsigned int *width, unsigned int *height);
     37 +	void (*get_orientation)(struct omap_dss_device *dssdev,
     38 +				int *orientation);
     39  
     40  	int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
     41  	u32 (*get_wss)(struct omap_dss_device *dssdev);
     42 diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
     43 index a33b51484b2d..2f296d29b74b 100644
     44 --- a/drivers/gpu/drm/omapdrm/omap_connector.c
     45 +++ b/drivers/gpu/drm/omapdrm/omap_connector.c
     46 @@ -249,6 +249,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
     47  	struct drm_connector *connector = NULL;
     48  	struct omap_connector *omap_connector;
     49  	bool hpd_supported = false;
     50 +	int ret;
     51  
     52  	DBG("%s", dssdev->name);
     53  
     54 @@ -267,7 +268,7 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
     55  	drm_connector_helper_add(connector, &omap_connector_helper_funcs);
     56  
     57  	if (dssdev->driver->register_hpd_cb) {
     58 -		int ret = dssdev->driver->register_hpd_cb(dssdev,
     59 +		ret = dssdev->driver->register_hpd_cb(dssdev,
     60  							  omap_connector_hpd_cb,
     61  							  omap_connector);
     62  		if (!ret)
     63 @@ -288,6 +289,13 @@ struct drm_connector *omap_connector_init(struct drm_device *dev,
     64  	connector->interlace_allowed = 1;
     65  	connector->doublescan_allowed = 0;
     66  
     67 +	if (dssdev->driver->get_orientation)
     68 +		dssdev->driver->get_orientation(dssdev, &connector->display_info.panel_orientation);
     69 +
     70 +	ret = drm_connector_init_panel_orientation_property(connector, 0, 0);
     71 +	if (ret)
     72 +		DBG("%s: Failed to init orientation property (%d)", dssdev->name, ret);
     73 +
     74  	return connector;
     75  
     76  fail: