Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2257584rwb; Wed, 5 Oct 2022 11:19:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68nvsJUlgDU9tsqnUh4Zs6epLnnDYWI6DYbzsyAATe10OgRKbp6a+EkF6cEtQ1dB0w0lmF X-Received: by 2002:a05:6402:350b:b0:459:72ef:cf6b with SMTP id b11-20020a056402350b00b0045972efcf6bmr1002064edd.19.1664993980512; Wed, 05 Oct 2022 11:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664993980; cv=none; d=google.com; s=arc-20160816; b=L/yhjpGU2Mcd7HrOfZbJQeZRvEvZz16YZhmw/I7zwJjnGgtyz8oxVrBRYtn/MVyUgC EXcK6VTyC6bU3QGJzhAJ8WXm+RLCFW2SwRjG/7L6qLgkIjuxIELNLPHG2Cv0fF0Td2Gd c8/P56Hsw9/4f3Ei66JxprmnphjZa7rR4RKhvUTq0WUR6Mg6Fuqv9ZyCe9itGaUNGvrf XbOPSKMHY61TeaRVF5xW9TaBaLTxe+9oILDElSUK5lLWMVtjwxZdH+PkH4qZI6y4aMqE y/bGwZyXq3pKbQWvxaXZmqRdK75hXx68Ht0QWbpMu/8Opa68JOVwRkmMadUrt+DffT8t Q9Mw== 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 :message-id:date:subject:cc:to:from; bh=gcFB94usHegGMuYYErbM0HnzlPLW0HmZ7nGig45XAiM=; b=XJ1gHA+m0wsUAeVjlMb146u01lcaA9PaOTElXFjFXolPSCaY6MvVY2HJA+u/T/AJXN xPNJwdvMtRWeXWQOEABL9Kwzr7siC/GP8KUoAbhNpD0ryHUHtGGmO9pGU4g34EIbW8zQ ERjJ60o5TZb7sGi/mbuE4H27N5jf8abdyiQPiuG5HdHSb6eLD9BCwgtEkci/2Q8Efn49 DKuT90bajnxqjspzKhcu3Kc1xjNDfnCgoGb5AwgFUrFUxWIIUFOSgEExnSdvK2YWIruB VaEMosbO3qFBiHfQbYkwFahAeaxi24tqWgargM+IvgZHdiA3dqpU2tg3pjIX5jl9p8md YRUQ== 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 gn29-20020a1709070d1d00b0078356aaeb63si8095150ejc.288.2022.10.05.11.19.12; Wed, 05 Oct 2022 11:19:40 -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 S230315AbiJESRQ (ORCPT + 99 others); Wed, 5 Oct 2022 14:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbiJESRN (ORCPT ); Wed, 5 Oct 2022 14:17:13 -0400 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [IPv6:2001:4b7a:2000:18::171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C1344AD49 for ; Wed, 5 Oct 2022 11:17:11 -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 CC8EB3F5B8; Wed, 5 Oct 2022 20:17:08 +0200 (CEST) From: Marijn Suijten To: phone-devel@vger.kernel.org, Rob Clark , Dmitry Baryshkov , Vinod Koul Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Daniel Vetter , Abhinav Kumar , Sean Paul , Thomas Zimmermann , Javier Martinez Canillas , Alex Deucher , Douglas Anderson , Vladimir Lypak , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 0/7] drm/msm: Fix math issues in MSM DSC implementation Date: Wed, 5 Oct 2022 20:16:50 +0200 Message-Id: <20221005181657.784375-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.38.0 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=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 Various removals of complex yet unnecessary math, fixing all uses of drm_dsc_config::bits_per_pixel to deal with the fact that this field includes four fractional bits, and finally making sure that range_bpg_offset contains values 6-bits wide to prevent overflows in drm_dsc_pps_payload_pack(). Altogether this series is responsible for solving _all_ Display Stream Compression issues and artifacts on the Sony Tama (sdm845) Akatsuki smartphone (2880x1440p). Changes since v1: - Propagate r-b's, except (obviously) in patches that were (heavily) modified; - Remove accidental debug code in dsi_cmd_dma_add; - Move Range BPG Offset masking out of DCS PPS packing, back into the DSI driver when it is assigned to drm_dsc_config (this series is now strictly focusing on drm/msm again); - Replace modulo-check resulting in conditional increment with DIV_ROUND_UP; - Remove repeated calculation of slice_chunk_size; - Use u16 instead of int when handling bits_per_pixel; - Use DRM_DEV_ERROR instead of pr_err in DSI code; - Also remove redundant target_bpp_x16 variable. v1: https://lore.kernel.org/linux-arm-msm/20221001190807.358691-1-marijn.suijten@somainline.org/T/#u Marijn Suijten (7): drm/msm/dsi: Remove useless math in DSC calculations drm/msm/dsi: Remove repeated calculation of slice_per_intf drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits drm/msm/dpu1: Account for DSC's bits_per_pixel having 4 fractional bits drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 11 +---- drivers/gpu/drm/msm/dsi/dsi_host.c | 56 ++++++++++------------ 2 files changed, 28 insertions(+), 39 deletions(-) -- 2.38.0