From patchwork Wed Dec 21 23:19:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 35566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp33275wrn; Wed, 21 Dec 2022 15:21:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXuAopgtDIEX6SwIH+DDPAuj0A24dq+bpLuWh1t2aVx7OWPpCcKX8HKVG8GiK4H9WUOiqJBQ X-Received: by 2002:a05:6a00:26ee:b0:578:777e:7f18 with SMTP id p46-20020a056a0026ee00b00578777e7f18mr3495016pfw.3.1671664916132; Wed, 21 Dec 2022 15:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671664916; cv=none; d=google.com; s=arc-20160816; b=jTC70ddiXD30dJUQSCohT06D6/YkhNQI3kkhOCcqHPVySEWaHXG9ksbnX/AyO1if7D s6E8XF2RPbBM+hdJUWEv2wP8F1UWC/z6ppAG3OYyaj5usHKP7/aZDnDEDb1SzNuewv/o xj+p3dgtT/bPnLCw3zz3Iw7ByG+ygbI4BFvtQh2rIdFQ8uK4DFri8NpZvsRJC0nqdT0G xDYJsu4TM5d8zuGv0MEeKMcvGQ1k6a03pBYyPR0PUr2VYRfPjgdsBV5QxaA3XDufLzSI U5+yjJJ6SRe1WLBs+xtGtOd21175E0MUbMvZrAjUt7FT7m78VKlKwVUDGIUGn3gBQNii iVLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zWLQjVmrQnlSCQJrC4LeDdpaML58zhwKdNnJAzrmnEw=; b=uAkQdUqNT659jbH84fcZk1FKvOeton3dvusESR+7UmK6PU2vDgvzt8ETyw4jCdNIw1 XKKr456NHP1yVuU1u1fwKEl7puTsQvExL9cfT5YR6pt4YHdygv5I3zMN4TqU0omrdvrr K00soG4CjUVVo6ikiEZ3bmNNX6/ko9UQ2GbaNDfRrbpmWRy7M6Ykw0TG444RDL25M4U3 UeebSHxJaBAVe92QesqOy5WFhz6pwpQU59T1mWgXTs9RGnmY5MSRjGmPAuimIVq9Bl4H pR8q7P5juVQ6lL6q75N/mYXe+c/U2FCPidE1uB1O3yWz6s0/M2FVjiSIpbv12TBVR3aC ss1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056a00228800b00578ef1de40csi18022366pfe.361.2022.12.21.15.21.43; Wed, 21 Dec 2022 15:21:56 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235022AbiLUXUM (ORCPT + 99 others); Wed, 21 Dec 2022 18:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbiLUXUD (ORCPT ); Wed, 21 Dec 2022 18:20:03 -0500 Received: from relay03.th.seeweb.it (relay03.th.seeweb.it [IPv6:2001:4b7a:2000:18::164]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E9624BE7 for ; Wed, 21 Dec 2022 15:20:01 -0800 (PST) Received: from localhost.localdomain (94-209-172-39.cable.dynamic.v4.ziggo.nl [94.209.172.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r1.th.seeweb.it (Postfix) with ESMTPSA id 5EB46202F1; Thu, 22 Dec 2022 00:19:59 +0100 (CET) From: Marijn Suijten To: phone-devel@vger.kernel.org, Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Vinod Koul Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Sean Paul , David Airlie , Daniel Vetter , Stephen Boyd , Bjorn Andersson , Jessica Zhang , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Kuogee Hsieh , Jani Nikula , sunliming , Sam Ravnborg , Haowen Bai , Konrad Dybcio , Loic Poulain , Vinod Polimera , Douglas Anderson , Vladimir Lypak , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf Date: Thu, 22 Dec 2022 00:19:38 +0100 Message-Id: <20221221231943.1961117-4-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221231943.1961117-1-marijn.suijten@somainline.org> References: <20221221231943.1961117-1-marijn.suijten@somainline.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752867711092695648?= X-GMAIL-MSGID: =?utf-8?q?1752867711092695648?= According to downstream /and the comment copied from it/ this comparison should be the other way around. In other words, when the panel driver requests to use more slices per packet than what could be sent over this interface, it is bumped down to only use a single slice per packet (and strangely not the number of slices that could fit on the interface). Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 0686c35a6fd4..3409a4275d4a 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -855,11 +855,12 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod */ slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width); - /* If slice_per_pkt is greater than slice_per_intf + /* + * If slice_count is greater than slice_per_intf * then default to 1. This can happen during partial * update. */ - if (slice_per_intf > dsc->slice_count) + if (dsc->slice_count > slice_per_intf) dsc->slice_count = 1; total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;