Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1325090rwd; Sat, 20 May 2023 18:25:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZvKdE4hrOpy0HQ48kXxVb4GZo+A6ASk81DeJdkF118HJeKXBu2iH+EAJ9u7oExD0vhiMw X-Received: by 2002:a05:6a00:cc9:b0:64d:22db:1018 with SMTP id b9-20020a056a000cc900b0064d22db1018mr8811733pfv.25.1684632356761; Sat, 20 May 2023 18:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684632356; cv=none; d=google.com; s=arc-20160816; b=RLQlpQKjxonUEv3KsZBd1Ai61MSFEDKXT0YfF+9wDek34QNLrTfEy0d8XT8lg3Xbkf 1fBt068WTHtHsq1OoqYc7YYFKqT95QJQ77/sNreNUcwXgHK5b+X1kWDIyRnB0DCJMbp8 Y1bdZxHaQad+QPMzkwlH4J5QVoxFYKYm6FGNGViX2w86nSZo8qcjanuEsGrha39bwIw6 PQfYKEI9BBgYOL2hQA8Uz0HJNRMaprVOyXVLlEfbI4PxNVVdr+2QFIdcomw6A2na5Uim 93OK76qmv7O9P0pwBwmMMxtDqVHrmmCwUN3dtCPv2T9vtIJ3T179D5j3CrVKI5GvRA5j pVJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=G3uuYxIoPYNrOC1RBCXLMlGdrVKTR3wnYntMo8NNIZM=; b=JyjS0iYRMifmba2J7zd5xkcGQ8IRwcar6hfWSpsrHX9WSkDbb2VMvY1z2y73v2un+b uEv+YTCd0SrL6V20oBrgpRv08s8J+mK0dUzsBKbe8MtP5x9GG6Lvi2HUMK/n7v0YCCn6 z8SUD55DcmWBafUCz2oPRPbJu/SC+HmkOOBzkmcFsa7tTYq3ETjuW5TjcqOKgUcGgkRr fxG374Lo1uVU+jpx55vsDovP+NA3FCI/mQqfMP/zPqciqaA6MKdVvZrEKQ+pP0wHAfNt ccZuAWR1imZOWrBq50lQU5gry7/2uXJ5zWgvW4+jchiQNcoe+jhtJYP2cqmQXO43+YQL REWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BfTFlPe2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e27-20020aa7981b000000b0064d5b6864d0si821951pfl.76.2023.05.20.18.25.44; Sat, 20 May 2023 18:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BfTFlPe2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbjEUAdF (ORCPT + 99 others); Sat, 20 May 2023 20:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbjEUAdB (ORCPT ); Sat, 20 May 2023 20:33:01 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6712D11F for ; Sat, 20 May 2023 17:32:59 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so5450765e87.3 for ; Sat, 20 May 2023 17:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684629177; x=1687221177; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=G3uuYxIoPYNrOC1RBCXLMlGdrVKTR3wnYntMo8NNIZM=; b=BfTFlPe2xV3aji16iKRh7WC2D3dbWE6lhlw79qTmX0vyZM5eIE2iBVTK+rTwNl2XGf CW7sZt5KaaA2J4poM+vCyG4xeWVE2YXbllr7r44JmUDvIsCbvMUjRcY+tKasUHknue10 T6H01w0D+5KluHD8vMYwHMpPK+aHILHQP7wmwBEIbD7JFt7VmdjAV67DS5jy5MKO8QKj f77sl6HDhi5/RU9LqJ43ndSX/018q1VSaHcpkDRroWK0sohQlwFuch1Q6RVLwdGa51Zn AJL09GmmVMkI3Tty0YVwpG1ezaiKL+C87FrOo8TkBSr41TOxjD3edkGwmImwv7h6l7AG s3cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684629177; x=1687221177; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G3uuYxIoPYNrOC1RBCXLMlGdrVKTR3wnYntMo8NNIZM=; b=YYWGIbtD3m4JDxzUUZkCnKPS1lWS3VAxOm5qTAY0O1NP5mDFNioDhnGQYZFWNWfa4P yBwyRL+VKoLFyry6zFI6LmYDU0rZMOPbWhwVYXJtWtZ+gJCSS7wvD6y33ClTOCbiefl8 7dkdabLsv3p+lPeZmyOSyOqsqYiKNVtaxSbEQAhyMF+G4Qbqa353NMuclfiZzoPwmQHs KAy/UGkWe2eWEfdDl2JApOuS/tSLlqsqOqA0uMxZuvJdnIh13p7sMzJKsh9GLIJruOOx DTaepP6oB0GTXaeUIAOc/fC7VVaCa8ZOD0hxJ7kFR8+d0urfsySqajVSz6deBiS/MJj5 X/Yg== X-Gm-Message-State: AC+VfDylHerfRdhKT5tVfLyAQEEepKOIi3yM42c3AlV7+YvEP0uHj/sh /ugY7j9Kdn+QHKMqBNGmVMtn/Q== X-Received: by 2002:ac2:5d24:0:b0:4eb:104b:bf61 with SMTP id i4-20020ac25d24000000b004eb104bbf61mr2035554lfb.58.1684629177669; Sat, 20 May 2023 17:32:57 -0700 (PDT) Received: from ?IPV6:2001:14ba:a0db:1f00::8a5? (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id j1-20020a19f501000000b004e83fbba141sm423743lfb.164.2023.05.20.17.32.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 May 2023 17:32:56 -0700 (PDT) Message-ID: <1e77e954-570f-e995-ce79-99560fde8d34@linaro.org> Date: Sun, 21 May 2023 03:32:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3 5/5] drm/msm/dsi: Remove incorrect references to slice_count Content-Language: en-GB To: Jessica Zhang , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Marijn Suijten Cc: Konrad Dybcio , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20230405-add-dsc-support-v3-0-6e1d35a206b3@quicinc.com> <20230405-add-dsc-support-v3-5-6e1d35a206b3@quicinc.com> From: Dmitry Baryshkov In-Reply-To: <20230405-add-dsc-support-v3-5-6e1d35a206b3@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/05/2023 00:17, Jessica Zhang wrote: > Currently, slice_count is being used to calculate word count and > pkt_per_line. In downstream, these values are calculated using slice per > packet, which is not the same as slice_count. I'd say the reference to downstream is not correct. We have seen cases where the vendor kernel contained errors. So it should be something like "Instead these values should be calculated using ...." > > Slice count represents the number of soft slices per interface, and its > value will not always match that of slice per packet. For example, it is > possible to have cases where there are multiple soft slices per interface > but the panel specifies only one slice per packet. > > Thus, use the default value of one slice per packet and remove slice_count > from the aforementioned calculations. > > Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") > Fixes: bc6b6ff8135c ("drm/msm/dsi: Use DSC slice(s) packet size to compute word count") > Signed-off-by: Jessica Zhang > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 24 ++++++++++++++---------- > 1 file changed, 14 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index d04f8bbd707d..8c8858ee59ec 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -866,18 +866,15 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod > */ > slice_per_intf = msm_dsc_get_slices_per_intf(dsc, hdisplay); > > - /* > - * If slice_count is greater than slice_per_intf > - * then default to 1. This can happen during partial > - * update. > - */ > - if (dsc->slice_count > slice_per_intf) > - dsc->slice_count = 1; > - > total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; > > eol_byte_num = total_bytes_per_intf % 3; > - pkt_per_line = slice_per_intf / dsc->slice_count; > + > + /* > + * Default to 1 slice_per_pkt, so pkt_per_line will be equal to > + * slice per intf. > + */ > + pkt_per_line = slice_per_intf; > > if (is_cmd_mode) /* packet data type */ > reg = DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE(MIPI_DSI_DCS_LONG_WRITE); > @@ -1001,7 +998,14 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) > if (!msm_host->dsc) > wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1; > else > - wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count + 1; > + /* > + * When DSC is enabled, WC = slice_chunk_size * slice_per_packet + 1. > + * Currently, the driver only supports default value of slice_per_packet = 1 > + * > + * TODO: Expand mipi_dsi_device struct to hold slice_per_packet info > + * and adjust DSC math to account for slice_per_packet. > + */ > + wc = msm_host->dsc->slice_chunk_size + 1; > > dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL, > DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) | > -- With best wishes Dmitry