From patchwork Wed Dec 21 23:19:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 3203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp32796wrn; Wed, 21 Dec 2022 15:20:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXslLZMOpCRLNZ0Su95ib4R8duJKb9yZCXQecpFuYOd5wWuTRCMCC/hOqA64BADlE6ath9mj X-Received: by 2002:a17:902:ccc1:b0:189:5ff5:eb92 with SMTP id z1-20020a170902ccc100b001895ff5eb92mr4506198ple.39.1671664833994; Wed, 21 Dec 2022 15:20:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671664833; cv=none; d=google.com; s=arc-20160816; b=QyqWkiaDXQVi+ZlubhIHui6Chsd0rdHtvzy8GjuIzbHOSxB/S7vCV/7A2STknL/0+L OmVb5MfjnmLozOyuKhicxY5fD3OOCWC1iN6Tz28ItFbx07miJaXhTos2CtSMSo/6Ewgb cydvKbC1dja5F8cj6+jhvRhqc11L5/+7XocCcADzW0EqmASfQ5QdWdHlaVoDeespsjxE sgdiuGdwXU16cViLalyOOHB/6pE0KZzDjF8enJbrY/WWPbBtipkoPz7V8D0vhAFOtGqc YBqzNfXID+arB8iVgwFwVifUg5Syxc47qjx/i4iXQJj68P9jlynmLxIrn7TjE+G9gI8Q bjxA== 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=j9KK2oaSD4OBKiV7I0l7YxUtrBKsNqXr17wOkafCo0Y=; b=L/kIl8ibI5B19EVUNpgvPl5uqWqErGEZKqlNxIZyuq6OgZKy/hvPjoDZ50Q7iJjFaQ dP0mgLuh/wCYNUFZsoL4nPkhiaShlM1xos5HZDB28pam5oxAnYwyz52UrcERkU9hVPxl 2C+g38lJYaIikavJlFZr56y/QSOc0G4FYroJ+GfSXf+hECG3MUq04tE3qz+pxl/1vYvz kf4Dgq5/MsJygzNAu7f9lOcJCEliUaZhwCijQSb2s3vvoHMBBxcSXn42p0ziEMklZNRx IRXzXjWgXEG2ULVng7dmk3ehlXH1HyOvsecN9bTV2SahieQsEZ7NEyE+ogJf4OZd4EHw zlKQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p10-20020a170902bd0a00b0016dc27fb9fbsi17132290pls.117.2022.12.21.15.20.21; Wed, 21 Dec 2022 15:20:33 -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 S234815AbiLUXT4 (ORCPT + 99 others); Wed, 21 Dec 2022 18:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiLUXTz (ORCPT ); Wed, 21 Dec 2022 18:19:55 -0500 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [IPv6:2001:4b7a:2000:18::163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDF21A06D; Wed, 21 Dec 2022 15:19:54 -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 161BF203BA; Thu, 22 Dec 2022 00:19:52 +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?b?VmlsbGUgU3lyasOkbMOk?= , 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: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50 Date: Thu, 22 Dec 2022 00:19:35 +0100 Message-Id: <20221221231943.1961117-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752867624685495766?= X-GMAIL-MSGID: =?utf-8?q?1752867624685495766?= This preliminary Display Stream Compression support package for (initially tested on) sm8[12]50 is based on comparing DSC behaviour between downstream and mainline. Some new callbacks are added (for binding blocks on active CTLs), logic bugs are corrected, zeroed struct members are now assigned proper values, and RM allocation and hw block retrieval now hand out (or not) DSC blocks without causing null-pointer dereferences. Unfortunately it is not yet enough to get rid of completely corrupted display output on the boards I tested here: - Sony Xperia 1 (sm8150), 1644x3840 or 1096x2560 pixels; - Sony Xperia 5II (sm8250), 1080x2520, at 60 or 120Hz; - (can include more Xperia boards if desired) Both devices use the DUALPIPE_DSCMERGE topology downstream: dual LM, PP and DSC, but only a single INTF/encoder/DSI-link. Hopefully this spawns some community/upstream interest to help rootcause our corruption issues (after we open a drm/msm report on GitLab for more appropriate tracking). The Sony Xperia XZ3 (sdm845) was fully tested and validated with this series to not cause any regressions (and one of the math fixes now allows us to change slice_count in the panel driver, which would corrupt previously). Changes since v1: - Split patch 6 into two separately backportable Fixes: patches; - Additionally remove num_enc from msm_display_topology in favour of num_dsc; - Reorder patches to have all Fixes: at the beginning for easier picking; - Fix existing multiline comment while editing it anyway; - Add missing Signed-off-by to patch 5. v1: https://lore.kernel.org/linux-arm-msm/20221213232207.113607-1-marijn.suijten@somainline.org/T/#u Marijn Suijten (8): drm/msm/dpu: Wire up DSC mask for active CTL configuration drm/msm/dsi: Use DSC slice(s) packet size to compute word count drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf drm/msm/dpu: Disallow unallocated resources to be returned drm/msm/dpu: Reject topologies for which no DSC blocks are available drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc drm/msm/dpu: Implement DSC binding to PP block for CTL V1 drm/msm/dpu: Add DSC configuration for SM8150 and SM8250 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 12 +++++---- .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 + .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 + .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 23 +++++++++++----- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 9 +++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 27 +++++++++++++++++++ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h | 4 +++ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 14 ++++++++-- drivers/gpu/drm/msm/dsi/dsi_host.c | 7 ++--- drivers/gpu/drm/msm/msm_drv.h | 2 -- 10 files changed, 82 insertions(+), 18 deletions(-) --- 2.39.0