From patchwork Mon Aug 28 15:59:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 13736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3461997vqm; Mon, 28 Aug 2023 10:02:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4TrsztoxdQyS8kvjEiPlsIZMMRveSnm/LJ111fc/fCI9LmGcPD9+dooQ4ihM1/7+9IVqU X-Received: by 2002:ac2:46f7:0:b0:500:9b7d:ee22 with SMTP id q23-20020ac246f7000000b005009b7dee22mr9704944lfo.60.1693242127799; Mon, 28 Aug 2023 10:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693242127; cv=none; d=google.com; s=arc-20160816; b=NnL5KcnaUjDnUbMdo4LbhIOYrziQLZJdZaH0Y0kFnVAkDYiG6jL0q6fI3eYYbMkjUe ZjguThLthSBhTQlxFDV4cBNekz5J9ksQK9/wKcz575Oiy+JO+rrqEp+LdSvvFf84WgtQ 5Xa10aD/Ztj3AmFXbmPvAt5+/Yv0lDRFUTFQy2HdRPWZSxhHMr+sSmpvpTiXGLXfhOjw JueBIpmaViRchDtwQSMima3IqE0uaQGDA6H8WeU2GZX3US8qRyayx0h8JYXfmmbFrSKk jSulA5Q1yG6nlSTOccZmzYh/JmPRwd6VFbN1HlSe1kVMMKMNjCiOtUF6B2RZSRqJFkDt myHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=Ag2lq2sqHgjw4MRqQrRHOYiRzurD3AwWNqYuqMe84wI=; fh=S9QYf7af0Dx+bFvFpm4ZC/80dQFmXfHvpxE2lPQy7L8=; b=Ph9b+ZjBEty3iS9Td3zAkgyezj/RTDBFw2lIMuh1FIXAR0E1aI/lGI20u7Agk5Y2pU lxd7YO6QNAMontDnVcWrjcsJ47tI9hCE+jBDOMak1IrKyEaJ37C7nZT/TisiHS7II73X sqw/86EV78WVcLgYGV/5LKChDFGkQ4m1vREsFlnLbm0U77HnNMDpOA+mhuU8PekKyqrB ubhpeI+KyCQ7JJv1i2c8Z6+KatD0aSpMtorG/j/v1jpWXQb7XQ+yWfNxWO9iOORCJdCy UA96+Ivd4Ha4XbAXFlAxNzqfzu9jOQ/qckahDLxJhJC/RugZpo/0JmKIi4Fu8+azMhs4 VOBA== 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 n26-20020aa7c69a000000b0052a187f8754si4759144edq.683.2023.08.28.10.01.01; Mon, 28 Aug 2023 10:02:07 -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 S232621AbjH1P75 (ORCPT + 99 others); Mon, 28 Aug 2023 11:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbjH1P7V (ORCPT ); Mon, 28 Aug 2023 11:59:21 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6F1ACA for ; Mon, 28 Aug 2023 08:59:17 -0700 (PDT) Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qaedy-0005pk-8R; Mon, 28 Aug 2023 17:59:10 +0200 From: Michael Tretter Subject: [PATCH 0/5] drm/bridge: samsung-dsim: fix various modes with ADV7535 bridge Date: Mon, 28 Aug 2023 17:59:05 +0200 Message-Id: <20230818-samsung-dsim-v1-0-b39716db6b7a@pengutronix.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAEnE7GQC/1XNyw6CQAyF4VchXTsCQyHEVzEu5lKhixlIq8SE8 O4O7lz+yflydlASJoVbtYPQxspLLtFeKgizyxMZjqXBNrZrxnY06pK+82SicjJoOxwQ0QfqoRD vlIwXl8N8om249vVrWTnUUdIfPder0JM/v/P74zi+48xx7owAAAA= To: Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Michael Tretter , Marco Felsch X-Mailer: b4 0.12.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::54 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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: INBOX X-GMAIL-THRID: 1775493057177584141 X-GMAIL-MSGID: 1775493057177584141 I tested the i.MX8M Nano EVK with the NXP supplied MIPI-DSI adapter, which uses an ADV7535 MIPI-DSI to HDMI converter. I found that a few modes were working, but in many modes my monitor stayed dark. This series fixes the Samsung DSIM bridge driver to bring up a few more modes: The driver read the rate of the PLL ref clock only during probe. However, if the clock is re-parented to the VIDEO_PLL, changes to the pixel clock have an effect on the PLL ref clock. Therefore, the driver must read and potentially update the PLL ref clock on every modeset. I also found that the rounding mode of the porches and active area has an effect on the working modes. If the driver rounds up instead of rounding down and be calculates them in Hz instead of kHz, more modes start to work. The following table shows the modes that were working in my test without this patch set and the modes that are working now: | Mode | Before | Now | | 1920x1080-60.00 | X | X | | 1920x1080-59.94 | | X | | 1920x1080-50.00 | | X | | 1920x1080-30.00 | | X | | 1920x1080-29.97 | | X | | 1920x1080-25.00 | | X | | 1920x1080-24.00 | | | | 1920x1080-23.98 | | | | 1680x1050-59.88 | | X | | 1280x1024-75.03 | X | X | | 1280x1024-60.02 | X | X | | 1200x960-59.99 | | X | | 1152x864-75.00 | X | X | | 1280x720-60.00 | | | | 1280x720-59.94 | | | | 1280x720-50.00 | | X | | 1024x768-75.03 | | X | | 1024x768-60.00 | | X | | 800x600-75.00 | X | X | | 800x600-60.32 | X | X | | 720x576-50.00 | X | X | | 720x480-60.00 | | | | 720x480-59.94 | X | | | 640x480-75.00 | X | X | | 640x480-60.00 | | X | | 640x480-59.94 | | X | | 720x400-70.08 | | | Interestingly, the 720x480-59.94 mode stopped working. However, I am able to bring up the 720x480 modes by manually hacking the active area (hsa) to 40 and carefully adjusting the clocks, but something still seems to be off. Unfortunately, a few more modes are still not working at all. The NXP downstream kernel has some quirks to handle some of the modes especially wrt. to the porches, but I cannot figure out, what the driver should actually do in these cases. Maybe there is still an error in the calculation of the porches and someone at NXP can chime in. Michael Signed-off-by: Michael Tretter Reviewed-by: Marco Felsch --- Marco Felsch (1): drm/bridge: samsung-dsim: add more mipi-dsi device debug information Michael Tretter (4): drm/bridge: samsung-dsim: reread ref clock before configuring PLL drm/bridge: samsung-dsim: update PLL reference clock drm/bridge: samsung-dsim: adjust porches by rounding up drm/bridge: samsung-dsim: calculate porches in Hz drivers/gpu/drm/bridge/samsung-dsim.c | 42 +++++++++++++++++++++++++---------- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 31 insertions(+), 12 deletions(-) --- base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c change-id: 20230818-samsung-dsim-42346444bce5 Best regards,