Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1018495rwr; Wed, 3 May 2023 09:08:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pghUmMRLPDY90Y82S47l1d5O2d/V5nofEmNsIPxNSnFbclPn7OwY6Yu1PBh+lcurhG24N X-Received: by 2002:a05:6a20:a10f:b0:fa:e7cf:f732 with SMTP id q15-20020a056a20a10f00b000fae7cff732mr9047402pzk.2.1683130124714; Wed, 03 May 2023 09:08:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683130124; cv=pass; d=google.com; s=arc-20160816; b=RqPXxpc0stPAwRFCQP7F2l+k9vBdtQk3LQJT4BijHx74Snm2ZJk//6six7A9RfV6G4 dU0kYAj1zaO7gKVEPdgV6qukmmng811e1xbgz4n8p5Z2sXdu7FloZWrASN6BxWPdWMyJ Fkyq5Gp545QmEmuocYiiONfpJ9RvLuzi3p2h4X1GUvLLXMAq0o58OWUN32UKUZfKUGyY MessROJb9ljF7cUhuuNsnsN9DqiDTYvdW6wAvxOBBCvBjJtkpb2ZIbXY3phYf3VqfuwN mGRyd1Epo9FJyiBNbfb0cOx2/th88yMvVtBUfrN5wwy5/W8FoU1Y7rcLPGejcSHnb5NJ 9y/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=AsHsLz2agpWrbdHj+OTHjp/RSDGVBL/elqaaaUHs7tQ=; b=qXNkUlt3qq5wnRDBkk2btURgOVjxkzJNjaFXbzNKQp22e1P/YFLtHgmLaW3ijC68c0 EM4HX/NDIfVLcweOLQANOIQmHea+AfVPz38d2uBs8qikvF0JSnq1wNq7cCazz3jOUrkX 3HGu7tIO/kSe0uc7ftn8jeIADMQXd1j/iUza7UgN9cMfPkU+Ef+qKBt95RLRFJ/yowcp 3FGCxTRxQwTdv8rQavDVVbTCjhcrW3OajGgGuApKTUE6u+5F0+Jvm2O8T1K4SE4DB6Xt O6f/q1qoelbLabEoUlYiHFTu8+tJ309lsUNQ5u4q8pakIa5Vnq2B3W/oLVS79G3uPeUI eTKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=N7gcVgom; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); 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 j65-20020a638b44000000b0050beec93e77si4375778pge.609.2023.05.03.09.08.29; Wed, 03 May 2023 09:08: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; dkim=pass header.i=@mysnt.onmicrosoft.com header.s=selector2-mysnt-onmicrosoft-com header.b=N7gcVgom; arc=pass (i=1 spf=pass spfdomain=kontron.de dkim=pass dkdomain=kontron.de dmarc=pass fromdomain=kontron.de); 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 S230204AbjECPwH (ORCPT + 99 others); Wed, 3 May 2023 11:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjECPwF (ORCPT ); Wed, 3 May 2023 11:52:05 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2107.outbound.protection.outlook.com [40.107.247.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 748844C1F for ; Wed, 3 May 2023 08:52:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivqduU6GAv+pHYylIsoLzN1gwwOaN+eaLJ87S/lSKbxl6wvVxxYgEgZTpxG6WfPQHKrAq9mQiz9w8Udgpw+rqJ4L0LhEn1iJRBuVy6srCpuqbhlnMM0OyHIbCe++bvioftNOOUStsoqPRXSnjDzDYM19BI0sECFb9eYdAQEUM14+qPP9TVjkRxSVW/MGcMNAFtr/SOW0vCRFn2v0N3eGc8jOCEHIKpUBxDDHG+75QM+myMeeZ/kpP+jzuKMK2DD8cQnjju0FtVpayt4DBrl35BSgexHOxOUMvbH4VT8HSRFEbQmXp+8OVKgUnICIFnPN+IgigQNOm6kfEINDo2a7cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AsHsLz2agpWrbdHj+OTHjp/RSDGVBL/elqaaaUHs7tQ=; b=QInLIEdM98P2j4Ffa757zyNfkrPFtfdK8IoapFRU0Qm+eLOKpvC3XLVKU4nKJHtO+eV8Hb6xpRA1f0DKF00m7sx+qeW/+N53oO/ngFOKFbEJ2X3Yjd1SkA0Zzgq0fMSnBuB0Ek1rFoURx9TWPtUguAhEEPT35P0QTgfbGkDkOH2yIHhz4SlJmCVEvEozSM1WOc884UvmWTuDwN595vtUTud6rk+1ykFRzI1/vdP2Vmi2iqb3jHZyYxNDTvYSpi3xy7gAZvtEzktDFpUu0K11Sx3TTheX98F3D7FZhNWtfI9K43pX7L4oeWAEZRuuQORTZa3V4Qke8mDQFfGSWauzZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kontron.de; dmarc=pass action=none header.from=kontron.de; dkim=pass header.d=kontron.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mysnt.onmicrosoft.com; s=selector2-mysnt-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AsHsLz2agpWrbdHj+OTHjp/RSDGVBL/elqaaaUHs7tQ=; b=N7gcVgom5FyDrbr7crQ5V7HqU1rHZRR/R6+oxEKRGEletp1iWHWJdRpWc8Z8MhPde7ivMQCWmkDgFy/GLmsN1sUdy+e3huRCHNkBx9dOI6otIHLFqfE5oIp0c6v60lDPS1W4ALljYkiiwgkoVCKLd7lqoYTg7Tqd/P1JavTNe48= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kontron.de; Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) by AM7PR10MB3542.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:133::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.31; Wed, 3 May 2023 15:52:02 +0000 Received: from PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::e6fd:d174:5710:fb3a]) by PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM ([fe80::e6fd:d174:5710:fb3a%2]) with mapi id 15.20.6340.031; Wed, 3 May 2023 15:52:02 +0000 Message-ID: Date: Wed, 3 May 2023 17:51:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH V3 7/7] drm: bridge: samsung-dsim: Let blanking calcuation work in non-burst mode Content-Language: en-US, de-DE To: Adam Ford , dri-devel@lists.freedesktop.org Cc: marex@denx.de, aford@beaconembedded.com, Chen-Yu Tsai , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , linux-kernel@vger.kernel.org References: <20230502010759.17282-1-aford173@gmail.com> <20230502010759.17282-8-aford173@gmail.com> From: Frieder Schrempf In-Reply-To: <20230502010759.17282-8-aford173@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM0PR04CA0137.eurprd04.prod.outlook.com (2603:10a6:208:55::42) To PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:263::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5681:EE_|AM7PR10MB3542:EE_ X-MS-Office365-Filtering-Correlation-Id: df4ca3c7-585d-4ded-101c-08db4bee55f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +mrNpE7L86tyK9JExy3njjv9KRxqeRIztpyHxuBLjv2oQ2ImyUf9sM/ibdjggxxIHEJ/M06zkRFtjCQPJVF1UnQwIRE7Fl8segIX9l4TC+qmUdE3vkSg7k+6vKMwT55xyjOZntZuhd9Amn8SszUcXNsIZN4ajvSJjFXwJXaswP2MfOuYsS4Pv6FKR0Da3ZZ528TzW3ZmFvwgD6VuKCfw3UHLQ7SoNFRh9me5imL0Bk2BAv9DE3sTwCC/srAFkPktRFdzOLZLrTptnp4QSn3GplTbjvGG9aJ0MX2AWnuKeHOb2cyyfUlplYLVM/ukcAxs5tGx1JElrW2QkzM6WeVCJqfG4kLmjOFQBVUY00/BexAc76YqXB2efd2zNp32OhH04XyEwi+g/PZNRNIT5A83ZZew6jzhO0h/pBRzmVr3GZUNUQpUfFB3/Fx9mpgO5whDWbre1UwIuQwQDH2tmxLeQcvOe48bk3riNCMcQs5ESKWznaI+76AsM8U83cRpwgtiVYV71qcI5J1vcOx5gG6Z1i/NjTiqeO7b5EA0ZIL34p+SX0Xn/DKM7x97nthq48i9ctEPGPt+a3yHl/rirK99NB784RNnrK2PqRDChep9+0iZ2M36J6+7hDJsBKWEMSKOOQ/GywMRBPP62Es2ePNqRg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(366004)(376002)(136003)(451199021)(31686004)(86362001)(66556008)(66476007)(6486002)(66946007)(4326008)(6666004)(54906003)(316002)(478600001)(31696002)(36756003)(5660300002)(83380400001)(53546011)(26005)(6512007)(6506007)(41300700001)(8936002)(44832011)(8676002)(7416002)(2616005)(2906002)(186003)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c0sxeEZJZ1NFL0xVc1B0dDJHcWpwMFdpK2p4UVc0UFM0cWwzMTRrL0JFSDdJ?= =?utf-8?B?ZlhTY0RhMkU0NnI5T1lYdVI5TllCczdTSUM0c3FieXhvT1RaTUxaRlRxUTlW?= =?utf-8?B?dVBxa1VMSDVtRTRLOGhvYzViZUFiamF4UXdqQlovdXkyZkdldDVRcVpFcU1v?= =?utf-8?B?OGt5OTU1dnV5VTl4eXBCeElVNUVUOWUrRUxMeTZvK1VmSnFHanczbjlRMkJp?= =?utf-8?B?ZkpRaVQ1Skw5ZEZRdVo2ejV6bGlWZkc0N2QrMlFkaUVPNStsbDdHZTQzRVdy?= =?utf-8?B?N1doYit4UFJTVFFTWUUwZndFVUN0eVJ3ZG9DeXlFTERGMnhQUTZHOWtsdUhy?= =?utf-8?B?WHh4S3JlZk5VeWVWNHhJV3hRUmM4QURoVXVvRkN5SWJheGNZTVhOM2VVZVhE?= =?utf-8?B?dmxCOHdwVWg1ajQ4d2Q1YXZhVXRhdGtVS0JRMG51WVltQm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ded-101c-08db4bee55f6 X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5681.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2023 15:52:02.0948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8c9d3c97-3fd9-41c8-a2b1-646f3942daf1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LV8vS+HTHoCFOUH1+jVmGlXrqoEKdpKrD3CwB+XPHY9DfFr7YetwxL2i23WpHYlPT2dW0BCiSkSZy/p5uizRulKS0rCfz2OSNNfnzD5EWLU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR10MB3542 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 02.05.23 03:07, Adam Ford wrote: > The blanking calculation currently uses burst_clk_rate for calculating > the settings. Since it's possible to use this in non-burst mode, it's > possible that where won't be burst_clk_rate. Instead, cache the "possible that burst_clk_rate is 0" > clock rate configured from of samsung_dsim_set_pll and use it instead. > > Signed-off-by: Adam Ford Tested-by: Chen-Yu Tsai Maybe this patch should be squashed into patch 6/7 as otherwise burst_clk_rate could be 0 here causing bisection issues? Apart from that: Tested on Kontron BL i.MX8MM with SN65DSI84 and ADV7535 bridges. Tested-by: Frieder Schrempf Reviewed-by: Frieder Schrempf > --- > drivers/gpu/drm/bridge/samsung-dsim.c | 4 +++- > include/drm/bridge/samsung-dsim.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c > index 53099461cdc2..1dc913db2cb3 100644 > --- a/drivers/gpu/drm/bridge/samsung-dsim.c > +++ b/drivers/gpu/drm/bridge/samsung-dsim.c > @@ -652,6 +652,8 @@ static unsigned long samsung_dsim_set_pll(struct samsung_dsim *dsi, > reg = samsung_dsim_read(dsi, DSIM_STATUS_REG); > } while ((reg & DSIM_PLL_STABLE) == 0); > > + dsi->hs_clock = fout; > + > return fout; > } > > @@ -960,7 +962,7 @@ static void samsung_dsim_set_display_mode(struct samsung_dsim *dsi) > u32 reg; > > if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { > - int byte_clk_khz = dsi->burst_clk_rate / 1000 / 8; > + int byte_clk_khz = dsi->hs_clock / 1000 / 8;> int hfp = (m->hsync_start - m->hdisplay) * byte_clk_khz / m->clock; > int hbp = (m->htotal - m->hsync_end) * byte_clk_khz / m->clock; > int hsa = (m->hsync_end - m->hsync_start) * byte_clk_khz / m->clock; > diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h > index 76ea8a1720cc..14176e6e9040 100644 > --- a/include/drm/bridge/samsung-dsim.h > +++ b/include/drm/bridge/samsung-dsim.h > @@ -94,6 +94,7 @@ struct samsung_dsim { > > u32 pll_clk_rate; > u32 burst_clk_rate; > + u32 hs_clock; > u32 esc_clk_rate; > u32 lanes; > u32 mode_flags;