From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2674C001E0 for ; Tue, 1 Aug 2023 09:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+cSXYGrZclIAG/NAk7q0KI5zM8RwjPTsuiJVM8KQfDk=; b=jUTFWqqpDyAtGT38T0v5oxwR9R ck3nya1qrxtYjMb3P3Fr92xAbsI4Y6XHFRb2tPL1pSX4QwKzVcMJN7HqfAk17tzNU/krx+eYsIfjj Bii2UN9P8/bcC/8WE+xfHh4RNssooewEgqYSSEzad9aUenq92e3RrU6IBYJswYDPj1yCO6uuGjNUR VKBfd5uYAP9jylMy/FNhT98lh/c6TjkC+gtHOheiBWaJB9WmBA+2ES782dFxiqtixNef43KFoa5fI 0hM36ZKFI06nQtSVG2ymXcS4pDLBskuxJNiUVs8H93sLLx75WBXLfgz2swt3NbUgvvbodLENuZO4t lXIofnQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQm8G-001hhZ-0N; Tue, 01 Aug 2023 09:57:36 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQm8E-001hgG-2p for linux-arm-kernel@bombadil.infradead.org; Tue, 01 Aug 2023 09:57:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:References:Cc:To:Subject:Reply-To:From:MIME-Version:Date: Message-ID:Sender:Content-ID:Content-Description; bh=spF4IU+DOCl88bX1rso/uViMAiAyL5X5n+sxPi2GuFg=; b=OCjMTQZGP1CqzX4lt56TRS9wHj w2vYAaPAGtnuvbAimAoFr6sVCDBdfRGpgImImjQQpYwalWVSoJJjNgoX8SAwNND/iLQZHLW6AC0xu TyVDhIRUWqJxRv2eRPyfpqRoNlrcgwtiqoGHD0y7s9VWyJ68mmnE/KN+wkjUTJS8159hvfwcJa/qM vXU7uGanY/6HcApDbmBCdMd2McgyuZVbEp1Vf7dv8gRU+8oY4pQ+iPIc0I5momCdyo17EjClks3O3 y/4tgdIrL664k1bFhkof2jVdssUVtC5wbFQc8i9nA41du0a+DXEJMyYxWWycFyYwD91yf4xlIDHNN WLh1Z1tw==; Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQlu6-00E6oe-2r for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 09:43:00 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe110de3b6so25547275e9.1 for ; Tue, 01 Aug 2023 02:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690882966; x=1691487766; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=spF4IU+DOCl88bX1rso/uViMAiAyL5X5n+sxPi2GuFg=; b=TkX9otIECX+hw5hx1UB7tmWPS4t5tB805GlBzJfIqyJ/LIU22c+5ATQtjStUO5jZf1 J30TLHhMn0K18ttRbJd/MhiaQSnKKiv3eYHv4eJqDhUTa6yGA5t5PCrW6ElchexL1BZO 8IRkZJhclDYTeA+9aJ1aC09xnAuRAbC3aREIUEUoSipnjZRwX5oFKH2uNr3pfrKhRvtj BclQ7Ia1O4uB2AR/rgqn1H7pJCCBW8BDTE27CmKsu99qza5c+Arxt3MAyBSu7H8Rgu0P 8oC5RlhpQzk0RiOiKlKw2iZrltoCgoEQ3Py6W1aaCkhexq4y2DljX3bXEcvso0G+/0tA 7t1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690882966; x=1691487766; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=spF4IU+DOCl88bX1rso/uViMAiAyL5X5n+sxPi2GuFg=; b=asKIfhJmLPf/pXd99s6d6oHooim3Bz2XM9JXurXimTg47x6KJLjKWZ6KonGcG5bluI n20x4hrrEzP/VXNrV08JkZc08RCoMEkZRoMSuwO+gPgIHJKX7vYTuOhfNftzA7tWBevo d65jr9jTyexaB7HE4zhgFRtonfCgcphMsx+11u5UUPNZv5v9nGqL7mHi7CKvIJjK3vGc VJdPetvbrEaHKZ60SGJImThCU8gOaoz0jmfJpz1jejqIbS9G+udap0bZ5HiuD4M6Ufqr /DB/W/lM8GXyBYYLkWoKySpZKzJh2MJkQwTyNCSg8uS57a8AZWMoVNjb/zGSRNw0ACN3 ax3Q== X-Gm-Message-State: ABy/qLZlHqL3/zw0EvN6otTNMDOe0/5ySINRCLyIlmR5r1TejD1zxP28 T6CWM1mnOmJOQw+00Yc+zIsRpQ== X-Google-Smtp-Source: APBJJlGnV/bR40erYnmyMF31OZCXGjDstUGU65XA0rEf6F8ew0/xJcZhNxfe8e789SbPjqVfzSdibg== X-Received: by 2002:a05:600c:4792:b0:3fe:21f1:aba8 with SMTP id k18-20020a05600c479200b003fe21f1aba8mr1916010wmo.12.1690882965908; Tue, 01 Aug 2023 02:42:45 -0700 (PDT) Received: from ?IPV6:2a01:e0a:982:cbb0:b92a:81a9:df6e:1e3? ([2a01:e0a:982:cbb0:b92a:81a9:df6e:1e3]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c234300b003fc16ee2864sm13713955wmq.48.2023.08.01.02.42.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 02:42:45 -0700 (PDT) Message-ID: <8753afee-e160-8252-9ab2-4b1dad82d432@linaro.org> Date: Tue, 1 Aug 2023 11:42:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 From: neil.armstrong@linaro.org Subject: Re: [PATCH 6/9] drm/bridge: synopsys: dw-mipi-dsi: Set minimum lane byte clock cycles for HSA and HBP Content-Language: en-US To: Liu Ying , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: andrzej.hajda@intel.com, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com References: <20230717061831.1826878-1-victor.liu@nxp.com> <20230717061831.1826878-7-victor.liu@nxp.com> Organization: Linaro Developer Services In-Reply-To: <20230717061831.1826878-7-victor.liu@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_104258_962518_4FAFDC4F X-CRM114-Status: GOOD ( 24.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: neil.armstrong@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 17/07/2023 08:18, Liu Ying wrote: > According to Synopsys support channel, each region of HSA, HBP and HFP must > have minimum number of 10 bytes where constant 4 bytes are for HSS or HSE > and 6 bytes are for blanking packet(header + CRC). Hence, the below table > comes in. > > +------------+----------+-------+ > | data lanes | min lbcc | bytes | > +------------+----------+-------+ > | 1 | 10 | 1*10 | > +------------+----------+-------+ > | 2 | 5 | 2*5 | > +------------+----------+-------+ > | 3 | 4 | 3*4 | > +------------+----------+-------+ > | 4 | 3 | 4*3 | > +------------+----------+-------+ > > Implement the minimum lbcc numbers to make sure that the values programmed > into DSI_VID_HSA_TIME and DSI_VID_HBP_TIME registers meet the minimum > number requirement. For DSI_VID_HLINE_TIME register, it seems that the > value programmed should be based on mode->htotal as-is, instead of sum up > HSA, HBP, HFP and HDISPLAY. > > This helps the case where Raydium RM67191 DSI panel is connected, since > it's video timing for hsync length is only 2 pixels and without this patch > the programmed value for DSI_VID_HSA_TIME is only 2 with 4 data lanes. > > Signed-off-by: Liu Ying > --- > drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > index 332388fd86da..536306ccea5a 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c > @@ -757,12 +757,19 @@ static void dw_mipi_dsi_command_mode_config(struct dw_mipi_dsi *dsi) > dsi_write(dsi, DSI_MODE_CFG, ENABLE_CMD_MODE); > } > > +static const u32 minimum_lbccs[] = {10, 5, 4, 3}; > + > +static inline u32 dw_mipi_dsi_get_minimum_lbcc(struct dw_mipi_dsi *dsi) > +{ > + return minimum_lbccs[dsi->lanes - 1]; > +} > + > /* Get lane byte clock cycles. */ > static u32 dw_mipi_dsi_get_hcomponent_lbcc(struct dw_mipi_dsi *dsi, > const struct drm_display_mode *mode, > u32 hcomponent) > { > - u32 frac, lbcc; > + u32 frac, lbcc, minimum_lbcc; > int bpp; > > bpp = mipi_dsi_pixel_format_to_bpp(dsi->format); > @@ -778,6 +785,11 @@ static u32 dw_mipi_dsi_get_hcomponent_lbcc(struct dw_mipi_dsi *dsi, > if (frac) > lbcc++; > > + minimum_lbcc = dw_mipi_dsi_get_minimum_lbcc(dsi); > + > + if (lbcc < minimum_lbcc) > + lbcc = minimum_lbcc; > + > return lbcc; > } > Reviewed-by: Neil Armstrong _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel