Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp47294rdb; Fri, 5 Jan 2024 02:10:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6PysE6Qnu6I4qxwAqo0N1KmDV2dd028bfJHy4T+QCFBiqXz2KJIcFyGneZsKIA8KsvhHv X-Received: by 2002:a05:6870:1798:b0:203:f926:5b4c with SMTP id r24-20020a056870179800b00203f9265b4cmr2164292oae.20.1704449435342; Fri, 05 Jan 2024 02:10:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704449435; cv=none; d=google.com; s=arc-20160816; b=S9ny5pHbigx6UgvG0ZKB4TWaQpZZmTF6+ETwvpS53IZQwmMCEsE6n1Ne7tElUygxsW 9rutFgjMAzsH0ppwqDYI1SRd4Kcyyq2pAulN/+ZXyXLztKca6fDDHkHYtaFsrfntnZTW oGSMPKBiqcvOpduAmIfEsMejG72/S+jnZ3MMDjeFLg/6nUTSdFaNM6Z+u1HSo2A1RlhZ jux9nOrj/gKYXfO9Y0/fYFty2AOTZBbxzgv6HwAEYplqlmAb+JruOUNzqIrSX5Untrvr ESYVSK4DdyXnGfnEdqjtORu73I1lKD9v8pq589Ty6zNCQVOf2u4Rgp+RiPiy5gMQiakG RO1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=B2Kpa4LwHRxteTEkl0iXK8SA2qrb5sEeEowWu1YDokw=; fh=ajPzk/K0h7Iz3AsHFRPCUQlAVY/wFgDW+Uh/be71GBU=; b=C87YcJjq02xPwMK5HxOjLe5gZNRNORygSt3Zf6iTk1v8ds6CwXu3aTTzVrdQEZNZL+ fg8ueEyRNvniqrN8D3kk5g20m8kub0JiYzI4XP3meY7RtOB/KRwYXCF3q3JfZrleE6YK 4cPKP+fa8zvLQ6yBo1gr/YWqFhZTk5kIRDDJSz2lFuIHpXh2w8zXtoF9FUi+ar6jbAJI IrC/U+uFDBjoq9E9t+YVcxlcFu7iZIkchWLhKmaYBZoFj30Kh7nAg8PhqMCHwcrZaA8B iruvgSTGaDxRM4mGiHZjIsLVZYruyjxreFf//sAc9cat6ynqN8NhfTu/TryIpKgF4be2 Bdfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rock-chips.com header.s=default header.b=KSM370iF; spf=pass (google.com: domain of linux-kernel+bounces-17714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=rock-chips.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q62-20020a634341000000b005ce841f6b55si1020906pga.435.2024.01.05.02.10.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 02:10:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rock-chips.com header.s=default header.b=KSM370iF; spf=pass (google.com: domain of linux-kernel+bounces-17714-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=rock-chips.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8E8DF284A58 for ; Fri, 5 Jan 2024 10:10:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C73324B42; Fri, 5 Jan 2024 10:10:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=rock-chips.com header.i=@rock-chips.com header.b="KSM370iF" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-m118112.qiye.163.com (mail-m118112.qiye.163.com [115.236.118.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 411FD250E1 for ; Fri, 5 Jan 2024 10:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rock-chips.com DKIM-Signature: a=rsa-sha256; b=KSM370iFKjmw5xxrk6/QzaAkCHdhqtuv0hlvvSEvcmnQsIbTaoBRQ+eK0zJeDVa8sr6Jk7akmw5IQ2GDgQXF5O4mEuzR6f9qezacvcPdc475m6T+7tn0hprSt/f8dGel64uVjr/KEKMRL5/aGuhQF2qAm0dV5iKMMy1XwwJvHIM=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=B2Kpa4LwHRxteTEkl0iXK8SA2qrb5sEeEowWu1YDokw=; h=date:mime-version:subject:message-id:from; Received: from [172.16.12.141] (unknown [58.22.7.114]) by mail-m12779.qiye.163.com (Hmail) with ESMTPA id 3AD6E780511; Fri, 5 Jan 2024 17:13:58 +0800 (CST) Message-ID: <6812a957-dafd-4687-8094-074d8d2b5471@rock-chips.com> Date: Fri, 5 Jan 2024 17:13:57 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/rockchip: vop2: Drop unused if_dclk_rate variable Content-Language: en-US To: Cristian Ciocaltea , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Sandy Huang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20240104143951.85219-1-cristian.ciocaltea@collabora.com> <20240104143951.85219-2-cristian.ciocaltea@collabora.com> <5867171.29KlJPOoH8@diego> From: Andy Yan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGkhLGVZCH0hNQ0ofHU0fSENVEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSk1PSE1DVUpLS1VKQk tLWQY+ X-HM-Tid: 0a8cd8e69206b24fkuuu3ad6e780511 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NE06Ogw5PTwfLj88PksRTiEu MQ4aCw1VSlVKTEtPT09NS0hCSUlMVTMWGhIXVRoVHwJVAhoVOwkUGBBWGBMSCwhVGBQWRVlXWRIL WUFZTkNVSUlVTFVKSk9ZV1kIAVlBTkJOTDcG Hi Cristian: On 1/5/24 03:12, Cristian Ciocaltea wrote: > Hi Heiko, > > On 1/4/24 17:58, Heiko Stübner wrote: >> Hi Christian, Andy, >> >> Am Donnerstag, 4. Januar 2024, 15:39:50 CET schrieb Cristian Ciocaltea: >>> Commit 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588") >>> introduced a variable which ended up being unused. Remove it. >>> >>> rockchip_drm_vop2.c:1688:23: warning: variable ‘if_dclk_rate’ set but not used [-Wunused-but-set-variable] >>> >>> Signed-off-by: Cristian Ciocaltea >> >> in general, please don't send non-series patches as replies to other patches. >> It confuses tooling like b4 way too often, as this patch is not designated >> as a 2/2 (similar to the first one not being 1/2). > > That was unintentional, sorry! I wrongly assumed 'git send-email' is > able to correctly handle multiple patches which are not part of a > series. I'm not sure if the '--no-thread' flag would have helped. > >>> --- >>> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 2 -- >>> 1 file changed, 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> index 44508c2dd614..923985d4161b 100644 >>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c >>> @@ -1685,7 +1685,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >>> unsigned long dclk_core_rate = v_pixclk >> 2; >>> unsigned long dclk_rate = v_pixclk; >>> unsigned long dclk_out_rate; >>> - unsigned long if_dclk_rate; >>> unsigned long if_pixclk_rate; >>> int K = 1; >>> >>> @@ -1700,7 +1699,6 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id, >>> } >>> >>> if_pixclk_rate = (dclk_core_rate << 1) / K; >>> - if_dclk_rate = dclk_core_rate / K; >>> /* >>> * *if_pixclk_div = dclk_rate / if_pixclk_rate; >>> * *if_dclk_div = dclk_rate / if_dclk_rate; >>> */ >> *if_pixclk_div = 2; >> *if_dclk_div = 4; >> >> with the code continuing with those static constants but the comment >> showing a forumula, I do hope Andy can provide a bit of insight into >> what is happening here. >> >> I.e. I'd really like to understand if that really is just a remnant or >> something different is needed. > > The current implementation is not able to handle all display modes > supported by connected displays, e.g. in my testing environment I > encountered issues with 2560x1440-75.00Hz, 2048x1152-60.00Hz, > 1024x768-60.00Hz. Additionally, it doesn't seem to cope well with > non-integer refresh rates like 59.94, 29.97, 23.98, etc. I think this is because the thee PLL from cru can't divide accurate clock for these non-integer refresh rates. > > My temporary workaround relies on using the HDMI PHY PLL in conjunction > with a downstream-based hack to compute the clock rates. I'm not sure > that would be an upstreamable solution, so I would let Andy shed some > light on the topic. Yes, use PLL from HDMI PHY can give more flexible clock rates to support more display mode. We also use it in our bsp kernel, but one thing should keep in mind that use HDMI PHY pll as dclk source can only work for HDMI 2.0 or bellow, if can't be used in hdmi 2.1 mode(such as 4K120), so we need to switch the clock source by hdmi work mode. The difficult thing is how to make this accepted by upstream. > > Thanks, > Cristian > >> >> Heiko >> >> > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip