From patchwork Fri Nov 16 16:39:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 44 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 70FA42E53B4 for ; Fri, 16 Nov 2018 17:39:47 +0100 (CET) Received: by mail-pl1-f198.google.com with SMTP id m1-v6sf17509508plb.13 for ; Fri, 16 Nov 2018 08:39:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386386; cv=pass; d=google.com; s=arc-20160816; b=sjAPsjjSqkXXcRJdDWqdGtJjj2uMla0QbLvcfblRrM+EA5FdCXSM2oVxHO8+dLctFe Y70jVk+26MO3JEktW7DeSKa5Kejfgy7IU9xyXzXJwyPoRjNSopDiavZzkXBm3aToMbCV 3Ip2MWSydWUYi3eYwlS2RgTun21AvNte+dFC9hMvUAB34z4MIvUmVf5C+SNAQkrXMR30 MIKBESL7Ln5Is/4qb21UQCqdZOR3Utk+Iw13CfH9oKMKqBxrdhVVPqTiRz6ABklT52g/ zSE7loscGWmdLxmME0JdBSR7yme2EZTCgB0rXOh+ADHE1s7SpEyibmAayfkAeWIOUKAi Z5gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BNh71MWK36UL5AiiDZH8rXZrXUHyz8v782txUp4gWBo=; b=ESffGHbr2sXhM0GflUV1vH400pOsUsYJqxUpeijIjAhQDqqWNoGMAvHLj1oniLZLlB /cFrkcVdaUluMp5xaugf3Swh+LfIRm15+JviWqiHO3/8gPUcTjw/H8idCo0rJicW9/49 SAukMf59RrOVVbzMs7WxNBheavtYUX9MM9hgDZeaLbWz0tZcrAVVyBIJx6OGlKmoTQio X8v9crzLJR54cu/PzEsUMPIcfE8TDWBAbrRlflAvk0426irVQPvUk0fUFWhCQgxTTg02 iqAQaHv0x34rcp8/+77rjy+71oo0PEfe/oIDBEJ67wvXuv5zYAWs86PxxKIJgmCi3YqJ MRYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EyK+bgba; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=BNh71MWK36UL5AiiDZH8rXZrXUHyz8v782txUp4gWBo=; b=T35NubQlbhwH0zG7QxkV2hdaDy1nn9UD+6PAixDSf0ESj0gHERoNJj+Ql6IIQ5wcTj 6Fxnaac9NdTKMc/SqC79vJKNR6Uzl44fTZ1aDupdwe+ljkN0HuHe2kNvHti4CljMKmEA KB8hF2PQf5dqUQ3RGE3eT2yVH9GipQka8EcPw= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=BNh71MWK36UL5AiiDZH8rXZrXUHyz8v782txUp4gWBo=; b=pLsmGNmnnA0csUnuIgeoXwJU9lCxSrvVeoPLePidrnH62g8nn+rCThfHdolFv5gWRU eR8ej87zm0EyHGVf0zrMf7MeL43eP82eldSXfolyMyLyH+w9DM7ZRkzt6R3lbjlxcJLr d4fJ4iEdv7b3sCuBuPhjhBKqxUM5FEFHsEXCrYvwks3/8nYSemqLmiBg0jNc8Q9UXxd0 RILtPDuKVY4cMx/u7k8aw35i7SjDa1bafCjYIFj8jzFECYpk7opd06ymDsKL0HQDPhml +xVJPifTr7GTnKFXx3WWA1QWL73xHTPu+9XQ4ko5I9XsP3Px0X55edA9B+Mo1w8tD1cm Af2A== X-Gm-Message-State: AGRZ1gIiV30q/I4WmJamLoLf0LKnCHWvOyp45/nqVMiHdU6mesRhX+jh aSWr+HcVUagUEpYNl8iJphFbEko/ X-Google-Smtp-Source: AJdET5ezdY8EpEvApKxq2yc8oewpDqczdd//dKS+5GZ0Fbl39l5j67bxAidpUfA3NBOTZbHP2qe0qA== X-Received: by 2002:a65:5087:: with SMTP id r7mr2638287pgp.141.1542386386161; Fri, 16 Nov 2018 08:39:46 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6a0a:: with SMTP id f10ls4294592pgc.0.gmail; Fri, 16 Nov 2018 08:39:45 -0800 (PST) X-Received: by 2002:a63:e749:: with SMTP id j9-v6mr10402715pgk.246.1542386385822; Fri, 16 Nov 2018 08:39:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386385; cv=none; d=google.com; s=arc-20160816; b=RSpUPU2evnPFjWDRLBRQ+6haLZuhYzRVbxEhu4ZoCJmgZFjE+bsFavJde0sm7VyJqf L0ePeWFo1IDnP6ueWbl3BuvwfBJQ+XFASpEWrLFB7YFkL/rrIGIZvFX2dIJctizzCqG/ oREx7gpJJg2tR4RK1KjpD462AGDMVlmF5cDx+jpzoZG0ae2zIGvc5ZPLu7RKwzi5lKdr guqEFX7ghBSZrdTatVaQ+e5Eq5r/DmCSSTtr+y6Kehn+oYQ99z2Bq+zrSRCOVrKJIR6J m16O6jwITUMLUfzDDc3hB32z+G9TPu9NdWKTBfWc+lYwjSS3ZZfPP1ykfYZjMRCtNHOZ gCVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BNh71MWK36UL5AiiDZH8rXZrXUHyz8v782txUp4gWBo=; b=pQmwK4Z22fuIpMnnyro4l0ac1vbrA2bWhNdC28vFC96LgUrt3Oh08ngpCY9qITEqfF RVogcDKybLRuPagDOZE3sPi9eZjfrA6r63obdTi5UwztUsUgxmrapDERKJIZyClckRuE rQQK3bCIiHylKlvg7SgIYvGkFa6BSfrXKLO+6YJ6uzT3EfwIlHOScgF3gjDu7pCfvrYl zSIRsmGtKcBldESPI/CL0aLAE3TdpKpSNvyx5NNwA7IjY0d1VWN47XUmbr8l7uAGqibx eZtQWG2xaDC0kgpDfgple34wU9GV1u9cSopfuQr8wA71vKG3ctxgNciLowVu4IfD7ERE 5Adw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EyK+bgba; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z65-v6sor38529138pfz.36.2018.11.16.08.39.45 for (Google Transport Security); Fri, 16 Nov 2018 08:39:45 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:2292:: with SMTP id p18mr8881397pfj.9.1542386385490; Fri, 16 Nov 2018 08:39:45 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:39:44 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 01/12] drm/sun4i: sun6i_mipi_dsi: Compute burst mode loop N1 instruction delay Date: Fri, 16 Nov 2018 22:09:05 +0530 Message-Id: <20181116163916.29621-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EyK+bgba; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Loop N1 instruction delay for burst mode lcd panel are computed as per BSP code. Reference code is available in BSP (from linux-sunxi 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 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index def145086a5c..43ab7127d428 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -379,6 +379,24 @@ static u16 sun6i_dsi_get_timings_vblk(struct sun6i_dsi *dsi, return vblk; } +static u16 sun6i_dsi_setup_inst_delay(struct sun6i_dsi *dsi, + struct drm_display_mode *mode) +{ + struct mipi_dsi_device *device = dsi->device; + u32 hsync_porch, dclk; + u16 delay; + + hsync_porch = (mode->htotal - mode->hdisplay); + dclk = (mode->clock / 1000); + + if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) + delay = ((hsync_porch * 150) / (dclk * 8)) - 50; + else + delay = 50 - 1; + + return delay; +} + static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { @@ -418,7 +436,7 @@ 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; + u16 delay = sun6i_dsi_setup_inst_delay(dsi, mode); regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_NUM_REG(0), SUN6I_DSI_INST_LOOP_NUM_N0(50 - 1) | From patchwork Fri Nov 16 16:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 45 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id E445F2E53B4 for ; Fri, 16 Nov 2018 17:39:54 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id r13sf15775428pgb.7 for ; Fri, 16 Nov 2018 08:39:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386393; cv=pass; d=google.com; s=arc-20160816; b=IDoDrHlDYhxsn0ht7br4eqhvYg/Sdn45oLUYwBD3YEU5vPLJBUxYrnQhX8Wro2s5lu Ag3FQ56Y/nrrRAqizwI3ikARlEnjM2RNucq1urnlo4tXl4Pq0qKe2P0ptvULn+HvBDyg Pw/8GsCwygBiMmFcjEmDjMc4v5Nnr/oMFMWl5BPFuJU518qucS3RQhFxZ9qw1GbLvDe/ SwbYccl92umIl8v1rMWOrwYLaHyfVLVT+xX6cNDF6n/NfrIF/qIDvHJZ+QjIPNslANaf OZfa1YYPdxX4qw9TF2PfHXA3yfjdGiu3hQUOjVgEXMnGFMCcDwNgSp+c2EGqqQIH7LfZ dp6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xfw1G45o1zFW41lhUipKSvIxM7Mirg3j/ORexArSSOI=; b=n2rhH0Zd+sU0mcIaWLMgS3Co79CsV+Sf7F2srT0ZpgX7SDcir9slLEB6M+F89x9HGV yfzi9ZPL1LwUGUptuk7Eo0vcPgJI3cOIXqssrobVH3o+3Mmx2wc5TToZvFYL8mhwzbKD 09HTTv2xe67CGs3lU/HxaiDzYFSA7UFPptXp8lh+cUd496/CGK3OLh2A1bPxxmLA6ngJ Xajby+pXaUB0/cox3NzjIQgtKW9e+CuFDcmHOh3N1IKj1JjMHj1WbtomqzbOeayXbq5f qJ8qMvgJ6kX82s5vxUOkuWsNf3v/95/5tR2oVgRh0sFrrIn7OF44r+9/PpkLVwtY3kkT DY+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHk+yUcw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=xfw1G45o1zFW41lhUipKSvIxM7Mirg3j/ORexArSSOI=; b=kWYwpT+TRgYDTvRydTTXr+GsZP6tNf3CfyLgB+Nx+Q3foxisxRATf+sWOHeOOlA+8p M8j6ENtSlT/ddzy9BLC+21wDZxUAO/Kl16sOKr+EIK8+iL54i4lB+n3BKpCDtX9hkAoM 0ZfsrLXN5SLtVDzmkjj8B/ZIKfBPwEELgJrRU= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=xfw1G45o1zFW41lhUipKSvIxM7Mirg3j/ORexArSSOI=; b=idsLAmDokxAK8b9mnW7Oblel7CV6uIwcJJwIo7yMVUiS4wjuPbqCDpSRmSpioW1Q7c StX/+UvRZ2GhH/UYrTKGXzvuCvpbTntq4CkEf3wn9CCAgnRsk1oIXysav+CXY5djui9j 8zNX0fIugcVvIqL30BeZEgi9uZMZu5wAP1z68uf/UEN9Ap3tVLKrXE/cwBcytQq64o4p xjBjlhtqPHyO7k3OsPTI0vaEnngwblYoVgvjbti5eop+ufQmO1TQNvQ6E1FJtjjRRE9M QBU5BoMJdpWP7ds6cSm1HcPV31Zw1pm6fxn81Xf3AhZDlkZoqIL8COdnbzy9WhPQxZJ9 tFHA== X-Gm-Message-State: AGRZ1gIHzJzRUE/30JDXi1hKm11gd1paotlp0GXEBsmrKa693+bX/aWl wjoIbHea4Jne8C355qxB8uW3th8u X-Google-Smtp-Source: AJdET5c0/tP9KmJfCdQKvFOdSjDKLw6zyo1n0qIgJnKzUAuJ+jzowULEf2v0JnQRPucfPsqOThxMaQ== X-Received: by 2002:a17:902:7795:: with SMTP id o21mr2149002pll.17.1542386393652; Fri, 16 Nov 2018 08:39:53 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:ba43:: with SMTP id l3ls5928777pgu.7.gmail; Fri, 16 Nov 2018 08:39:53 -0800 (PST) X-Received: by 2002:a62:528e:: with SMTP id g136mr7744286pfb.111.1542386393351; Fri, 16 Nov 2018 08:39:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386393; cv=none; d=google.com; s=arc-20160816; b=m8reFj82Tv6H15kVm7uEVsERvyzgHVSIWNmex5JUxs/tyDVXbQhNy0M5g6tjSIa/qE DNETPNSL7jALzH1/k0saQtOiojEjeWz7RSk+j0qqVqlX4GSWPWQk1+xafXm95zrOF6C7 xLhNrhbW8ld/0Y88hy5ZVKsFeVCePur+A6GrSdQ/+4dfWTkTUxGVBUkHOT95b98+Zv5X RUYbUwNTogOpaOsJb6s+EagM1mNeJwpCTUU0qvkLZyjhu+hqHDlKEYMlyGjdHD0KNLjX s4ongiDpBmaEKUGPvn2eiMaV0e1D/3ExHzR4MM/jk9ei8RaaBIZ0DQ/4EqL4GUkko0cj s0WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=xfw1G45o1zFW41lhUipKSvIxM7Mirg3j/ORexArSSOI=; b=CpCQRa9L/7TgqDpDaNa+35W6jcczLe1ioLeAxzr/Wuuiyyedu1Fk3kOKur7rzEq3Me zsgDZbOcXc9xtUeyC8JTD2vzfE0Qqf0VfjUit5zhbkEErDR50rZzMbppjAdFszII0Zi0 u+udrkOe6nuIjyf2lBFTsjHGX6Vvd67gCQEhjNT+LJ2rc20BQCN9E7vxPpra1I2ZJaPm aMVmhSm9Oy9jMqI8FasEesebfoQzQ8LFrouD1vnL3GnHyz7whr7V7nb5ug9YT/NA6qQQ Hu4mANOyxU2ESELcMIMMasq6Q+xuAHLQn/shn5vOlmWZdgeYmaVjE8iU/Gi6h80PqExg 1Q/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHk+yUcw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e2-v6sor38429169pfb.55.2018.11.16.08.39.53 for (Google Transport Security); Fri, 16 Nov 2018 08:39:53 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:6241:: with SMTP id w62-v6mr11758075pfb.69.1542386393003; Fri, 16 Nov 2018 08:39:53 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.39.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:39:52 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 02/12] drm/sun4i: sun6i_mipi_dsi: Support instruction loop selection Date: Fri, 16 Nov 2018 22:09:06 +0530 Message-Id: <20181116163916.29621-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHk+yUcw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instruction loop selection would require before writing loop number registers, so enable idle, LP11 bits on loop selection register. Reference code available in BSP (from linux-sunxi/ 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 43ab7127d428..3ac002c4d8b3 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -438,6 +438,9 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, { u16 delay = sun6i_dsi_setup_inst_delay(dsi, mode); + 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)); regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_NUM_REG(0), SUN6I_DSI_INST_LOOP_NUM_N0(50 - 1) | SUN6I_DSI_INST_LOOP_NUM_N1(delay)); From patchwork Fri Nov 16 16:39:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 46 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 8C0D52E53B4 for ; Fri, 16 Nov 2018 17:40:02 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id 129-v6sf19478906pfx.11 for ; Fri, 16 Nov 2018 08:40:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386401; cv=pass; d=google.com; s=arc-20160816; b=guagvwHkeo7QbLH5X1y36lusrE5PeBt3S1tGzMGLTXoXNsiucNjErBgAVp/vVR0Zzk eZvWxHWbBoXFcGFj1iZXjQFkBwEtt3iIqnIb0rwSSTxyp6OG4Za4dUtlBuhMltGXjgdT sGKBI1/as7nyqYNxf9H+Ng4ypKHb7d3F20VMLPhMR34eJEdUppY3L7VFklYLGKbghlyt rje7MKE7mbT0G146ddDqwyIhfnbkS6mCYJofyqPy3WThKsOvgKq8xR0w7y4ljGWniN+d Zqrr1JJs4R9JVYbojUUuIK29zUJ5lYUkcmtMqX2/z4IeHbagVAeEXAdzNxwl9x76k78e HYlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1dP1vOMxWacxYs/v4J30IWXfhdx6NrRFGWFTZApmbYU=; b=nKIlYh5rynO9y4eXwp5B9uqLJXKlIiTxADwqIK5iWQ02bQunheIudpW9bMzehb8H/X dy+PlbHJXZ3JQ74DlAHfXBPoTj0qSx4qM26sSjvQuWVucZ8E2QY4/NrU660h/ok0129+ OdXwkcvQYQAvJqc9GCvB/KpVcZ5dxgz1d3SobXgOD5VTuKiX/czuBryCMVpBbBAd8t5j dWOq5qOAClHYgVZunSimbVyjEQHZc2yYM8lULnO0KZKtbv+c9qNMLkosAls6U79F6hkq zcwWVeHdcT7kLCbluMXWfI4a2hXxRL5Z+5iYoG9fa2Yqsy8LUjk5TD/ILVn4v9By5He+ vDBw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ceOdo43z; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=1dP1vOMxWacxYs/v4J30IWXfhdx6NrRFGWFTZApmbYU=; b=HiHimCjbH3t5pyZD2nlgXEIFpZXb1ZVWFOxBpCh4jqc2Zu47KMo8pw8ar1Uckr2EwU NClS9B/e2PLiAk8svUaW0hZ0XuR0DvUaTg689I3y+zl764tZONu9TOULIpztRrrOw2gB tHQFgbQQ1yRyAUyV2k72zf0BIXCZu928MAUbk= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=1dP1vOMxWacxYs/v4J30IWXfhdx6NrRFGWFTZApmbYU=; b=lP3QihqutlxlM3mkiUOTj/vs2eI/VKmkY9gXb8XdOcyhsQXiJd9WwZCsL7pbULeYSJ 9NPudXujKtcWrklyfh4ZFNdMadihndBkReYbr0Chq+ya6k5qT8mvdEHZWTCmIay/YUa+ a8osCMd2LrkP9tw/Gk9q5sqry7UiqeD/IqVgKrdDxm6cG1SFt8Yl3ndJRLyD8owqcpoY DnphGblaNq0/mGvBxWiJyL/k6pi+wmWtg0onyLGpoEq91TY4K81mXRGOci96lg8iD/RO 0BWx6IOuQL6nP3Gq2ploxaL8prIiVzllAiWRrZaXRXc4Qv/TKKVJbFDU3AOJdrPc9OMe bGYQ== X-Gm-Message-State: AGRZ1gL7JInT3RChhBgsQAslVFuPwHCUGk1wGsBO/fbxAGiCTQkt1x0u FFBv0g+nA/EVQen7N/v4gcrBEyds X-Google-Smtp-Source: AJdET5ejYqtqu+ehEZuS0N4XsT3LAclaq03MCcoh+AGICN37XrYlLe1bwFjfL4Jpym2Z6AWDNiTS5Q== X-Received: by 2002:a62:7d11:: with SMTP id y17mr2646033pfc.117.1542386400936; Fri, 16 Nov 2018 08:40:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:20d5:: with SMTP id m82ls4935452pfj.5.gmail; Fri, 16 Nov 2018 08:40:00 -0800 (PST) X-Received: by 2002:a63:7a5b:: with SMTP id j27mr10656232pgn.112.1542386400593; Fri, 16 Nov 2018 08:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386400; cv=none; d=google.com; s=arc-20160816; b=rGScDkNoH/sHFqhsBS8oUbvBmhlWGpcZP6TAqsy7/ki9nL6sFg5mTzLTw4VRHjKKCG r3Bm9J+BSeb/zZepkJJl8e+Ue5FvhES6SgMdQKkXfQrUhOSYwd/iLRIwWUuA7OdppmhT f6Mq67Rxg/eZsldpQ2TluhxhxxAjne3qPyNAVJqBcRz0WP3UMvUof6AheMMfO21ggAd2 ZwN7KnaYVya/+tDtHd2Q7s1wZ5GEL0GdWRhbtDswad4/z/GF1pdaAfyr3hey8wAQ364i n1sS0f6FDXkpqqYHggmw3uWOQHhpg0rJwWyVWhKlL7vG1xLNp6609iGe+fxnjilAs6om tRuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=1dP1vOMxWacxYs/v4J30IWXfhdx6NrRFGWFTZApmbYU=; b=glWEF7XDlz2yjM/GW/s1rvYQFFdkpWNmp/2HmozGgZfo3fHc73vbodsgNUdzfcLNGE UGzFFYLyQl3y/MfHLEI58PC9J2YbbVxefsdo2b2uBlq99f6Ei8R91kIAf35gF3s2EvS1 /LUyIquReXNPOl4ODjwagLReYrsAcYRm5JDlp74820+y1VN5PDzJEdZGMyXTcD8F20jo hYUm5tq3WRhLKNI8EqlKDRwT7MNPFURoXdXVxQEH8wwhTcuPW3in2vkT14sHFnEqvAZ/ mXdyl9BHYAm8b030gosqnhLDkI/PYgf2ZGLVfvmkBB5eN2XjUbUxDNFILfFOxB0uUju3 YMqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ceOdo43z; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id q5sor11845497pgv.82.2018.11.16.08.40.00 for (Google Transport Security); Fri, 16 Nov 2018 08:40:00 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:1412:: with SMTP id u18mr10422416pgl.247.1542386400202; Fri, 16 Nov 2018 08:40:00 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.39.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:39:59 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 03/12] drm/sun4i: sun6i_mipi_dsi: Setup burst mode timings Date: Fri, 16 Nov 2018 22:09:07 +0530 Message-Id: <20181116163916.29621-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ceOdo43z; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Burst mode display timings are different from convectional video mode so update the horizontal and vertical timings. Reference code taken from BSP (from linux-sunxi/ 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 | 128 +++++++++++++++---------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 3ac002c4d8b3..efd08bfd0cb8 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -153,6 +153,14 @@ #define SUN6I_DSI_CMD_TX_REG(n) (0x300 + (n) * 0x04) +struct sun6i_dsi_timings { + u16 hsa; + u16 hbp; + u16 hblk; + u16 hfp; + u16 vblk; +}; + enum sun6i_dsi_start_inst { DSI_START_LPRX, DSI_START_LPTX, @@ -379,6 +387,60 @@ static u16 sun6i_dsi_get_timings_vblk(struct sun6i_dsi *dsi, return vblk; } +static void sun6i_dsi_get_timings(struct sun6i_dsi *dsi, + struct drm_display_mode *mode, + struct sun6i_dsi_timings *timings) +{ + struct mipi_dsi_device *device = dsi->device; + unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format) / 8; + u16 hsa, hbp, hblk, hfp, vblk; + + /* + * 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 + */ +#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 + */ +#define HBLK_PACKET_OVERHEAD 10 + hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, + (mode->htotal - (mode->hsync_end - mode->hsync_start)) * + Bpp - HBLK_PACKET_OVERHEAD); + + /* + * The frontporch is set using a blanking packet (4 bytes + + * payload + 2 bytes). Its minimal size is therefore 6 bytes + */ +#define HFP_PACKET_OVERHEAD 6 + hfp = max((unsigned int)HFP_PACKET_OVERHEAD, + (mode->hsync_start - mode->hdisplay) * Bpp - + HFP_PACKET_OVERHEAD); + + vblk = sun6i_dsi_get_timings_vblk(dsi, mode, hblk); + + timings->hsa = hsa; + timings->hbp = hbp; + timings->hblk = hblk; + timings->hfp = hfp; + timings->vblk = vblk; +} + static u16 sun6i_dsi_setup_inst_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { @@ -506,52 +568,22 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, { struct mipi_dsi_device *device = dsi->device; unsigned int Bpp = mipi_dsi_pixel_format_to_bpp(device->format) / 8; - u16 hbp, hfp, hsa, hblk, vblk; + struct sun6i_dsi_timings timings; size_t bytes; u8 *buffer; /* 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 - */ -#define HSA_PACKET_OVERHEAD 10 - hsa = max((unsigned int)HSA_PACKET_OVERHEAD, - (mode->hsync_end - mode->hsync_start) * Bpp - HSA_PACKET_OVERHEAD); + memset(&timings, 0, sizeof(timings)); - /* - * 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); - - /* - * The frontporch is set using a blanking packet (4 bytes + - * payload + 2 bytes). Its minimal size is therefore 6 bytes - */ -#define HFP_PACKET_OVERHEAD 6 - hfp = max((unsigned int)HFP_PACKET_OVERHEAD, - (mode->hsync_start - mode->hdisplay) * Bpp - - HFP_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((unsigned int)HBLK_PACKET_OVERHEAD, - (mode->htotal - (mode->hsync_end - mode->hsync_start)) * - Bpp - HBLK_PACKET_OVERHEAD); - - vblk = sun6i_dsi_get_timings_vblk(dsi, mode, hblk); + if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) + timings.hblk = (mode->hdisplay * Bpp); + else + sun6i_dsi_get_timings(dsi, mode, &timings); /* How many bytes do we need to send all payloads? */ - bytes = max_t(size_t, max(max(hfp, hblk), max(hsa, hbp)), vblk); + bytes = max_t(size_t, max(max(timings.hfp, timings.hblk), + max(timings.hsa, timings.hbp)), timings.vblk); buffer = kmalloc(bytes, GFP_KERNEL); if (WARN_ON(!buffer)) return; @@ -590,33 +622,33 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* sync */ regmap_write(dsi->regs, SUN6I_DSI_BLK_HSA0_REG, - sun6i_dsi_build_blk0_pkt(device->channel, hsa)); + sun6i_dsi_build_blk0_pkt(device->channel, timings.hsa)); regmap_write(dsi->regs, SUN6I_DSI_BLK_HSA1_REG, - sun6i_dsi_build_blk1_pkt(0, buffer, hsa)); + sun6i_dsi_build_blk1_pkt(0, buffer, timings.hsa)); /* backporch */ regmap_write(dsi->regs, SUN6I_DSI_BLK_HBP0_REG, - sun6i_dsi_build_blk0_pkt(device->channel, hbp)); + sun6i_dsi_build_blk0_pkt(device->channel, timings.hbp)); regmap_write(dsi->regs, SUN6I_DSI_BLK_HBP1_REG, - sun6i_dsi_build_blk1_pkt(0, buffer, hbp)); + sun6i_dsi_build_blk1_pkt(0, buffer, timings.hbp)); /* frontporch */ regmap_write(dsi->regs, SUN6I_DSI_BLK_HFP0_REG, - sun6i_dsi_build_blk0_pkt(device->channel, hfp)); + sun6i_dsi_build_blk0_pkt(device->channel, timings.hfp)); regmap_write(dsi->regs, SUN6I_DSI_BLK_HFP1_REG, - sun6i_dsi_build_blk1_pkt(0, buffer, hfp)); + sun6i_dsi_build_blk1_pkt(0, buffer, timings.hfp)); /* hblk */ regmap_write(dsi->regs, SUN6I_DSI_BLK_HBLK0_REG, - sun6i_dsi_build_blk0_pkt(device->channel, hblk)); + sun6i_dsi_build_blk0_pkt(device->channel, timings.hblk)); regmap_write(dsi->regs, SUN6I_DSI_BLK_HBLK1_REG, - sun6i_dsi_build_blk1_pkt(0, buffer, hblk)); + sun6i_dsi_build_blk1_pkt(0, buffer, timings.hblk)); /* vblk */ regmap_write(dsi->regs, SUN6I_DSI_BLK_VBLK0_REG, - sun6i_dsi_build_blk0_pkt(device->channel, vblk)); + sun6i_dsi_build_blk0_pkt(device->channel, timings.vblk)); regmap_write(dsi->regs, SUN6I_DSI_BLK_VBLK1_REG, - sun6i_dsi_build_blk1_pkt(0, buffer, vblk)); + sun6i_dsi_build_blk1_pkt(0, buffer, timings.vblk)); kfree(buffer); } From patchwork Fri Nov 16 16:39:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 47 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 99BE52E53B4 for ; Fri, 16 Nov 2018 17:40:09 +0100 (CET) Received: by mail-pg1-f200.google.com with SMTP id s22sf15771447pgv.8 for ; Fri, 16 Nov 2018 08:40:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386408; cv=pass; d=google.com; s=arc-20160816; b=aRrhV7pLRsU/h3dOQYCSNZ50EQBT4Jclc8yvdXMY3agB/UU7Avow0BRP1ABjWdjjiq dbhW0FRVEXDW3twZ8QIkLbWCAT7qpaGn50a5Wa+joFfTpnJDhsMGUELo9SOquVJtfHIa JsRsGiynWmPHWHADdlxk8umO8tHtK5q7/iECKRMHi1rYagf81P1E1rtUyfFFenAMC/px YqpKZdLPDXSkHjr2cK4Eh4VMSJU683p2OjbXCQ3lxatjlFKpTZTizqx2s8qHhXHl5lOw hh6MoGQ2X6mKVaN9BOdtLyxYOT1nlzSdSR4QN+nQqUQu6Mlmpck6qpgiOaqRLFhA/BZV +EfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YBsrf76ZM/i+rqqgf+m+LE5qjwwWDpXcodR4cqVxPuQ=; b=Iabqq9FpCK+WHSlq63akREYHhaWw5lhsDIfnpJusCrnbVeMu+EFooTwhWEMQ+d03Cp 70FHbP9EoWfLH1Do/9dHOBlM66Ie3fTN3r+l5uOSRbls+aezIA6OwN1FApK03VQ+/DaH qZ1FOZSXYgl4sOeYgy72zhq1ifOX3QgHTRy3xO266QYJD66VDPh/uTW62Re8tnLA4zGP t8+HaSwrjmAZ71X0ETB4ign07uV9BewUth7isl1aNcz79+II0zurT+Jr71YXtp6do47j fryUESwOgJgb+8FiMYmKihRA9ctrpXA2RJmNoVVvvRfmXbc5JDyCaVk6cs/l2sojAej6 cKfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WB18R8Bf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=YBsrf76ZM/i+rqqgf+m+LE5qjwwWDpXcodR4cqVxPuQ=; b=YWGpfUrVInjkJjrYfLwKJyTtD+bQw7BK8tlP6a1iPZ6apmWOYMLr4HdRMggv+mOeKN uRpN9/wdgls9v/toEaiS0zwJRrl0xQmn0b//wt/SDFYmRhC+soupktjG1ykokx9oQCgX vST7P4a1LVU32oaAZOFQ3hTaHNLBl+1VB6qI4= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=YBsrf76ZM/i+rqqgf+m+LE5qjwwWDpXcodR4cqVxPuQ=; b=sqGcxoKg+jn+uH7pLgbSZ8ex0MPvNoYF+2T3508SvbQs2YYqKY2KhIXb2A08p4+wuJ nCOaDmitTFzcwtR73hE+xUYrITRMQsYMO1ePqxRAUW8D94XwSs6DJ++w24IaG/kLeChy aJ6CdIcvPMSGs+4B8QhgV1aA+dp6NtZFDU81asAKEgrwk4hBi1MkSvgFATf7RL1GsToH +WdZOxFSBiLj3KSqT2a/F8rjNj8qFaZMQq1ORUaiG+Zcyh7aQngBM/EnBefxX8Y0moqQ oHecdhzzAaghHhVbq1fqo9hspViNbtk2v7tNRMJvPxQkNRvApW0S3sLR6/WoZb/5fWEv Otbg== X-Gm-Message-State: AGRZ1gLtopYO8G8nP/sXuhwnxQI9qh807o/VVUFyPNcQGhs4fcUHCVcL 1KLp0NUrhS7Xql8epiHryMFYWmu+ X-Google-Smtp-Source: AJdET5eyL+3R8y7x+DZvTnfyNuDDIZGu5TyFUszV/Ze+eQ5os/gIYc8SEHHBo8zFeA0DO0GlTheztw== X-Received: by 2002:a63:5503:: with SMTP id j3mr2603742pgb.89.1542386408315; Fri, 16 Nov 2018 08:40:08 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:618a:: with SMTP id v132ls6127706pgb.6.gmail; Fri, 16 Nov 2018 08:40:08 -0800 (PST) X-Received: by 2002:a63:e156:: with SMTP id h22mr10658978pgk.255.1542386408017; Fri, 16 Nov 2018 08:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386407; cv=none; d=google.com; s=arc-20160816; b=MjtcsFJUWtU/C8vP817+XHhvDpp6x86n5lzIBFJPUcs9eiW8vOFX6zheG4ZG+Lj1+1 Gpdxtq/bmGS9F3NXzulZvAPzERL+RsqaDpTETxnJhWsEdRSk7nLpEqEeHeiWrrfEoOHC K1AYKMJdgGiTk29ykDebEKkC7CCS8gjWn9nOc+x9Vc4hAptpRnr2YQlMZualY546hCTS 0kCzy+7qANsDp7hlfykMIlCjtuabU+CbU1EO5UX4dzAgnwo3AVJsqGg8loXPguRdDKYJ Cz0LkwONgatEYJPf0Lxc+U+d/DBlftmFUprUywLDV2y34jR80dmooyOkI2SYGm2Gw7+F zdmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=YBsrf76ZM/i+rqqgf+m+LE5qjwwWDpXcodR4cqVxPuQ=; b=vW7kVkyq7/ezlOPVkoKoGnvr0f284mIWXrJbyB6KXqfpXu3Xzqwefyy7NsMxwKyQPl Amn3M2DcdAfSfFFmDy9JgyaqToU6zgRlPhpin4LHi6IU4UshnzZkF/NqGJE14kSAGeud +oM+H2Gz5K8eb7D4kJS/dOr5eIcqDg4XHSlYyb9sa9g/1MwkZrYuDpuy6jkVt+h5GLdg hEvJ3l+BK+eA0Z0ibqAxg2KfSWc1FBjPHtpRJY9rVSolkXyUv+CW9sPbauUFZT8K3QgH Ie8OtclnljGvlWYeLH/RVLe5869f5ZCAhfJf4V99NO2HVCTRdKIUfbNP6AdbxGLuYN9C aWFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WB18R8Bf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e16-v6sor35544206pgh.17.2018.11.16.08.40.07 for (Google Transport Security); Fri, 16 Nov 2018 08:40:07 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:8ac4:: with SMTP id y187mr10597592pgd.446.1542386407688; Fri, 16 Nov 2018 08:40:07 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:07 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 04/12] drm/sun4i: sun6i_mipi_dsi: Simplify drq set to support all modes Date: Fri, 16 Nov 2018 22:09:08 +0530 Message-Id: <20181116163916.29621-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WB18R8Bf; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Allwinner MIPI DSI DRQ set value can be varied with respective video modes. - burst mode the set value is always 0 - video modes whose front porch greater than 20, the set value can be computed based front porch and bpp. - video modes whose front porch is not greater than 20, the set value is simply 0 This patch simplifies existing drq set value code by grouping into sun6i_dsi_get_drq and support all video modes. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 38 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index efd08bfd0cb8..d60955880c43 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -363,6 +363,26 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, SUN6I_DSI_INST_JUMP_CFG_NUM(1)); }; +static int sun6i_dsi_get_drq(struct sun6i_dsi *dsi, + struct drm_display_mode *mode) +{ + struct mipi_dsi_device *device = dsi->device; + int drq = 0; + + if (device->mode_flags & MIPI_DSI_MODE_VIDEO_BURST) + return drq; + + 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; + } + + return drq; +} + static u16 sun6i_dsi_get_timings_vblk(struct sun6i_dsi *dsi, struct drm_display_mode *mode, u16 hblk) { @@ -478,21 +498,9 @@ static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - struct mipi_dsi_device *device = dsi->device; - u32 val = 0; - - 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; - - val = (SUN6I_DSI_TCON_DRQ_ENABLE_MODE | - SUN6I_DSI_TCON_DRQ_SET(drq)); - } - - regmap_write(dsi->regs, SUN6I_DSI_TCON_DRQ_REG, val); + regmap_write(dsi->regs, SUN6I_DSI_TCON_DRQ_REG, + SUN6I_DSI_TCON_DRQ_ENABLE_MODE | + SUN6I_DSI_TCON_DRQ_SET(sun6i_dsi_get_drq(dsi, mode))); } static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, From patchwork Fri Nov 16 16:39:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 48 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 03F1C2E53B4 for ; Fri, 16 Nov 2018 17:40:17 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id 202sf15224279pgb.6 for ; Fri, 16 Nov 2018 08:40:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386415; cv=pass; d=google.com; s=arc-20160816; b=ck/B+Km+6Ks04GnoQ0lvUA/GTfLwtNtjjfGsNpbH1EN7ORzN/GZA2aQ+32f/vsTKyY hihVfcJGrDPSVgg4fsiKRwVPhB/NPiY/dwD3dl0SnsrD1R9kvnaQ5uSmMF/Q96pD3lcg GOfRkFsuwkHYLmh+UCKkDOM2kSAekfClHfgX/hKNwWpPO42WCL15WT/I7wYeYLxp2fDM v3vRhVbLox6TRwhXDfyo84iJcEfbMIrJCp0MHfOKZkZps1Ts1x600zLqCGSDBA7AtoOL qf38UNe62zLrC6ImzJj6QZ0sYlF38vjcNb1Np0HE1ivh9oMokFpILp7JgWkIHSmjI50i PAlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gDd9dwA7Hm3WuIogwPjaX9WwN0ho9g9ngVvPoG/csZ0=; b=xWd7MlU8neOw4bmlRIFkKcmBMLj5LFLOARaGKeC8MZz8f7mnkLQ89DLfUG9rRrwy/P cM/lE6451Bqa1H0ouKWsvWlaODACMG9pI7NoJSiEcmwy5ibsSEzd5eeX+802wc7mmNn7 HLSkQEwOZaP6XWJaunGTTtYoCIblRy8L866udZUj1U0BXu/1d4vfdZLkq8uAbRWPpune 3F2HMRaRL9K3yk1cVSONf80hGY+Of+9uw3an1kbxNj492kvivEHk4YpX2QxMzABsHmNF G3VdEpswDVevbQy3CmxwHLyiEjd+yjKllNcJmqVeQEKPTXTPqDDbn0oDQIMtGG7AAxHv YfkQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gQD9oYMw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=gDd9dwA7Hm3WuIogwPjaX9WwN0ho9g9ngVvPoG/csZ0=; b=gvv5EKIuMUmy6RTTLJMn6gR+9leVTnz9FSj/IPzao1Z392GdI7tnk5aQMVy1YwrTxw TWl0wuYwx7ao49wiklVWvLPJXD7CfgLR+U9Q9AQ8muGDBFjoTyEANjNwKCze/csbAHq+ i3KHbo7CyxXQ6jiG6JfU5WnOwAFg7iCSX0tHI= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=gDd9dwA7Hm3WuIogwPjaX9WwN0ho9g9ngVvPoG/csZ0=; b=dWfurt/igTUCm1i1we8XcPdTCbKGxBXJF+Zi6invvjP7GZw19aoTH14kUodQJ43wYW qazrtFVAJE2JiEv1LJ5p3MvjcNAFEZ/cGMdwvE/wGLGD059Wf7SCq1Y33eO3utGsMxuw wuZGz1OV92jvUKpDJyuZntM+6lBe0dUuTO1xSVLIS8ErMyhXMtheEP4iBuFUs84X2Csb R6xDb+1Tp/Q8qvERkJ/qT5Sr+EChWa0bAAP4/qpNGa1cJP9UPWrJsf7Kc+PtNpck9CTW bX6c98BvP3BwTKNvQa0qamp1aRC3Z/Rlp9eFQ8emRxneKqQ120WV/yqkk61m8kWb+Q/j yCTg== X-Gm-Message-State: AGRZ1gI2ejQ3jh17hlcPQiybGCBbZgCOSIBFww4nlfOhThBTn9lOB/dK LMDcP91W9y0S6+1Va+q/TXd/aw82 X-Google-Smtp-Source: AJdET5eAsT3vpGGs6px14Xf5nN2kan7Q4EjypKzMbLG63+hR1fde8PSJjMlipV810KI33/TFOijjxw== X-Received: by 2002:a63:4c22:: with SMTP id z34mr2630838pga.111.1542386415720; Fri, 16 Nov 2018 08:40:15 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:41c7:: with SMTP id b7ls6124350pgq.11.gmail; Fri, 16 Nov 2018 08:40:15 -0800 (PST) X-Received: by 2002:a65:4946:: with SMTP id q6mr10299905pgs.201.1542386415400; Fri, 16 Nov 2018 08:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386415; cv=none; d=google.com; s=arc-20160816; b=canV0LxYOD1zxuHxp8lUV+jNB5/5vZ5Jl1W4MwPG17x5GgZVHNhr5PRLimZdW9A8hv VDsT2RgR6aq41E+tfvkoziJLYIvmHu6+qTFMUaihhwfi1fhgkVYoXGyXTOL3IkXO+G1K xrxYfzVMRUrFvfwcH4WF6vyBIXlRhs3HITiurbYnVkMKf9v6GeKeiXmdIAs7zi3SykmA 2xgI+Jyad1fy4Da4qG2Mywfzak7DOvH/d88Cl+rXVjiW3sEiMPGz7TIK5oZPnFfsASyj GKfALiR5O/3MeTSMszQG2TxHVaAm16UxmVT8EEF87g4eE/dEj/keBH/2PsQPUz9BNBhN I5HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=gDd9dwA7Hm3WuIogwPjaX9WwN0ho9g9ngVvPoG/csZ0=; b=OMOIMdl2zoPIxdad7pO/Oi62erScpiXVtMsRaRvtstFKTOrON/vFi81/So2ajHME58 GD1Dizy7eSYt77As2MkpIOxKguUXbvY3v2Bw2ppxc9zbohZItfGemy3UEdKl3U3/v790 WGL+Y6rua0uYwGmVozOX7tPZLJS08GeQvxFS9m24nTcPKmga+FaBkgu4OA9pj3+qOp7Z nASRM9EX+GMALAJ3Dd3tB9U6H1/4mrMnvEjRCurZgRrHbs3mOIBagst5aG2Jx8M1fHzs kTCEpTUaC3r09txo65x4scjmLoj0lfJqa8aOGZCr5LXnbLyXItZqDW84Df2CudOger3K KdDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gQD9oYMw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id d39-v6sor37419329pla.28.2018.11.16.08.40.15 for (Google Transport Security); Fri, 16 Nov 2018 08:40:15 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:d03:: with SMTP id 3-v6mr9444498plu.66.1542386415050; Fri, 16 Nov 2018 08:40:15 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:14 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 05/12] drm/sun4i: tcon: Export get tcon0 routine Date: Fri, 16 Nov 2018 22:09:09 +0530 Message-Id: <20181116163916.29621-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gQD9oYMw; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Sometimes tcon attributes like tcon divider, clock rate etc are needed in interface drivers like DSI. So for such cases interface driver must probe the respective tcon and get the attributes. Instead of probing tcon explictly, better export the existing sun5i_get_tcon0 so-that the relevant interface can reuse. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index c78cd35a1294..6e85a33c6828 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -221,7 +221,7 @@ EXPORT_SYMBOL(sun4i_tcon_enable_vblank); * are located in TCON0. This helper returns a pointer to TCON0's * sun4i_tcon structure, or NULL if not found. */ -static struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) +struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) { struct sun4i_drv *drv = drm->dev_private; struct sun4i_tcon *tcon; @@ -235,6 +235,7 @@ static struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm) return NULL; } +EXPORT_SYMBOL(sun4i_get_tcon0); void sun4i_tcon_set_mux(struct sun4i_tcon *tcon, int channel, const struct drm_encoder *encoder) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h index 3d492c8be1fc..195deb9db57a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.h +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h @@ -273,6 +273,7 @@ struct sun4i_tcon { struct drm_bridge *sun4i_tcon_find_bridge(struct device_node *node); struct drm_panel *sun4i_tcon_find_panel(struct device_node *node); +struct sun4i_tcon *sun4i_get_tcon0(struct drm_device *drm); void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable); void sun4i_tcon_mode_set(struct sun4i_tcon *tcon, const struct drm_encoder *encoder, From patchwork Fri Nov 16 16:39:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 49 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 6CA0E2E53B4 for ; Fri, 16 Nov 2018 17:40:24 +0100 (CET) Received: by mail-pf1-f199.google.com with SMTP id o28-v6sf16303871pfk.10 for ; Fri, 16 Nov 2018 08:40:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542386423; cv=pass; d=google.com; s=arc-20160816; b=S3JGYzpUPei2EeXLo1Ye30q8/q8D3wDnSWtw2IrG6tfL0s1vm+RXxGmY88JY8qBkwC 55sHE6JQi2LbFIU5Pnqn9TiYrhV7pVx6JouQuuwbMa8qMbjahCRfZZZ85QTO74+nir+i DkF//tzCUoTkf9ii2OWxeuNtvCvFch7Ws3r5+FHxK0+TVZ+3bh28F8aaq5nRQAqkAIDq N73YOkIxVQ0SvceYHokalqp3o6gPL3Esdbb/uOqIK8rHeDqDGwkFXO7q3TgkdZvWUd2W bmscAL5iVjB/QIdhRA47lVrop+Z8qs5MfkywYXq/nYFzpAf+3MUvjgtlz04mbuJg5vbo qnYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LrO967p/LnLVx88kJuV1gNk2tEKJ/CRJkfeL25hLlO0=; b=AYPnQJRxjuMgRJ9O/3rQRk3GfsZzta+odzRtMKA4hExGj52MmKsPicNOyOoq0ubayh 64RUd4BLEf0TPekasAXbM9423UtQkuSqab7k8P1L1OBEzjvYVs/Yew1nZGJHOuKoiL6y wrdAQyQLle9JLABtuNT2X4sT0RjFsAYABE3Kuo6nLNBCiPWhBT85ly5tj8GPzpSgTzFt reEqaSmJypIXarnHpzcq/MUl6XZmVzPE0+CUpfoI/v3wK+6efkBpXKZNA6MRWYqfB6xt fXNsIgBbkkcwhv88y/HRCJKS3O15KTTdaaNuIpL0AqBY2tMhrt1qBeqV2gBs8RBkixMb hIZg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lcFeO38E; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=LrO967p/LnLVx88kJuV1gNk2tEKJ/CRJkfeL25hLlO0=; b=KLKYJXMdGIoOfPu4BM8YPo05BgfvSSezlt0fcHiWB91JiWs7dXh4TMyBjF8Sg2IB34 C+XjDSyy7koCw6tfnjaxXMix6sZBGaEWX8ySZHuRx8mAq3sNiVHjvjGHnw4WwLHbITYa tM78+1Aidwss+vkGnOwbh1HbJOei8SwzXydjA= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=LrO967p/LnLVx88kJuV1gNk2tEKJ/CRJkfeL25hLlO0=; b=HuA24qhraxEU2bu6xL1AC1SpdYx1P5GhTD8Q4xj1mMpKLLZkV/Jp5BywMCvsHttsd9 Act0pv/29C2QLTjFGvO7E6ru/sdVDzMrrlUuDIJNYKKl0VshfD/Jzl2oagJFM3OVVfFO TF3TDpw9Qp4GwYspIVtRnXnTPnrcQcVjwTOR19+08pV5905yP5ocBL6aNwi92Ubeygrt 5Ir8xJ/7QJLkfUc7inV5hktx8Gw7YrfprJOSysdb4DMXU/59WNjk7auLBeEoj+9l05XD eXM9jVOgOecTmN6axz93jtwFFRhlaYr+np7/vI7ASAkQDmLcTZe7jcux4H9Xt/YyJg8U qM3w== X-Gm-Message-State: AGRZ1gJg7gOgOFSvIliShnI3eFbBANjL43K1T/oGICKZUnm1/UAF20Kn y0ZU6AkuxfjGwtvCGa4rMlLdF8gd X-Google-Smtp-Source: AJdET5cWRGJgk3Y7+txHEIZWWHV4nOBrKRrXrrqdhsLW9fcLYt0zUD343t8wvYNy6EoZdHbf7p8rWw== X-Received: by 2002:a62:7693:: with SMTP id r141mr2618093pfc.119.1542386423160; Fri, 16 Nov 2018 08:40:23 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:ac86:: with SMTP id h6ls6276750plr.2.gmail; Fri, 16 Nov 2018 08:40:22 -0800 (PST) X-Received: by 2002:a17:902:8f8f:: with SMTP id z15-v6mr11657321plo.257.1542386422852; Fri, 16 Nov 2018 08:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542386422; cv=none; d=google.com; s=arc-20160816; b=QEtx/DEz2gGo7ZHfnOxI7VgsWlklvUYWoZm1U/bEW+FiVjcfQNg2uetZ4MS1qo3cfB ODPzU8KVCFaNQO+4JjtIi6amdMjp6ESXXHYNLIJT1SLSdivROmVznCJx6IqKE1HZsAsS CiP9COWvepIKKTkc5EAPH5+7nVkD++dhCZ9TnhQA0pNWCoTlMzssUcm4BWi6U7wPtIrx rTGoOs46HXNnCSqRUBU9VSRtdJ8EKBqHflCBowwSzfdhFMuVNSa1GsByyVe+42E+5Npa unKQA2rHUXWGvZZkmjAyqPy8fll5VLDK6pAW5jmn3F0tjnmehnZltU9lvrQxMQl+bwqD lHZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LrO967p/LnLVx88kJuV1gNk2tEKJ/CRJkfeL25hLlO0=; b=fVwxghZgzak6tkoUqso9tmnN3JyKwnn08Pl46NdpD5UOT3rIpZx9uBrQi+c08Dxd9s zLFzPCsiO93cqwLugMpzR4PJ8vGe8Yj1tyyszq2ANRBsWe+tAdcjkEZjtQsscMoZzGRW wCYIazcMvpXqbDU/DUCr8F0gCQMg2F2LAuasypFFE52+6AypdUFmYWlKGIky258Ie8QB WQNOplBtSISqF5ajMyJ+blPcTBW9kAzCF9QISJHHq0u6fBJKG6beLkmzSOzA9ojVeyx6 lHobRiglLj8hiTJxsdFvaqlDymiBM20HyXhDu2pJpIjIW+mi8SadfrK4CODKdquijCU6 ylEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lcFeO38E; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 59-v6sor37398805ple.72.2018.11.16.08.40.22 for (Google Transport Security); Fri, 16 Nov 2018 08:40:22 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:8608:: with SMTP id f8-v6mr11311783plo.95.1542386422513; Fri, 16 Nov 2018 08:40:22 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:22 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v2 06/12] drm/sun4i: sun6i_mipi_dsi: Probe tcon0 during dsi_bind Date: Fri, 16 Nov 2018 22:09:10 +0530 Message-Id: <20181116163916.29621-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lcFeO38E; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Probe tcon0 during dsi_bind, so-that the tcon attributes like divider value, clock rate can get whenever it need. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 7 +++++++ drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index d60955880c43..66a01061e51d 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -25,6 +25,7 @@ #include #include "sun4i_drv.h" +#include "sun4i_tcon.h" #include "sun6i_mipi_dsi.h" #include