Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp971026rwb; Sat, 1 Oct 2022 12:09:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Ce4v1FyptbgeDsIMpy+SP/u5iNOcCltlM0SueXIP2/JuMixYzMVjPr9kKUbpiCp/3w59+ X-Received: by 2002:a17:902:b194:b0:176:d229:83bd with SMTP id s20-20020a170902b19400b00176d22983bdmr14501829plr.174.1664651384524; Sat, 01 Oct 2022 12:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664651384; cv=none; d=google.com; s=arc-20160816; b=fTj7e2N9cnZN1TrAEZO8Wpty4gsB+MCiR5TKM8xOKPHTKHDgljmit7RLLCtPfHWtGU 5xEjU3y0D9Pcc5jfXUudLQw9u3tkWWBzhcs07aVPD+6skFDJCazXHgVxdLfhbONTwpxY j7tVOYjb6YSDnOzdyqoSRZxhYHfdtZjm0f+ok0JqW8pZWFWR3/TNy+MH28FUuieDXaXN SnRqUNdCM/EfiSs1buTH22Kj5noGGn5xV9sFgGhhincDgKmkcCVYbN+YmDzdvECvKkzt sg01a6QSUbzEg7BTMBik8P5Z38LMCd4qzOLycVZKKNtzozDiIM3onYWmr4hrRGc9BeT3 KLoA== 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=fK6aSWv4oLI1ekwOa5bgMqfXBF+LHRHTwtjJCP5mWc4=; b=Pj2zTqL4BkXKF5AHMMR5lbI+m3TGdQaw5oyfgOMd+GMZrJl6EPbte7QBeAk1SAFm6G qhgzY754cg5VgcDMyN2LxSXXgGRRn9rdeRFkvk6CMoUigUVFFNEE22xnvlKSmk6xJevX hgBpnDShJng9IKDWQT67izuUTH7S75HkDKZHSX9MRwvYipYyzP8rJ6fNout2GevWDL35 K8dIpolax3fuiKd1lDDIlkZgNMclW9hzq4CNHPEB9oQSQNB4/nyAKuXCHLwAmkXWNz5+ qr6klRTWYfOOeksmZjIhVo8htnM/dxSr/X31hWSi+7Qp0kOaCHQMhM6lnuXBhnfTMgfC HWTQ== 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 jf21-20020a170903269500b0017840d9d579si5729057plb.67.2022.10.01.12.09.33; Sat, 01 Oct 2022 12:09:44 -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 S229589AbiJATIV (ORCPT + 99 others); Sat, 1 Oct 2022 15:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbiJATIU (ORCPT ); Sat, 1 Oct 2022 15:08:20 -0400 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [IPv6:2001:4b7a:2000:18::162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F288918B08; Sat, 1 Oct 2022 12:08:19 -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 CB1A020363; Sat, 1 Oct 2022 21:08:17 +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 , David Airlie , 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 0/5] drm: Fix math issues in MSM DSC implementation Date: Sat, 1 Oct 2022 21:08:02 +0200 Message-Id: <20221001190807.358691-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.37.3 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 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 an approach for dealing with dsi_host setting negative values in range_bpg_offset, resulting in overflow inside drm_dsc_pps_payload_pack(). Note that updating the static bpg_offset array to limit the size of these negative values to 6 bits changes what would be written to the DPU hardware at register(s) DSC_RANGE_BPG_OFFSET, hence the choice has been made to cover up for this while packing the value into a smaller field instead. Altogether this series is responsible for solving _all_ Display Stream Compression issues and artifacts on the Sony Tama (sdm845) Akatsuki smartphone (2880x1440p). Marijn Suijten (5): drm/msm/dsi: Remove useless math in DSC calculation drm/msm/dsi: Remove repeated calculation of slice_per_intf 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/dsc: Prevent negative BPG offsets from shadowing adjacent bitfields drivers/gpu/drm/display/drm_dsc_helper.c | 6 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 11 +----- drivers/gpu/drm/msm/dsi/dsi_host.c | 45 ++++++++++++++-------- 3 files changed, 33 insertions(+), 29 deletions(-) -- 2.37.3