Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1247839rwi; Wed, 26 Oct 2022 12:42:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4q8jubjpGrcYznI9XvS/AWzshFay0AoWEMt2ZYa2eMUV1cBfOHweqwXEJ7FFCm86N67gxu X-Received: by 2002:a63:f755:0:b0:44b:e438:ef2f with SMTP id f21-20020a63f755000000b0044be438ef2fmr39901061pgk.314.1666813324576; Wed, 26 Oct 2022 12:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666813324; cv=none; d=google.com; s=arc-20160816; b=pnCDBQGwwcE59XosANybOQOTBKrMg16o2ZdIkgnbAyZ80R92iJ1OUJvmEDYAig8/yT OfasMdO81CioonF3Tnb926s8W55eQ56Vhf2TknA7VR6U8/4DVDAO5WqrMCxDfOEVKLoM 4+uOzBCw5igL8HcRZ3+foa8QKmDrpSsJl6Yc8mXGcM7d5aZU6zkoOZo+PCqlsx5tCpei 3s937i3pgIP6PRSqIuA4j6+OprR+ty72/JzLRMOoCrHOcZPIH1WRk1KUQ6Jd6Sc+FM9T 93oPLmRhBrY5p3FedkGxxX3DCo2UV3LDCuY5j0txleU6qMjM7h1OyqyphPvz2MyT7UXe /2MA== 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=lS+iKzLe6BQ6/D3ORl7ImurSUlfj4LooS8FHorS4x+g=; b=0d2MbdFc0zqKD/9PzzefBUEbkx0l3uS1+JyIpP539lO31qvwXsjk3wr4MZz2No9kfe nT8RdkhmN9kgBweSCVc6T7I9fWUfuKQLS8d6Bslk08G2P8bq6/b0C20WeiuDEYtchOls AIZoJsMSRevzZ12z9KZQ8wBqH+D+kEVNyRWYGCv5/J7CnhIGnewaC224DChxkBh10iNm ZiWzhbN1dOYetEY72ah3c7VcWzw+ti7ERbgm5zeFid2OOxZwTzEY5jJPNHjv0SHm6PBA lRkGV1ii8QGIy+iS8nmgZ+k4nekWtmM4mgYrLHKbKTlau/Mqk6jI9UkYuMj8ZTGaDvQX cyTQ== 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 r9-20020a639b09000000b00439ae52c996si7785002pgd.71.2022.10.26.12.41.52; Wed, 26 Oct 2022 12:42:04 -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; 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 S234519AbiJZS32 (ORCPT + 99 others); Wed, 26 Oct 2022 14:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234345AbiJZS2u (ORCPT ); Wed, 26 Oct 2022 14:28:50 -0400 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C28A8DD896 for ; Wed, 26 Oct 2022 11:28:49 -0700 (PDT) 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-r2.th.seeweb.it (Postfix) with ESMTPSA id 3CAE13F33A; Wed, 26 Oct 2022 20:28:47 +0200 (CEST) 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 , 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 v4 08/10] drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values Date: Wed, 26 Oct 2022 20:28:22 +0200 Message-Id: <20221026182824.876933-9-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221026182824.876933-1-marijn.suijten@somainline.org> References: <20221026182824.876933-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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 the `/* bpc 8 */` comment below only values for a bits_per_component of 8 are currently hardcoded in place. This is further confirmed by downstream sources [1] containing different constants for other BPC values (and different initial_offset too, with an extra dependency on bits_per_pixel). Prevent future mishaps by explicitly disallowing any other bits_per_component value until the right parameters are put in place and tested. [1]: https://git.codelinaro.org/clo/la/platform/vendor/opensource/display-drivers/-/blob/DISPLAY.LA.2.0.r1-08000-WAIPIO.0/msm/sde_dsc_helper.c#L110-139 Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") Reviewed-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten --- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 8da27c740c1c..4bd8301d2049 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1783,6 +1783,11 @@ static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc return -EINVAL; } + if (dsc->bits_per_component != 8) { + DRM_DEV_ERROR(&msm_host->pdev->dev, "DSI does not support bits_per_component != 8 yet\n"); + return -EOPNOTSUPP; + } + dsc->rc_model_size = 8192; dsc->first_line_bpg_offset = 12; dsc->rc_edge_factor = 6; -- 2.38.1