From patchwork Tue Mar 8 16:39:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 8540101 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66A56C0553 for ; Wed, 9 Mar 2016 00:50:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BD1B201FE for ; Wed, 9 Mar 2016 00:50:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C20A720251 for ; Wed, 9 Mar 2016 00:50:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19AEC6E7E6; Wed, 9 Mar 2016 00:50:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from ring0.de (ring0.de [IPv6:2a03:4000:6:1a1::1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DB916E733 for ; Tue, 8 Mar 2016 16:50:03 +0000 (UTC) Received: by ring0.de (Postfix, from userid 110) id B20A2A4A868; Tue, 8 Mar 2016 17:41:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sre.ring0.de (host-091-097-051-039.ewe-ip-backbone.de [91.97.51.39]) by ring0.de (Postfix) with ESMTPSA id 95813A4A82A; Tue, 8 Mar 2016 17:40:26 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , Aaro Koskinen , Tomi Valkeinen 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> X-Mailman-Approved-At: Wed, 09 Mar 2016 00:49:40 +0000 Cc: linux-omap@vger.kernel.org, Laurent Pinchart , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);