Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933353AbcCHQyi (ORCPT ); Tue, 8 Mar 2016 11:54:38 -0500 Received: from ring0.de ([5.45.101.7]:33641 "EHLO ring0.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754241AbcCHQuH (ORCPT ); Tue, 8 Mar 2016 11:50:07 -0500 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail * domains are different * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen Cc: Laurent Pinchart , David Airlie , linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/23] drm: omapdrm: panel-dsi-cm: add offset support Date: Tue, 8 Mar 2016 17:39:52 +0100 Message-Id: <1457455195-1938-21-git-send-email-sre@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457455195-1938-1-git-send-email-sre@kernel.org> References: <1457455195-1938-1-git-send-email-sre@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1967 Lines: 65 The Nokia N950 contains a panel, that is partially covered, so that not the whole display is visible. Thus the image must be displayed with an offset. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 4c1e76da68cd..c60bc3013ff4 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -45,6 +45,8 @@ struct panel_drv_data { struct omap_dss_device *in; struct omap_video_timings timings; + int offset_x; + int offset_y; struct platform_device *pdev; @@ -203,12 +205,17 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, { struct omap_dss_device *in = ddata->in; int r; - u16 x1 = x; - u16 x2 = x + w - 1; - u16 y1 = y; - u16 y2 = y + h - 1; - u8 buf[5]; + u16 x1, x2, y1, y2; + + x += ddata->offset_x; + y += ddata->offset_y; + + x1 = x; + x2 = x + w - 1; + y1 = y; + y2 = y + h - 1; + buf[0] = MIPI_DCS_SET_COLUMN_ADDRESS; buf[1] = (x1 >> 8) & 0xff; buf[2] = (x1 >> 0) & 0xff; @@ -1244,6 +1251,8 @@ static int dsicm_probe_of(struct platform_device *pdev) of_property_read_u32(node, "resolution-x", (u32*) &ddata->timings.x_res); of_property_read_u32(node, "resolution-y", (u32*) &ddata->timings.y_res); + of_property_read_u32(node, "offset-x", &ddata->offset_x); + of_property_read_u32(node, "offset-y", &ddata->offset_y); ddata->timings.pixelclock = ddata->timings.x_res * ddata->timings.y_res * 60; @@ -1273,6 +1282,8 @@ static int dsicm_probe(struct platform_device *pdev) ddata->timings.x_res = 864; ddata->timings.y_res = 480; ddata->timings.pixelclock = 864 * 480 * 60; + ddata->offset_x = 0; + ddata->offset_y = 0; if (dev_get_platdata(dev)) { r = dsicm_probe_pdata(pdev); -- 2.7.0