From patchwork Sat Nov 3 10:08:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6DF813B5 for ; Sat, 3 Nov 2018 14:23:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5A79287C2 for ; Sat, 3 Nov 2018 14:23:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9424288BC; Sat, 3 Nov 2018 14:23:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 665EF287C2 for ; Sat, 3 Nov 2018 14:23:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16B576EF84; Sat, 3 Nov 2018 14:23:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 19B116E67E for ; Sat, 3 Nov 2018 10:09:30 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id c13-v6so2121069plz.13 for ; Sat, 03 Nov 2018 03:09:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ItiKdY/aqQ72CaiAvq/zBxi6LN6Pf1wyAwPGh/IMHHQ=; b=L5eEpjKhDNeyCw6gGOjrb0j7I1Swn1XnUACiJuo012aJ44vnKk/BT6iSmCWLY8BpV3 7UkC57LRM9oFouZzqZA/sSz99Y+ecJPxV9N1406ezqhKMigqHhehVKICjUZu69OBtEjq EnceNV3iRGI+EInP3ZetvV2BzPI3+XaczEqa+vVR71udwCjlc3iG+JeQ7kcyQb4x/2/3 25QAL9y42p3KMDQO9He508UYe11cpL9FVnVzauQKG09LLRL8WFiX8Dz971Oo0RkwhnEt v4Q0rURrXSuWskQdzkrrJlDAdcymqsRZTKE10WEHzDIGPZfPiCEatc/uxkZU1McWbA4B h77A== X-Gm-Message-State: AGRZ1gJCGnjpFeVL6UJX2s8dTd/0WQmBIRKSLDwxaeYi78BrWAJeb6io I8CUiaOsjzru1StqU3CfWISXlA== X-Google-Smtp-Source: AJdET5dxiNozwBzE8xGf4Wfx+GgIdBkafQgF7rhrQSqStOEiVgqWI00de4qC41PL68yFC/tWW3INXA== X-Received: by 2002:a17:902:f097:: with SMTP id go23mr14566114plb.328.1541239769647; Sat, 03 Nov 2018 03:09:29 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:29 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 01/10] drm/sun4i: sun6i_mipi_dsi: Compute burst mode loop N1 instruction delay Date: Sat, 3 Nov 2018 15:38:51 +0530 Message-Id: <20181103100900.30313-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Loop N1 instruction delay for burst mode lcd panel are computed as per BSP code. Reference code is available in BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_dev[sel]->dsi_inst_loop_num.bits.loop_n1= (panel->lcd_ht-panel->lcd_x)*(150)/(panel->lcd_dclk_freq*8) - 50; => (((mode->htotal - mode->hdisplay) * 150) / ((mode->clock / 1000) * 8)) - 50; So use the similar computation for loop N1 delay. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 86430efd9054..da152c21ec62 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -394,7 +394,14 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - u16 delay = 50 - 1; + struct mipi_dsi_device *device = dsi->device; + u16 delay; + + if (device->mode_flags == MIPI_DSI_MODE_VIDEO_BURST) + delay = (((mode->htotal - mode->hdisplay) * 150) / + ((mode->clock / 1000) * 8)) - 50; + else + delay = 50 - 1; regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_NUM_REG(0), SUN6I_DSI_INST_LOOP_NUM_N0(50 - 1) | From patchwork Sat Nov 3 10:08:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C074D13B5 for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF3B82883F for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A355828915; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 640812883F for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F6456EED1; Sat, 3 Nov 2018 14:23:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D41A6E681 for ; Sat, 3 Nov 2018 10:09:37 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id p7-v6so2140676plk.5 for ; Sat, 03 Nov 2018 03:09:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YhcdTaqekiJ1IH3Njt5SqmOCHXO4U7AWqNWukgHaAi8=; b=XHMZ1vJAm/LTovDCoBDZKOIz4CK0O69vTaLotzS2h5iNu2H7xNsWeOMo6ssrq3jljL +TSv7McPifS+5vzNMGd2IBPBylsZgxjOp8kChNYBiqBjcwb8AgyVv83jlkwQtBDFAd5U hh0tYz87+Tu4xEtL4p9pZHsmlGeTgSCOL1FRp+Goz2Z5S8KsGUnhALeAuON3LBUKWkHt TeBcPqzDLCEXovxORslKHN8azFiV1A/jZ7g9myOgDvi6xRRCBv/beL1dBRSEcCx71HsT q11hGTQ4GPHILok6nXHRGE3J1oAt4eJWvPppqAbrmta9Pf0fJ7Nb5P/cX1A5WfOcUOvd Smpw== X-Gm-Message-State: AGRZ1gJQsFyI2+xxBuyE7j88Ogyh+0uwrBHpiW2ZidUG/SouvJcalC6A lHllXDZCnNM2wojpSTdXnzXr4w== X-Google-Smtp-Source: AJdET5fUxfrFit8SCslEnOy9JQ2bunA85HTt2862WrZQENW8wd5fo1Lk7lp2wBJKv5WizrufHateGA== X-Received: by 2002:a17:902:a9c5:: with SMTP id b5-v6mr14826077plr.340.1541239776608; Sat, 03 Nov 2018 03:09:36 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:36 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 02/10] drm/sun4i: sun6i_mipi_dsi: Support instruction loop selection Date: Sat, 3 Nov 2018 15:38:52 +0530 Message-Id: <20181103100900.30313-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instruction loop selection would require before writing loop number registers, so enable idle, LP11 bits on loop selection register. Reference code available in BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) (dsi_dev[sel]->dsi_inst_loop_sel.dwval = 2<<(4*DSI_INST_ID_LP11) | 3<<(4*DSI_INST_ID_DLY); Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index da152c21ec62..077b57ec964c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -397,6 +397,10 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, struct mipi_dsi_device *device = dsi->device; u16 delay; + regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_SEL_REG, + DSI_INST_ID_HSC << (4 * DSI_INST_ID_LP11) | + DSI_INST_ID_HSD << (4 * DSI_INST_ID_DLY)); + if (device->mode_flags == MIPI_DSI_MODE_VIDEO_BURST) delay = (((mode->htotal - mode->hdisplay) * 150) / ((mode->clock / 1000) * 8)) - 50; From patchwork Sat Nov 3 10:08:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4094F17DB for ; Sat, 3 Nov 2018 14:23:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2E5287C2 for ; Sat, 3 Nov 2018 14:23:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 226BB288BC; Sat, 3 Nov 2018 14:23:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B3726287C2 for ; Sat, 3 Nov 2018 14:23:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0045B6EED9; Sat, 3 Nov 2018 14:23:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 326216E682 for ; Sat, 3 Nov 2018 10:09:45 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id f12-v6so955898plo.1 for ; Sat, 03 Nov 2018 03:09:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tQh0tuZ2hAQEjHoUC9QKXmQksrNiyamIN0Q5qO8zC0c=; b=rGq+MWo9kDQZQ7vl+9r54usyNpGqVzGRARGp8uatCY/9eYqdrPx2z/s4AHXMIbilu5 gFSyCOS61/4eB0bD1vU3llk6ip5EM3T7sAV48a6m8RZrNTZUM/zpvnF+uBloNeWUNsMb 6unJum/SY/BV3xwJ04OwEeaKYIcSQF2hW+vplFFB4aGiVd/G//NA/tuirZG7Eqt5GVKr Lwt8ZLrrzyIBZjvkfoTiOT/cP8aJntqf2NtWIYWFivsOd/BV21sRhqAb++80/hapOCFi 9qPEGvM1STTtPvXTS8Edke02vaGU7OMeYXfYxrX2F/ymnCMAGQGOcPxpSmyl8Lh2+p05 W5Cg== X-Gm-Message-State: AGRZ1gLtig2HU6JLqI1mUzo73Q9V2uKVJdfjoiEoHJKeXQi9VZASRIhr cHNUnBdIkZie5hxS4eG8kzSgaA== X-Google-Smtp-Source: AJdET5co6HBSmkyR3+nJstdmG+aMIQ/YeXFBJ5+1R0rTOwg3wKCJwtBITHmn30omsMCoAShKnmAHzg== X-Received: by 2002:a17:902:a5cc:: with SMTP id t12-v6mr6717272plq.298.1541239784745; Sat, 03 Nov 2018 03:09:44 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:44 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 03/10] drm/sun4i: sun6i_mipi_dsi: Setup burst mode timings Date: Sat, 3 Nov 2018 15:38:53 +0530 Message-Id: <20181103100900.30313-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Burst mode display timings are different from convectional video mode so update the horizontal and vertical timings. Reference code taken from BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hsa = 0; dsi_hbp = 0; dsi_hact = x*dsi_pixel_bits[format]/8; dsi_hblk = dsi_hact; dsi_hfp = 0; dsi_vblk = 0; Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 108 ++++++++++++++----------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 077b57ec964c..4965b2c71e4c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -479,59 +479,71 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* Do all timing calculations up front to allocate buffer space */ - /* - * A sync period is composed of a blanking packet (4 bytes + - * payload + 2 bytes) and a sync event packet (4 bytes). Its - * minimal size is therefore 10 bytes - */ + if (device->mode_flags == MIPI_DSI_MODE_VIDEO_BURST) { + hsa = 0; + hbp = 0; + hblk = mode->hdisplay * Bpp; + hfp = 0; + vblk = 0; + } else { + /* + * A sync period is composed of a blanking packet (4 bytes + + * payload + 2 bytes) and a sync event packet (4 bytes). Its + * minimal size is therefore 10 bytes + */ #define HSA_PACKET_OVERHEAD 10 - hsa = max((unsigned int)HSA_PACKET_OVERHEAD, - (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD); - - /* - * The backporch is set using a blanking packet (4 bytes + - * payload + 2 bytes). Its minimal size is therefore 6 bytes - */ + hsa = max((unsigned int)HSA_PACKET_OVERHEAD, + (mode->hsync_end - mode->hsync_start) * Bpp - + HSA_PACKET_OVERHEAD); + + /* + * The backporch is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + */ #define HBP_PACKET_OVERHEAD 6 - hbp = max((unsigned int)HBP_PACKET_OVERHEAD, - (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD); - - /* - * hblk seems to be the line + porches length. - * The blank is set using a blanking packet (4 bytes + 4 bytes + - * payload + 2 bytes). So minimal size is 10 bytes - */ + hbp = max((unsigned int)HBP_PACKET_OVERHEAD, + (mode->htotal - mode->hsync_end) * Bpp - + HBP_PACKET_OVERHEAD); + + /* + * hblk seems to be the line + porches length. + * The blank is set using a blanking packet (4 bytes + 4 bytes + * + payload + 2 bytes). So minimal size is 10 bytes + */ #define HBLK_PACKET_OVERHEAD 10 - hblk_max = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; - hblk_max -= HBLK_PACKET_OVERHEAD; - hblk = max_t(unsigned int, HBLK_PACKET_OVERHEAD, hblk_max); - - /* - * The frontporch is set using a blanking packet (4 bytes + - * payload + 2 bytes). Its minimal size is therefore 6 bytes - * - * According to BSP code, extra 10 bytes(which is hblk packet overhead) - * is adding for hfp packet overhead since hfp depends on hblk. - */ + hblk_max = (mode->htotal - + (mode->hsync_end - mode->hsync_start)) * Bpp; + hblk_max -= HBLK_PACKET_OVERHEAD; + hblk = max_t(unsigned int, HBLK_PACKET_OVERHEAD, hblk_max); + + /* + * The frontporch is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + * + * According to BSP code, extra 10 bytes(which is hblk packet + * overhead) is adding for hfp packet overhead since hfp + * depends on hblk. + */ #define HFP_PACKET_OVERHEAD 6 - hfp_pkt_overhead = (HFP_PACKET_OVERHEAD + HBLK_PACKET_OVERHEAD); - hfp = max((unsigned int)hfp_pkt_overhead, - (mode->hsync_start - mode->hdisplay) * Bpp - - hfp_pkt_overhead); - - /* - * The vertical blank is set using a blanking packet (4 bytes + - * payload + 2 bytes). Its minimal size is therefore 6 bytes - */ + hfp_pkt_overhead = (HFP_PACKET_OVERHEAD + HBLK_PACKET_OVERHEAD); + hfp = max((unsigned int)hfp_pkt_overhead, + (mode->hsync_start - mode->hdisplay) * Bpp - + hfp_pkt_overhead); + + /* + * The vertical blank is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + */ #define VBLK_PACKET_OVERHEAD 6 - if (device->lanes == 4) { - int tmp; - - tmp = (mode->htotal * Bpp) * mode->vtotal - - (hblk + VBLK_PACKET_OVERHEAD); - vblk = (device->lanes - tmp % device->lanes); - } else { - vblk = 0; + if (device->lanes == 4) { + int tmp; + + tmp = (mode->htotal * Bpp) * mode->vtotal - + (hblk + VBLK_PACKET_OVERHEAD); + vblk = (device->lanes - tmp % device->lanes); + } else { + vblk = 0; + } } /* How many bytes do we need to send all payloads? */ From patchwork Sat Nov 3 10:08:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 978BA17DB for ; Sat, 3 Nov 2018 14:23:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 858D2287C2 for ; Sat, 3 Nov 2018 14:23:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 793AB288BC; Sat, 3 Nov 2018 14:23:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 22D24287C2 for ; Sat, 3 Nov 2018 14:23:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5D526EF73; Sat, 3 Nov 2018 14:23:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id 001466E684 for ; Sat, 3 Nov 2018 10:09:51 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id g59-v6so2126259plb.10 for ; Sat, 03 Nov 2018 03:09:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RoHXhQs3sGHJc3VqucM8YHfwrLVjYZhUwHaLNgzq7Hk=; b=rMz7LWmaseYVEUehQRTgqQEkBxxrbaGQBpQb6QfYykni8MsnGxi/EugibIZXDdQAvt w1j/Esh7GyRkb2h68bUMjku6gSXyn8/InqCjVeiW8Zfp3rV8yHTyRkZy8e+DIWAOFLvD 0hxCq65PVgonnmppSMtTaV5ABcKNsqlZYRgUlxpUNDG3WjexG1uzyHLXJpyyTczreMe3 wsUPhKRg2ol1xEffu4C6ABe/DT1mda9/FK/zWmETIIla/arU+XAA57ZBiG5Ed9UYc/5v ZBHV3MIeoKzmAVxYN6rH37bKXYWVfeGlv56HlroRAnaiMH3rYx55+1H+2BFmeraBbRto HVIw== X-Gm-Message-State: AGRZ1gIZ8cmejuaAn1P9hcvRP96iGd3X4SXx82J8YkMR/PoUqU3UI1st U9IdON4vJip/TbeMtDpNwUPZ2Q== X-Google-Smtp-Source: AJdET5cZWnpRoke0soGNzGMb4cUkutwXdz4Xu2YGKFvhfMeGnaV3L3bKJ4djXsCJup2lz7coshRSDA== X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12-v6mr15243833plb.330.1541239791555; Sat, 03 Nov 2018 03:09:51 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:50 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 04/10] drm/sun4i: sun6i_mipi_dsi: Setup burst mode Date: Sat, 3 Nov 2018 15:38:54 +0530 Message-Id: <20181103100900.30313-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Setting up burst mode display would require to compute - Horizontal timing edge values to fill burst drq register - Line, sync values to fill burst line register Since there is no direct documentation for these computations the edge and line formulas are taken from BSP code (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) line_num = panel->lcd_ht*dsi_pixel_bits[panel->lcd_dsi_format]/ (8*panel->lcd_dsi_lane); edge1 = sync_point+(panel->lcd_x+panel->lcd_hbp+20)* dsi_pixel_bits[panel->lcd_dsi_format] /(8*panel->lcd_dsi_lane); edge1 = (edge1>line_num)?line_num:edge1; edge0 = edge1+(panel->lcd_x+40)*tcon_div/8; edge0 = (edge0>line_num)?(edge0-line_num):1; Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 48 +++++++++++++++++++++----- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 4965b2c71e4c..b6c01891df36 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -375,20 +375,52 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { struct mipi_dsi_device *device = dsi->device; + unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format); + u32 line_num, edge0, edge1, hact_sync_bp; + u32 sync_point, tcon_div; u32 val = 0; - if ((mode->hsync_start - mode->hdisplay) > 20) { - /* Maaaaaagic */ - u16 drq = (mode->hsync_start - mode->hdisplay) - 20; + if (device->mode_flags != MIPI_DSI_MODE_VIDEO_BURST) { + if ((mode->hsync_start - mode->hdisplay) > 20) { + /* Maaaaaagic */ + u16 drq = (mode->hsync_start - mode->hdisplay) - 20; - drq *= mipi_dsi_pixel_format_to_bpp(device->format); - drq /= 32; + drq *= Bpp; + drq /= 32; - val = (SUN6I_DSI_TCON_DRQ_ENABLE_MODE | - SUN6I_DSI_TCON_DRQ_SET(drq)); + val = (SUN6I_DSI_TCON_DRQ_ENABLE_MODE | + SUN6I_DSI_TCON_DRQ_SET(drq)); + } + + regmap_write(dsi->regs, SUN6I_DSI_TCON_DRQ_REG, val); + + return; } - regmap_write(dsi->regs, SUN6I_DSI_TCON_DRQ_REG, val); + sync_point = 40; + tcon_div = 8; /* FIXME need to retrive the divider from TCON */ + + line_num = mode->htotal * Bpp / (8 * device->lanes); + /* Horizental timings duration excluding front porch */ + hact_sync_bp = (mode->hdisplay + mode->htotal - mode->hsync_start); + edge1 = sync_point + ((hact_sync_bp + 20) * Bpp / (8 * device->lanes)); + if (edge1 > line_num) + edge1 = line_num; + + edge0 = edge1 + (mode->hdisplay + 40) * tcon_div / 8; + if (edge0 > line_num) + edge0 -= line_num; + else + edge0 = 1; + + regmap_write(dsi->regs, SUN6I_DSI_BURST_DRQ_REG, + SUN6I_DSI_BURST_DRQ_EDGE1(edge1) | + SUN6I_DSI_BURST_DRQ_EDGE0(edge0)); + regmap_write(dsi->regs, SUN6I_DSI_TCON_DRQ_REG, + SUN6I_DSI_TCON_DRQ_ENABLE_MODE); + regmap_write(dsi->regs, SUN6I_DSI_BURST_LINE_REG, + SUN6I_DSI_BURST_LINE_NUM(line_num) | + SUN6I_DSI_BURST_LINE_SYNC_POINT(sync_point)); } static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, From patchwork Sat Nov 3 10:08:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D24B317DB for ; Sat, 3 Nov 2018 14:23:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15252883F for ; Sat, 3 Nov 2018 14:23:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B56F328915; Sat, 3 Nov 2018 14:23:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B0712883F for ; Sat, 3 Nov 2018 14:23:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D97F6EEA3; Sat, 3 Nov 2018 14:23:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id B28B16E67D for ; Sat, 3 Nov 2018 10:09:59 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id i4-v6so2048949pgq.9 for ; Sat, 03 Nov 2018 03:09:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RBoHpvI+yjf+sOpHt/smPITCJdlWMb7A2BR5EeBkj9A=; b=VpWQStLVSQnj4dOowODx6xTIEgtopxlzQZxGxXZZPy/EZI+OEcK3HANymfsR8A2Ezc gYMuKOVZhl6mz2r4ZJNF3yNF4QuW9XxT0WjLr0/rBAn4P4MZRg8E5TpUKQwl1PHBPBRf QD7FbKo1MOkHkwOREWvE8tg3dgRdDV2hX4OS8PzL3tiayUrUKjqD3Pwctd1DuGb+wcm7 ln/8D98VGeFGyhCY1wPuVoA1Wr2CcxYPDCOw8qJfOVsnAz08RWV1/VBTSWFAEXRhgfSV +pVMRqhyQWOYWk6QORcsTTPOGqJJPn1goIvxiyaMc3BMkVyUBDzESvXSoe2nXVnAygDz bcKQ== X-Gm-Message-State: AGRZ1gJG5DVRIV2GI/9Q2WIY5KpyHBE0SmHupRpQLpbkrBS0z8v4AVXM m4maz+f3wj6g6oEekS5XO5pJWQ== X-Google-Smtp-Source: AJdET5fvkLH/Lzgeh3GeP6t+bSHKP1D/+JGthSpCBYjf7HluzjfCeocHOInlOwAvJHC2dzASgahvVg== X-Received: by 2002:a63:460a:: with SMTP id t10-v6mr13818801pga.197.1541239799315; Sat, 03 Nov 2018 03:09:59 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:58 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 05/10] drm/sun4i: sun6i_mipi_dsi: Enable burst mode Date: Sat, 3 Nov 2018 15:38:55 +0530 Message-Id: <20181103100900.30313-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enable video_mode_burst bit from dsi base control register for burst mode display panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index b6c01891df36..b18a01361f11 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -421,6 +421,10 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, regmap_write(dsi->regs, SUN6I_DSI_BURST_LINE_REG, SUN6I_DSI_BURST_LINE_NUM(line_num) | SUN6I_DSI_BURST_LINE_SYNC_POINT(sync_point)); + + regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); + val |= SUN6I_DSI_BASIC_CTL_VIDEO_BURST; + regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); } static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, From patchwork Sat Nov 3 10:08:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5AD5417DB for ; Sat, 3 Nov 2018 14:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49BF5287C2 for ; Sat, 3 Nov 2018 14:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DF31288BC; Sat, 3 Nov 2018 14:23:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E65F1287C2 for ; Sat, 3 Nov 2018 14:23:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 375806EEC5; Sat, 3 Nov 2018 14:23:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D92D6E67E for ; Sat, 3 Nov 2018 10:10:06 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id g21-v6so2152855pfi.7 for ; Sat, 03 Nov 2018 03:10:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XQSE4iVIjSLPAOzYcXE68LFT+STvGBf+GZnuz/7y4Xw=; b=DWOgddoUigl3WEHcvq78zyBHC7JLyWxDuU15edc6xfANUg9osX+tKgG7XezgGDjVXU 6hhxjvKVrGrApJHCNEdmoEwOAWefsP0gaDgfq0NigobxdKyOwqkLctyzySTcBvsu7T97 97/23hA7+aKtrLQhvZ4HxHaTlgK8+DDFnykXs38WH5g26BXcTCu83i/hEMZJnwBOAYNO IAbPMpH3ekKoArwkF1cK6VnZfzJjvSLKIutUNrvcbxVaS8D/K5wAmeIhRyNeZnw/7StI 5crdOgM+yijZbX95t7IuVLVlu19hDCgObnEhBKoF6rArlwt6fOCUbqYcL7R+UdpbSOCr x9ig== X-Gm-Message-State: AGRZ1gJZDsBaOqblQnjp+OCh+m4vc/3DwSwDSUazQ9+LgSbFfVmhMCg1 F2jsgFcFeY7IPBL0Th0F/lDvkQ== X-Google-Smtp-Source: AJdET5cNgvDVUuusDs+G7JmDnvpBakvSWoLJPbtp4UZaeGzbvI4QqSOFKMxQqLsfpjQbsY3XHlx7Ug== X-Received: by 2002:a62:5d89:: with SMTP id n9-v6mr15519867pfj.54.1541239806197; Sat, 03 Nov 2018 03:10:06 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:10:05 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 06/10] drm/sun4i: sun6i_mipi_dsi: Enable 2byte trail for 4-lane burst mode Date: Sat, 3 Nov 2018 15:38:56 +0530 Message-Id: <20181103100900.30313-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For 4-lane, burst mode panels would need to enable 2byte trail_fill along with filling trail_env in dsi base control register. Similar reference code avialable in BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) if (panel->lcd_dsi_lane == 4) { dsi_dev[sel]->dsi_basic_ctl.bits.trail_inv = 0xc; dsi_dev[sel]->dsi_basic_ctl.bits.trail_fill = 1; } Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index b18a01361f11..2d34e5f48d29 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -33,6 +33,8 @@ #define SUN6I_DSI_CTL_EN BIT(0) #define SUN6I_DSI_BASIC_CTL_REG 0x00c +#define SUN6I_DSI_BASIC_CTL_TRAIL_INV(n) (((n) & 0xf) << 4) +#define SUN6I_DSI_BASIC_CTL_TRAIL_FILL BIT(3) #define SUN6I_DSI_BASIC_CTL_HBP_DIS BIT(2) #define SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS BIT(1) #define SUN6I_DSI_BASIC_CTL_VIDEO_BURST BIT(0) @@ -424,6 +426,10 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); val |= SUN6I_DSI_BASIC_CTL_VIDEO_BURST; + if (device->lanes == 4) { + val |= SUN6I_DSI_BASIC_CTL_TRAIL_INV(0xc); + val |= SUN6I_DSI_BASIC_CTL_TRAIL_FILL; + } regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); } From patchwork Sat Nov 3 10:08:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B7E513B5 for ; Sat, 3 Nov 2018 14:23:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A2E02883F for ; Sat, 3 Nov 2018 14:23:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D7A828915; Sat, 3 Nov 2018 14:23:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C6021288BC for ; Sat, 3 Nov 2018 14:23:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC6266EEF6; Sat, 3 Nov 2018 14:23:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A5B36E681 for ; Sat, 3 Nov 2018 10:10:13 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id n10-v6so2048456pgv.10 for ; Sat, 03 Nov 2018 03:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ce7dCP7DfFpA1e50RettNtIdS5/8ZiyxnOTveZEOqbc=; b=GSh2BFH0sf2lPeB+BApy9fE7rQGcsq+tKvTgqwLGNdqYKECWaqkDwCR5fQr9grsEHQ fCDLYRy04uegexh/bdWdzgVWyjorQidngNfBC4SpBW+iiBItCT2ggYiFAMVz/bkUyzaE m6Y1Gtrzi6qMwl6pLutasQmB5gOy2BvsxvyQvAnRI6ZIXpyY7IlSPFSHCs1UlJdYAmoA nnlxwDJ+RSUxDfkIIxj4ZikQReayPBvXYXcfdNKhWXyYRyqwzSSB43ocaI4QDkhgRZTV 0b9o6WWq4ScG49P3R6sH7TuazJTi4kGCossb4A0QxXmxp1/rC6s0klS85wA7XFIqG1OE SMhg== X-Gm-Message-State: AGRZ1gJmBh24fmoTAUerdiCdiNXScy5UYWKmRa0CXtdRe4wxpAithy+F qqteCjU7z/9d22BZQ1iSlfYdvQ== X-Google-Smtp-Source: AJdET5e+pQzSqMcJNJABb28K3oUehx7FlxwUeNS9B+nUNPjuQyX+XcrQxRdm5S+2gEoaL/VSsMJfMw== X-Received: by 2002:a63:4384:: with SMTP id q126mr13740690pga.160.1541239812653; Sat, 03 Nov 2018 03:10:12 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.10.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:10:12 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 07/10] drm/sun4i: sun6i_mipi_dsi: Enable burst mode HBP, HSA_HSE Date: Sat, 3 Nov 2018 15:38:57 +0530 Message-Id: <20181103100900.30313-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Horizontal back porch, sync active and sync end bits are needed to enable for burst mode panel operations. So, enable them via dsi base control register. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 2d34e5f48d29..feb8c54c5146 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -518,6 +518,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, u16 hbp, hfp_pkt_overhead, hfp, hsa, hblk, vblk; size_t bytes; u8 *buffer; + u32 val = 0; /* Do all timing calculations up front to allocate buffer space */ @@ -527,6 +528,10 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, hblk = mode->hdisplay * Bpp; hfp = 0; vblk = 0; + + regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); + val |= SUN6I_DSI_BASIC_CTL_HBP_DIS; + val |= SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS; } else { /* * A sync period is composed of a blanking packet (4 bytes + @@ -594,7 +599,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, if (WARN_ON(!buffer)) return; - regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, 0); + regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); regmap_write(dsi->regs, SUN6I_DSI_SYNC_HSS_REG, sun6i_dsi_build_sync_pkt(MIPI_DSI_H_SYNC_START, From patchwork Sat Nov 3 10:08:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDE8E17DB for ; Sat, 3 Nov 2018 14:23:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC78B287C2 for ; Sat, 3 Nov 2018 14:23:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0D50288BC; Sat, 3 Nov 2018 14:23:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7099E287C2 for ; Sat, 3 Nov 2018 14:23:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB2766EFA1; Sat, 3 Nov 2018 14:23:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id F35B46E682 for ; Sat, 3 Nov 2018 10:10:20 +0000 (UTC) Received: by mail-pg1-x541.google.com with SMTP id i4-v6so2049233pgq.9 for ; Sat, 03 Nov 2018 03:10:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2imflbytRpO7gkCpHkk9JbdaFJzsvanHLH6vmOR2Ts4=; b=t+GZxZIqvZZCfYC4nqfEtrLcewaIunZAa3kCWVxBsWoDeACx/OE8Qrs8VW6JaMk5Me bXlaR8p3o74D4abeogZiPtLaPAzVEpBQuqRbkhBkwBdkgTX2phN07mT2MuvDkPtctbPL nsB9KZUnC658lb2CKWwVScRKM9sjeYE+ru4Du5zVjVUfTmQfPCLA7jra9HJyI++XXNrd C2jYHD920PlhjwFQMFJXRNp312rcN2xEPkLWunXpFiTW8XYnZaCw9T4Jfhc0VtwTFBvZ dsADhCybt88PdVhHkA0QXHTEsrElhLqkAbMEgWAsHeO8654HLcuChrsSCJO1wDHjYNDk ME8w== X-Gm-Message-State: AGRZ1gLuT2+bQNA406GajK20NxaDY680rUK7ZllZ8Lkbv4Mw+UCjkpD/ xpQgC4WwPNzaqxCw4rmcoNbi7Q== X-Google-Smtp-Source: AJdET5ek/Nqi5OmdvH2lsDvbsku7f14QzmNTZhDKdMv2z3th5wKk0YllL1+0IJOX+JtZISwP/xjJqQ== X-Received: by 2002:a63:aa48:: with SMTP id x8-v6mr13525222pgo.87.1541239820523; Sat, 03 Nov 2018 03:10:20 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.10.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:10:20 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 08/10] dt-bindings: panel: Add Feiyang FY07024DI26A30-D MIPI-DSI LCD panel Date: Sat, 3 Nov 2018 15:38:58 +0530 Message-Id: <20181103100900.30313-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Feiyang FY07024DI26A30-D is 1024x600, 4-lane MIPI-DSI LCD panel. Add dt-bingings for it. Signed-off-by: Jagan Teki Reviewed-by: Rob Herring --- .../display/panel/feiyang,fy07024di26a30d.txt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt diff --git a/Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt b/Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt new file mode 100644 index 000000000000..82caa7b65ae8 --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt @@ -0,0 +1,20 @@ +Feiyang FY07024DI26A30-D 7" MIPI-DSI LCD Panel + +Required properties: +- compatible: must be "feiyang,fy07024di26a30d" +- reg: DSI virtual channel used by that screen +- avdd-supply: analog regulator dc1 switch +- dvdd-supply: 3v3 digital regulator +- reset-gpios: a GPIO phandle for the reset pin + +Optional properties: +- backlight: phandle for the backlight control. + +panel@0 { + compatible = "feiyang,fy07024di26a30d"; + reg = <0>; + avdd-supply = <®_dc1sw>; + dvdd-supply = <®_dldo2>; + reset-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* LCD-RST: PD24 */ + backlight = <&backlight>; +}; From patchwork Sat Nov 3 10:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD81E13B5 for ; Sat, 3 Nov 2018 14:23:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C83692883F for ; Sat, 3 Nov 2018 14:23:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B922628915; Sat, 3 Nov 2018 14:23:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 197932883F for ; Sat, 3 Nov 2018 14:23:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21D006EEEC; Sat, 3 Nov 2018 14:23:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A9286E683 for ; Sat, 3 Nov 2018 10:10:28 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id h4-v6so2145465pfi.10 for ; Sat, 03 Nov 2018 03:10:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4ids294jU6qsAEweKZRB3L5rLwgsSdz3bXnoU3xy4P0=; b=Q+XMwuJvMi698ondAHPTlewu4irKfOlQyYNplezKcJh7dZUkMVbQPua8a11ZM2f6ud KXGCyFPsyf4IOmwMUQ3UbH+Y/r61KdyxRi70gXa1Jd6b4mUcuyRQOisGyBGIegaqDPHJ PYhZYJw/5CArG0GXH7UOLnfZ00BdjLF7Uv2wzuKM5NemUamw198aOrIH8LLWe1FLSe03 QLiK+O1JPAiSImIE2Gu/i2X3Co3Sh9qIKwcqVrNDeIybqHyfo2SdiA4IP+LGrdS3twMU ELSeJmBuV+Guke7TWZwpr1Y5lfh4wqkKB30DWHIuC1mFL7vTj+e1rZp+mv7lwWxdRaAC KECw== X-Gm-Message-State: AGRZ1gLhxyjGSyRhpwm/TdFu5nlJV3L05Si4I4NwH9gSXIK/si1iScCY xewm5JqNmxPTs2BsoSM6mMfMAQ== X-Google-Smtp-Source: AJdET5cT674/atl1lcF71ZtQzrNLCFGRNxOglAvYal+O+NTCCOsM9qoYXd9MgHoR8f+HP5gBkpjd8A== X-Received: by 2002:a63:da14:: with SMTP id c20mr13334033pgh.233.1541239828091; Sat, 03 Nov 2018 03:10:28 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:10:27 -0700 (PDT) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com Subject: [PATCH 09/10] drm/panel: Add Feiyang FY07024DI26A30-D MIPI-DSI LCD panel Date: Sat, 3 Nov 2018 15:38:59 +0530 Message-Id: <20181103100900.30313-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Feiyang FY07024DI26A30-D is 1024x600, 4-lane MIPI-DSI LCD panel. Add panel driver for it. Signed-off-by: Jagan Teki --- Note: init sequence is referenced from https://github.com/longsleep/linux-pine64/blob/pine64-hacks-1.2/drivers/video/sunxi/disp2/disp/lcd/mb709_mipi.c drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + .../drm/panel/panel-feiyang-fy07024di26a30d.c | 305 ++++++++++++++++++ 3 files changed, 315 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index d0d4e60f5153..bc70896fe43c 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -47,6 +47,15 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. +config DRM_PANEL_FEIYANG_FY07024DI26A30D + tristate "Feiyang FY07024DI26A30-D MIPI-DSI LCD panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y if you want to enable support for panels based on the + Feiyang FY07024DI26A30-D MIPI-DSI interface. + config DRM_PANEL_ILITEK_IL9322 tristate "Ilitek ILI9322 320x240 QVGA panels" depends on OF && SPI diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 88011f06edb8..e23c017639c7 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o obj-$(CONFIG_DRM_PANEL_BANANAPI_S070WV20_ICN6211) += panel-bananapi-s070wv20-icn6211.o obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o +obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c new file mode 100644 index 000000000000..718631a72d8b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c @@ -0,0 +1,305 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +/* + * Copyright (C) 2018 Amarula Solutions + * Author: Jagan Teki + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include