Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp91307lqj; Wed, 10 Apr 2024 05:10:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRmDvZjszppzdKeskmU2Oo1AFSEsoeQN/3A4Vkmhn59aRABFQtZo245mJ/64DH702VtTgKBsrlw7ak+E9Qqzudl3M1FHEDdYn2bkgCsA== X-Google-Smtp-Source: AGHT+IFDzl0sBarEzr8fC3MHPkGd16/RLSmiC+rfa5U/fyc7E1AtmNzrETN9cfVWKXUHjGiyaxDl X-Received: by 2002:a92:cdac:0:b0:36a:3c07:9cdc with SMTP id g12-20020a92cdac000000b0036a3c079cdcmr1423770ild.31.1712751044546; Wed, 10 Apr 2024 05:10:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712751044; cv=pass; d=google.com; s=arc-20160816; b=fQdUTopy1sQbgTqNHZTLlyJSCGq7g1BK7JAPP8J1O50jkIwvbi6V8wp+ZfNqjfBFV4 +f6iyAQ/SYRUpvkitufXuY1XY2A2B+MsK6r799y/EPlneZ2mV6xSI6+UVMQanJcrjwTT mg5EHN8MIEHTjUTdnnvNhpT5HBR1PTO2PA2frZDV9mhrADbTBAJaoaolaEMn+zl/Zch2 ucghyIRha/Vk01j+BWqhy0WZsEzfYZx6xkMqosXGvuUhy4s4Yo/1l0HhYzd02Bt/+qVs DgPpbaLa+bv2SVuQrV0q3nKA50Owl8j8/SIlNJwTZddx/B13nmUlrjiFNI+G053jbd2y QkPg== ARC-Message-Signature: i=2; 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=uTWaQyaAK8NhCoIO96+/pn6A5LF/VnM/wHGGjKcjQ8w=; fh=Yywl51IXpciVWp+OELT46pVvF+eIyZ3B+tc5ndIr1u0=; b=NdBg/1VinB5ZbfA+oIRQinV+Y67JMjejDNvensV3I+1ATOC5HvJceo1ONanHsE8LE3 V9pEL4GhEAuv1hrkdY/COxOoVtlOjoSqEUBAAKlH+fXVIT8cq2yief3CEojD7dj01pxQ 2aBYKIWh5ol9wDGYJQKaXgI/V9M9CRZVZbVbTm6AqPe9IKvp8PxAl62OY3FvXZSzotql a75iQ3ezmsYGDD+CZ4DIR+LYusB14ws8Qwa3tfb5Wq6jso8bzNajSHj/tB8vzznGe4B+ q+/ZykIaIhlNFNdlB6KHd9RqhPqGvWBvzrRyLp9WwdsD3+tSnumyQ8HlvJ3jbjkQ4jx9 fgvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="oSs/2HU8"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-138466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m193-20020a633fca000000b005e438e94b1esi11090706pga.382.2024.04.10.05.10.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:10:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="oSs/2HU8"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-138466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 82B34B2493F for ; Wed, 10 Apr 2024 12:04:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6605A15B116; Wed, 10 Apr 2024 12:04:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="oSs/2HU8" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 A2E2B1598F2; Wed, 10 Apr 2024 12:04:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712750646; cv=none; b=jG0BK+C3rXv925IOWhNH7XM8ET++2RJOuikuL9ax/dVfIXzUtxXxFK1V4CAzxhEklyHPgN5TN0Ud5IeJAAjhQsH3Fn5S9m9qBaseelnUGiVu6yuYD9T21YgwJaBfIlN7uwpo7hrWAEDYVigdQcCktpQXDh3jy3x4fNfRvBI1RXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712750646; c=relaxed/simple; bh=tdppY4tgi+O68xVH71ZZoSDz/OuC4sRNlpnC4mWN5pg=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=o5rWY8T2xXC15LBEfNkyf8tPazKk08O6QnXosyqVaMc5JdePxM57jgVR/+EzdRkcz2VW8Fa7zgTGAvCXGc62hIS9A0ehWo5YLFVUQ2vCoEEdnLl+CnhBIvjCzlcy1ngoqzlQFTlV9mE6s49ofrwAOfZejcaX1EvBybOpPNTU3k4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=oSs/2HU8; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43ABZIp6001155; Wed, 10 Apr 2024 12:03:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=uTWaQyaAK8NhCoIO96+/pn6A5LF/VnM/wHGGjKcjQ8w=; b=oS s/2HU8bU+Rie6SvJigbM3kjYdhNwbUZmiFZ2uJ+88mWVu3ypGNkgFrzghrPWOjOv 59sa8sJg92314XGtFQ5kzZK701V3I0zS54MvMi/5mHUJNCSmK9dr0OU7gSdViTyM T2Oz6+AIzbDXXJmV2BTF6+zMdPoBcAVnRFMh4XEIm/J5szsSNTp6alf32+z7pYBz sO1keyMFuP8Twc6C6g0rmO9xhSfLnjnV+62nDvdN11aSq1GlvmvPPdtfYx5CjKYd Z9uMIK8xyunFvwfi/49L666BpgJCAH3CJcWHdOxm0xFLMXC8AEIi5epx5ddmjVs3 EfbQXrIxc5Ea0G8HL2oQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xdpnfsaex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Apr 2024 12:03:48 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43AC3l7W022559 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Apr 2024 12:03:47 GMT Received: from [10.206.101.41] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 10 Apr 2024 05:03:42 -0700 Message-ID: <335d1eee-a6f1-6502-7f27-c7362a53b4ba@quicinc.com> Date: Wed, 10 Apr 2024 17:33:39 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 03/19] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Content-Language: en-US To: Konrad Dybcio , Dikshita Agarwal , Stanimir Varbanov , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , "Philipp Zabel" CC: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , , , References: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> <20230911-topic-mars-v3-3-79f23b81c261@linaro.org> <80c0ecb3-1157-1d7a-0829-c3b68b65f17f@quicinc.com> <66492657-3649-3bdb-b7df-0f5196418e06@quicinc.com> From: Vikash Garodia In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 92yuKVaf3duzItn5r642t-qWimk1U03P X-Proofpoint-ORIG-GUID: 92yuKVaf3duzItn5r642t-qWimk1U03P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-10_04,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404100087 On 4/9/2024 11:52 PM, Konrad Dybcio wrote: > > > On 4/5/24 14:44, Vikash Garodia wrote: >> Hi Konrad, >> >> On 4/5/2024 1:56 PM, Dikshita Agarwal wrote: >>> >>> >>> On 3/27/2024 11:38 PM, Konrad Dybcio wrote: >>>> To make it easier to understand the various clock requirements within >>>> this driver, add kerneldoc to venus_clk_get() explaining the fluff. >>>> >>>> Reviewed-by: Bryan O'Donoghue >>>> Signed-off-by: Konrad Dybcio >>>> --- >>>>   drivers/media/platform/qcom/venus/pm_helpers.c | 28 >>>> ++++++++++++++++++++++++++ >>>>   1 file changed, 28 insertions(+) >>>> >>>> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c >>>> b/drivers/media/platform/qcom/venus/pm_helpers.c >>>> index ac7c83404c6e..cf91f50a33aa 100644 >>>> --- a/drivers/media/platform/qcom/venus/pm_helpers.c >>>> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c >>>> @@ -23,6 +23,34 @@ >>>>     static bool legacy_binding; >>>>   +/** >>>> + * venus_clks_get() - Get Venus clocks that are not bound to a vcodec >>>> + * @core: A pointer to the venus core resource >>>> + * >>>> + * The Venus block (depending on the generation) can be split into a couple >>>> + * of clock domains: one for main logic and one for each video core (0-2 >>>> instances). >> s/main logic/controller. Applies to below places as well. > > Ok - so "controller" is the cortex-m3 (m5?) that power-sequences > the DSP etc.? Thats correct. The firmware runs on the controller and takes care of many aspects of hardware (dsp or core) programming. >> >>>> + * >>>> + * MSM8916 (and possibly other HFIv1 users) only feature the "main logic" >>>> + * domain, so this function is the only kind if clk_get necessary there. >> To be checked, unable to get the clock document to see why only core clocks >> (VENUS0_VCODEC0_CLK). Will update. > > FWIW 8916 only has GCC_VENUS0_VCODEC0_CLK (and _SRC) and AHB/AXI/TBU clocks, > no (currently registered) clock for the entire block. > >> >>>> + * >>>> + * MSM8996 (and other HFIv3 users) feature two video cores, with core0 being >>>> + * statically defined a decoder and core1 an encoder, with both having >>>> + * their own clock domains. >>>> + * >>>> + * SDM845 features two video cores, each one of which may or may not be >> s/two video cores/two identical video cores >>>> + * subdivided into two encoder/decoder threads. >> decoder cannot be split into core threads. you can keep it like "each of which >> is capable to do any encode or decode" > > So it's not about any splitting, but rather the ability to do both encode > and decode, sort of like how the displayport controller can nowadays do both > eDP and DP, depending on what init data you send to it? It is precisely that way, just that there are cases of cores with dedicated codec support, hence identical implies that each of them can do same processing. >> >>>> + * >>>> + * Other SoCs either feature a single video core (with its own clock domain) >>>> + * or one video core and one CVP (Computer Vision Processor) core. In both >>>> cases >>>> + * we treat it the same way (CVP only happens to live near-by Venus on the >>>> SoC). >>>> + * >>>> + * Due to unfortunate developments in the past, we need to support legacy >>> why unfortunate? please re-phrase this. >>>> + * bindings (MSM8996, SDM660, SDM845) that require specifying the clocks and >>>> + * power-domains associated with a video core domain in a bogus sub-node, >>>> + * which means that additional fluff is necessary. >> Some background: >> It was done that way to support decoder core with specific clocks and similarly >> for encoder. Earlier architectures use to have different clock source for these >> specific decoder/encoder core clocks, now there is a common clock source for >> both the cores. Hence if any one is enabled, others gets enabled as it is >> derived from same source. >> So if we see the later bindings, the clocks were moved out of sub node to main >> venus node. > > Yeah and I don't really see the reason why the binding needed to be changed > for this, you can simply get the clocks by name and poke at the specific clk* > (or an array of them), no matter where they were _get()-ed from. I think the reason for not doing a name based clock as it might be possible that the clock is not available or applicable to subsequent SOC. Regards, Vikash