Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3848769rwb; Sun, 9 Oct 2022 12:15:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6S5lVXBxnuBPGckrqiWBBvHF5inWVma705D1h9L7kJIXadSXkw+FM3GFmf/kOcrdnAq07t X-Received: by 2002:a17:903:2285:b0:177:ab99:9e5 with SMTP id b5-20020a170903228500b00177ab9909e5mr15555733plh.121.1665342925969; Sun, 09 Oct 2022 12:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665342925; cv=none; d=google.com; s=arc-20160816; b=E+2udz5R2AJmYeRNEgJBLB1zidEAcWmdF96DBY/2VRxpQQi69VGKUJv1UWlPfKpjzQ nmmbZ9GgJgPFeUpVzEY+rn3KpJDMtxqNgLXbwC7IUnRGz5cb1Fub6A3tJWFupbIE33Ck wp/5imq22ebxb5wb5KJqHS9JKx8WbiRyaL0e11n2ZVWrCyXNDSAQRkrZJDBgMXmjIQpZ LF9r9pWVJdnYuLCPN/0ArPWFSKymeUZkBjKAEwGX2FFtJ3vJePJw1jfIYODGRkRwD1BR 8YOdpN+14NYHA8Qi5l67uVMjGq2M2cVzO3LYAdqj4oD8Ds+7u/yLNrBpz7fHFQt9NLoO tgsQ== 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=7kctASJ/9hRPOjAikhsncax/UH0cOOeZ5B74G4Q0Sd8=; b=seNIjnO6nisutoULdr1PXdqa8EPuXN9O9MI7N8Txe/xdKHNqMtReZ86vDFHe+hrfk4 pQk5IdS/wqY2J2RDjzTTw//6i7hrTOC9ynKhPUjVUPUrVlQyQCOqMe2jdK8sUvdWY7td lMmqU4anEVlrgHankS9KdWKhya+Uf5ZB/6RmIBD4rxnJqkgcDr3o5LOATfUPkVEulHPj i0w+VPWV3FmNjRqIfDf5WcuCfqhErqrIB6SD2SqNTw0CDKSuJ9XzAUPb+Uy8v5d3WJHd x9A0K4j3HEd2UF93Oxr2vK/FAqXWBdiE8Ukgen9dtPXbbUn7zpLgt7CD7sRisa05ij6X 2RBA== 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 94-20020a17090a09e700b0020291c96b13si9942266pjo.121.2022.10.09.12.15.14; Sun, 09 Oct 2022 12:15:25 -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 S230215AbiJISwK (ORCPT + 99 others); Sun, 9 Oct 2022 14:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiJISwI (ORCPT ); Sun, 9 Oct 2022 14:52:08 -0400 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [5.144.164.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4866B2A736 for ; Sun, 9 Oct 2022 11:52:07 -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-r1.th.seeweb.it (Postfix) with ESMTPSA id 050A41F95B; Sun, 9 Oct 2022 20:52:04 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Vinod Koul , 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 v3 07/10] drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values Date: Sun, 9 Oct 2022 20:51:46 +0200 Message-Id: <20221009185150.461323-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221009184824.457416-1-marijn.suijten@somainline.org> References: <20221009184824.457416-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 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 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 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 68c39debc22f..7e6b7e506ae8 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1774,6 +1774,11 @@ static int dsi_populate_dsc_params(struct drm_dsc_config *dsc) { int i; + 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.0