lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  8 Mar 2016 17:39:55 +0100
From:	Sebastian Reichel <sre@...nel.org>
To:	Sebastian Reichel <sre@...nel.org>,
	Tony Lindgren <tony@...mide.com>,
	Aaro Koskinen <aaro.koskinen@....fi>,
	Tomi Valkeinen <tomi.valkeinen@...com>
Cc:	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	David Airlie <airlied@...ux.ie>, linux-omap@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH 23/23] drm: omapdrm: panel-dsi-cm: provide timings methods for omapdrm

Provide omapdrm with methods to acquire timings
and check them later, so that it can properly
initialize the display.

Signed-off-by: Sebastian Reichel <sre@...nel.org>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 38 +++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 196fe8d18ff4..edd1298b3a71 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -1163,6 +1163,41 @@ static void dsicm_ulps_work(struct work_struct *work)
 	mutex_unlock(&ddata->lock);
 }
 
+static void dsicm_get_timings(struct omap_dss_device *dssdev,
+		struct omap_video_timings *timings)
+{
+	struct panel_drv_data *ddata = to_panel_data(dssdev);
+
+	*timings = ddata->timings;
+}
+
+static int dsicm_check_timings(struct omap_dss_device *dssdev,
+		struct omap_video_timings *timings)
+{
+	struct panel_drv_data *ddata = to_panel_data(dssdev);
+	int ret = 0;
+
+	if (timings->x_res != ddata->timings.x_res)
+		ret = -EINVAL;
+	else if (timings->y_res != ddata->timings.y_res)
+		ret = -EINVAL;
+
+	/* pixelclock is modified by dsi, so not easily checkable */
+
+	/* vfp, vbp, hfp, hbp are (re-)configured automatically by dsi */
+
+	if (ret) {
+		dev_warn(dssdev->dev, "wrong resolution: %d x %d",
+			timings->x_res, timings->y_res);
+		dev_warn(dssdev->dev, "panel resolution: %d x %d",
+			ddata->timings.x_res, ddata->timings.y_res);
+	} else {
+		dev_dbg(dssdev->dev, "mode check: ok");
+	}
+
+	return ret;
+}
+
 static struct omap_dss_driver dsicm_ops = {
 	.connect	= dsicm_connect,
 	.disconnect	= dsicm_disconnect,
@@ -1180,6 +1215,9 @@ static struct omap_dss_driver dsicm_ops = {
 	.get_te		= dsicm_get_te,
 
 	.memory_read	= dsicm_memory_read,
+
+	.get_timings	= dsicm_get_timings,
+	.check_timings	= dsicm_check_timings,
 };
 
 static int dsicm_probe_pdata(struct platform_device *pdev)
-- 
2.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ