From patchwork Tue Aug 11 00:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11708689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9ED33739 for ; Tue, 11 Aug 2020 07:00:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CD622078E for ; Tue, 11 Aug 2020 07:00:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="d197E3XB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CD622078E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C119D6E4CF; Tue, 11 Aug 2020 06:59:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id EEDDC6E49D for ; Tue, 11 Aug 2020 00:22:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597105371; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2pAnB95G7HfE2UWr4cxMF2djUoaYxRElPvRjpK6hlhU=; b=d197E3XBewJUXplkkmNY5MDQQycQSD3sInAosPbLbaIWyW3QctL81PILqzExjMzqAK6Tpl zVIHQMD4Ytr/HobyXEF+lwNf7Aw50+I8/IkBtpn0wk+GEQhsf+SAjeXMvoFYOtrZa5IDA8 SaB12kToN3cNWv2dFe/J9563P2p/Nl8= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH 1/5] drm/panel: novatek, nt39016: Handle backlight the standard way Date: Tue, 11 Aug 2020 02:22:36 +0200 Message-Id: <20200811002240.55194-2-paul@crapouillou.net> In-Reply-To: <20200811002240.55194-1-paul@crapouillou.net> References: <20200811002240.55194-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Aug 2020 06:58:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil , od@zcrc.me Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of manipulating the backlight directly in this driver, register it in the probe using drm_panel_of_backlight() and let the drm_panel framework code handle it. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index 3d15d9925204..ba05165b6050 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -6,7 +6,6 @@ * Copyright (C) 2019, Paul Cercueil */ -#include #include #include #include @@ -63,8 +62,6 @@ struct nt39016 { const struct nt39016_panel_info *panel_info; struct gpio_desc *reset_gpio; - - struct backlight_device *backlight; }; static inline struct nt39016 *to_nt39016(struct drm_panel *panel) @@ -180,14 +177,12 @@ static int nt39016_enable(struct drm_panel *drm_panel) return ret; } - if (panel->backlight) { + if (drm_panel->backlight) { /* Wait for the picture to be ready before enabling backlight */ msleep(150); - - ret = backlight_enable(panel->backlight); } - return ret; + return 0; } static int nt39016_disable(struct drm_panel *drm_panel) @@ -195,8 +190,6 @@ static int nt39016_disable(struct drm_panel *drm_panel) struct nt39016 *panel = to_nt39016(drm_panel); int err; - backlight_disable(panel->backlight); - err = regmap_write(panel->map, NT39016_REG_SYSTEM, NT39016_SYSTEM_RESET_N); if (err) { @@ -292,9 +285,8 @@ static int nt39016_probe(struct spi_device *spi) return PTR_ERR(panel->map); } - panel->backlight = devm_of_find_backlight(dev); - if (IS_ERR(panel->backlight)) { - err = PTR_ERR(panel->backlight); + err = drm_panel_of_backlight(&panel->drm_panel); + if (err) { if (err != -EPROBE_DEFER) dev_err(dev, "Failed to get backlight handle"); return err; From patchwork Tue Aug 11 00:22:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11708657 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EAA9618 for ; Tue, 11 Aug 2020 06:59:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D39A20772 for ; Tue, 11 Aug 2020 06:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="pK9ShE4t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D39A20772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 578656E226; Tue, 11 Aug 2020 06:58:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E4826E03D for ; Tue, 11 Aug 2020 00:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597105372; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JjIL9moCS0z1R5alv49aEL6O8PlqQzsA7GoxoF/cqMw=; b=pK9ShE4tFRjKFD+mxFvMa/9QiWoOgvWQPajZrDK8Gng10jd0U2ta3YPUdqCwxlBB6sNNnG aIx1XIjVVZK7U+zQ2VI50PAL9gDHYxPE+1xHjDAqjmXI8oOe8fvAV0rCmbIFAQRjFPkZgw JeP7SmmvFEo+ZriFb6yWXGOhR+VX8W4= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH 2/5] drm/panel: novatek, nt39016: Add missing CR to error messages Date: Tue, 11 Aug 2020 02:22:37 +0200 Message-Id: <20200811002240.55194-3-paul@crapouillou.net> In-Reply-To: <20200811002240.55194-1-paul@crapouillou.net> References: <20200811002240.55194-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Aug 2020 06:58:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil , od@zcrc.me Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If you pass a string that is not terminated with a carriage return to dev_err(), it will eventually be printed with a carriage return, but not right away, since the kernel will wait for a pr_cont(). Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-novatek-nt39016.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c b/drivers/gpu/drm/panel/panel-novatek-nt39016.c index ba05165b6050..39f7be679da5 100644 --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c @@ -124,7 +124,7 @@ static int nt39016_prepare(struct drm_panel *drm_panel) err = regulator_enable(panel->supply); if (err) { - dev_err(panel->dev, "Failed to enable power supply: %d", err); + dev_err(panel->dev, "Failed to enable power supply: %d\n", err); return err; } @@ -143,7 +143,7 @@ static int nt39016_prepare(struct drm_panel *drm_panel) err = regmap_multi_reg_write(panel->map, nt39016_panel_regs, ARRAY_SIZE(nt39016_panel_regs)); if (err) { - dev_err(panel->dev, "Failed to init registers: %d", err); + dev_err(panel->dev, "Failed to init registers: %d\n", err); goto err_disable_regulator; } @@ -173,7 +173,7 @@ static int nt39016_enable(struct drm_panel *drm_panel) ret = regmap_write(panel->map, NT39016_REG_SYSTEM, NT39016_SYSTEM_RESET_N | NT39016_SYSTEM_STANDBY); if (ret) { - dev_err(panel->dev, "Unable to enable panel: %d", ret); + dev_err(panel->dev, "Unable to enable panel: %d\n", ret); return ret; } @@ -193,7 +193,7 @@ static int nt39016_disable(struct drm_panel *drm_panel) err = regmap_write(panel->map, NT39016_REG_SYSTEM, NT39016_SYSTEM_RESET_N); if (err) { - dev_err(panel->dev, "Unable to disable panel: %d", err); + dev_err(panel->dev, "Unable to disable panel: %d\n", err); return err; } @@ -261,13 +261,13 @@ static int nt39016_probe(struct spi_device *spi) panel->supply = devm_regulator_get(dev, "power"); if (IS_ERR(panel->supply)) { - dev_err(dev, "Failed to get power supply"); + dev_err(dev, "Failed to get power supply\n"); return PTR_ERR(panel->supply); } panel->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(panel->reset_gpio)) { - dev_err(dev, "Failed to get reset GPIO"); + dev_err(dev, "Failed to get reset GPIO\n"); return PTR_ERR(panel->reset_gpio); } @@ -275,20 +275,20 @@ static int nt39016_probe(struct spi_device *spi) spi->mode = SPI_MODE_3 | SPI_3WIRE; err = spi_setup(spi); if (err) { - dev_err(dev, "Failed to setup SPI"); + dev_err(dev, "Failed to setup SPI\n"); return err; } panel->map = devm_regmap_init_spi(spi, &nt39016_regmap_config); if (IS_ERR(panel->map)) { - dev_err(dev, "Failed to init regmap"); + dev_err(dev, "Failed to init regmap\n"); return PTR_ERR(panel->map); } err = drm_panel_of_backlight(&panel->drm_panel); if (err) { if (err != -EPROBE_DEFER) - dev_err(dev, "Failed to get backlight handle"); + dev_err(dev, "Failed to get backlight handle\n"); return err; } From patchwork Tue Aug 11 00:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11708679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D01D618 for ; Tue, 11 Aug 2020 06:59:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B61620885 for ; Tue, 11 Aug 2020 06:59:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="eQqJ7WpM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B61620885 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AE006E4B6; Tue, 11 Aug 2020 06:59:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 062DD6E49F for ; Tue, 11 Aug 2020 00:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597105373; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GktzCBVn5TL5skxl6f39MlCJqX9Y1dfzq1NIw7kCWEM=; b=eQqJ7WpMqyRcqSiOsp1qOfPwvIpBwnxypyTpdM7IrUu+Rb5HqnhXiQGu0RQyIjk8lR/Uqd w6XiTbUzQCzo0jJzHzIclAOViJxazw8Wj8KWvBdcK3JB+RieClX+xXueM0bNgN9iHe2qg1 QqzLRjc/8xvnx+aWijegYWVFmCsj8Ns= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH 3/5] drm/panel: simple: Convert sharp, ls020b1dd01d from timings to videomode Date: Tue, 11 Aug 2020 02:22:38 +0200 Message-Id: <20200811002240.55194-4-paul@crapouillou.net> In-Reply-To: <20200811002240.55194-1-paul@crapouillou.net> References: <20200811002240.55194-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Aug 2020 06:58:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil , od@zcrc.me Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Convert the Sharp LS020B1DD01D panel entry from using a struct display_timing to using a struct drm_display_mode, as display_timing seems to be the old and legacy format. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-simple.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 3787748b5bd0..60052976e616 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3382,22 +3382,24 @@ static const struct panel_desc sharp_lq123p1jx31 = { }, }; -static const struct display_timing sharp_ls020b1dd01d_timing = { - .pixelclock = { 2000000, 4200000, 5000000 }, - .hactive = { 240, 240, 240 }, - .hfront_porch = { 66, 66, 66 }, - .hback_porch = { 1, 1, 1 }, - .hsync_len = { 1, 1, 1 }, - .vactive = { 160, 160, 160 }, - .vfront_porch = { 52, 52, 52 }, - .vback_porch = { 6, 6, 6 }, - .vsync_len = { 10, 10, 10 }, - .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW, +static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = { + { /* 60 Hz */ + .clock = 4200, + .hdisplay = 240, + .hsync_start = 240 + 66, + .hsync_end = 240 + 66 + 1, + .htotal = 240 + 66 + 1 + 1, + .vdisplay = 160, + .vsync_start = 160 + 52, + .vsync_end = 160 + 52 + 10, + .vtotal = 160 + 52 + 10 + 6, + .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC, + }, }; static const struct panel_desc sharp_ls020b1dd01d = { - .timings = &sharp_ls020b1dd01d_timing, - .num_timings = 1, + .modes = sharp_ls020b1dd01d_modes, + .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes), .bpc = 6, .size = { .width = 42, From patchwork Tue Aug 11 00:22:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11708635 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5303B739 for ; Tue, 11 Aug 2020 06:59:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 316F720772 for ; Tue, 11 Aug 2020 06:59:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="xsvpiWDb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 316F720772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 27B156E11E; Tue, 11 Aug 2020 06:58:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4303B6E4A1 for ; Tue, 11 Aug 2020 00:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597105374; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PaKv81WQbkYK27ko6vcwQCQZgJ0sxMpHG+hYhPbwT7U=; b=xsvpiWDblQ9dyB62tybIa/UxD+yAnd9rVZoM1NyT9g+USATMdDyShZ33QlYICi+xgRd8ly uzH7hdUDbGuRBsG3kcvCZi4Yn50uIe06hRA0hnIR+flyYnN1LgwrUqYbye3WSLXgxhbuKy YzkDR4hM+tFEJ2ss7ZvSQ13PM+qhNa4= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH 4/5] drm/panel: simple: Tweak timings of sharp, ls020b1dd01d for perfect 60Hz Date: Tue, 11 Aug 2020 02:22:39 +0200 Message-Id: <20200811002240.55194-5-paul@crapouillou.net> In-Reply-To: <20200811002240.55194-1-paul@crapouillou.net> References: <20200811002240.55194-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Aug 2020 06:58:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil , od@zcrc.me Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Modify the video mode in order to obtain a perfect 60.00 Hz frame rate using a 3 MHz pixel clock. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-simple.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 60052976e616..4aee7eca6ded 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3384,15 +3384,15 @@ static const struct panel_desc sharp_lq123p1jx31 = { static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = { { /* 60 Hz */ - .clock = 4200, + .clock = 3000, .hdisplay = 240, - .hsync_start = 240 + 66, - .hsync_end = 240 + 66 + 1, - .htotal = 240 + 66 + 1 + 1, + .hsync_start = 240 + 8, + .hsync_end = 240 + 8 + 1, + .htotal = 240 + 8 + 1 + 1, .vdisplay = 160, - .vsync_start = 160 + 52, - .vsync_end = 160 + 52 + 10, - .vtotal = 160 + 52 + 10 + 6, + .vsync_start = 160 + 24, + .vsync_end = 160 + 24 + 10, + .vtotal = 160 + 24 + 10 + 6, .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC, }, }; From patchwork Tue Aug 11 00:22:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11708649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DED34618 for ; Tue, 11 Aug 2020 06:59:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD3BD20781 for ; Tue, 11 Aug 2020 06:59:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="crs9kUCo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD3BD20781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=crapouillou.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3824A6E141; Tue, 11 Aug 2020 06:58:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from crapouillou.net (crapouillou.net [89.234.176.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 654BE6E49D for ; Tue, 11 Aug 2020 00:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597105374; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8AQMkbmdhOguOVhFrlhaDMnBpKno97BYw594g3hdJ4U=; b=crs9kUCotubhHCSrMtCvBxvgzCbzdCHdDYhpIvJW/4kWWOMuBYlgBtWyR/772iRZ4+fGBY 0TNhg8koRNG1EIluSegEYHKteqp2f9Rlf672emmaFZY+seE7xlL1TAHDv1nBE4GOqtnMvd UWBL7r/ShCQhOGskMna2MW5NZ62IK78= From: Paul Cercueil To: Thierry Reding , Sam Ravnborg Subject: [PATCH 5/5] drm/panel: simple: Add 50Hz mode for sharp,ls020b1dd01d Date: Tue, 11 Aug 2020 02:22:40 +0200 Message-Id: <20200811002240.55194-6-paul@crapouillou.net> In-Reply-To: <20200811002240.55194-1-paul@crapouillou.net> References: <20200811002240.55194-1-paul@crapouillou.net> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 11 Aug 2020 06:58:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Paul Cercueil , od@zcrc.me Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a perfect 50.00 Hz frame rate mode to the list of available modes for the Sharp LS020B1DD01D panel. Signed-off-by: Paul Cercueil --- drivers/gpu/drm/panel/panel-simple.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 4aee7eca6ded..1cf63582b5a2 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3383,6 +3383,18 @@ static const struct panel_desc sharp_lq123p1jx31 = { }; static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = { + { /* 50 Hz */ + .clock = 3000, + .hdisplay = 240, + .hsync_start = 240 + 58, + .hsync_end = 240 + 58 + 1, + .htotal = 240 + 58 + 1 + 1, + .vdisplay = 160, + .vsync_start = 160 + 24, + .vsync_end = 160 + 24 + 10, + .vtotal = 160 + 24 + 10 + 6, + .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC, + }, { /* 60 Hz */ .clock = 3000, .hdisplay = 240,