Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp152107rwb; Tue, 13 Dec 2022 15:28:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf76AL11/d3+lWDjJpwN/4t1DswzMsKc5VciKYJBPR8i0NqzkZC/Hd4cPGTOP1KiY25JOPOF X-Received: by 2002:a17:906:a884:b0:7c1:86fa:880f with SMTP id ha4-20020a170906a88400b007c186fa880fmr5624480ejb.57.1670974091836; Tue, 13 Dec 2022 15:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670974091; cv=none; d=google.com; s=arc-20160816; b=Ua/bEfp6A51b3ugc/AI9AGrA5P0FHtVTBsn+HEVdgEPcNGuwp202g6opAXmZes+v6Q /We6a/TX7bTr+Ac+5SUNIZRhSQwlGz+5dpKADy6yIBjolX1PKr3Snh4Aw9ghN+KaDIax Zqx5quzwBKXraXbWOFqMVS4c7RKeXZzOk/5807+Q/gy/PnDD48NpNx47lJHsIiG2KX7r VYeDLAiUb241HDqkALSl52oF9oNveUYfQ2UAF6pIe91RLjjqWUT7GRzcLHHjCvqyQVTd NNi8W+9yMzT9m1fmd9HySvw+7eb0AqdXlaFv1lI6KqDWi8YqioUMJaQq4d5/SGsKqeCN JYYg== 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=Mamqk+9t1lvRwNABA4COiz8Zwye9xZWbq4y+NqblxCo=; b=rc+d8EiPlcNGDdPfIMs7b3M8VQoh+apcdARjKPH5eQLaGmdwi7qCPa6LB/8efAVc2L Acdwsvk9pNRYLSyYb9GqrLaTfN7a6vWT1GDa3pe8wc+kjPXe0AaDAj3qBREeXjoGPnUn tTginYh1a8AMqiMfMPs8KXj5aVy4vc9KLiE/JM0GiPGzJM5tbnX6/k4Fs7IVnYPd+QhB P5jaY4vv8zn3CTDl+kfVp2/bck941PXtKTUhJ4dvhUwe0BinM7JTv7BbzVvRvO8DL/j6 sYqOzg3VP+h4ulXNX1VffLQX+RdsriWMgW1TnTle45B5sM7BEkQxWSEryNfQhgVlkBiA ceZA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020a170906489700b00772fe97b31esi6800733ejq.901.2022.12.13.15.27.54; Tue, 13 Dec 2022 15:28:11 -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 S237041AbiLMXWx (ORCPT + 73 others); Tue, 13 Dec 2022 18:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237009AbiLMXWi (ORCPT ); Tue, 13 Dec 2022 18:22:38 -0500 Received: from relay04.th.seeweb.it (relay04.th.seeweb.it [IPv6:2001:4b7a:2000:18::165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74925B01 for ; Tue, 13 Dec 2022 15:22:37 -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 1E4D5202E2; Wed, 14 Dec 2022 00:22:35 +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?q?Ville=20Syrj=C3=A4l=C3=A4?= , 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: [RFC PATCH 4/6] drm/msm/dsi: Use DSC slice(s) packet size to compute word count Date: Wed, 14 Dec 2022 00:22:05 +0100 Message-Id: <20221213232207.113607-5-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221213232207.113607-1-marijn.suijten@somainline.org> References: <20221213232207.113607-1-marijn.suijten@somainline.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 According to downstream the value to use for WORD_COUNT is bytes_per_pkt, which denotes the number of bytes in a packet based on how many slices have been configured by the panel driver times the width of a slice times the number of bytes per pixel. The DSC panels seen thus far use one byte per pixel, only one slice per packet, and a slice width of half the panel width leading to the desired bytes_per_pkt+1 value to be equal to hdisplay/2+1. This however isn't the case anymore for panels that configure two slices per packet, where the value should now be hdisplay+1. Note that the aforementioned panel (on a Sony Xperia XZ3, sdm845) with slice_count=1 has also been tested to successfully accept slice_count=2, which would have shown corrupted output previously. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index b83cf70b1adb..0686c35a6fd4 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -989,7 +989,7 @@ 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 = mode->hdisplay / 2 + 1; + wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count + 1; dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL, DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) | -- 2.38.1