From patchwork Thu Dec 19 05:41:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13914473 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 5D1FE2165E8; Thu, 19 Dec 2024 05:42:22 +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=1734586944; cv=none; b=aYV+M0aK0PMCnHpwFNbv0/ZPsxEFRdfK41xBf065XdFJJJ0DeRZbG4Woz3jjON6WAw746VtyiCBFmjtHUMEYvGK37anoLZX2KgX3PademTbZtCpfxTnTWXG0pz+g3kQXyH1cL4ooA81vdZxidu7j9Lgfv5YfhngMsqJIsvi9nSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734586944; c=relaxed/simple; bh=401oRyKhkVAdNZCHfR00/dXgSqTVorIzFIEAVgh88BU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=jRFzg1Wl9t2himEKlO/kczpNG1g72qxvQ/Z8WpJlrOBx1QFxCzuS8/sWwaLCStgLXHcISA/fx1/0AoOSIXyrQCaiha3tgnX7amTStQxOw7wWD3tGX1GLrwof1uN5rK8mx+xKaqfhww2wxcjepd4n5OY9IsBVgCSY3/PMqAauudM= 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=LmDDPWZG; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LmDDPWZG" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIMgtMV027788; Thu, 19 Dec 2024 05:42:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Ut/d1jO5cPN35WUFGKw5ryrTjStnZ2vzkK2GpvwFc3w=; b=LmDDPWZGtNxC1O7Q jj2RBYLzXgOc5zDybnyr6DdyQYIkr8a4yq+tKci7FOQIp4fK9TFlWv1BQZy8tkfn 2I4SrSzwgrzH2pBqjWFIXq9aI/1ZuoPd7um+9hLIeNw2LT9bNcT6ApHP6CODxqie D5uSWZBFsu54KfpAHk8MInQn095oi1/eU9imOSHtZkjAlEucZ4250fd+nHKwWOS1 njNq/wx1TH9xsVYLkj43wFVy/KGw9Jwechg54gax+VLhThBRb+rVInUYxuIvdI4h ul7SjY/zi8NahB7Z65JuWXBeSWjvaALNmWkU/0ORprhXN8xzHPTDI4OEWjBWa73v 9QE8bQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43m7eb0shh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:18 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BJ5gG2Z018429 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:17 GMT Received: from hu-renjiang-sha.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 18 Dec 2024 21:42:13 -0800 From: Renjiang Han Date: Thu, 19 Dec 2024 11:11:53 +0530 Subject: [PATCH v6 1/4] dt-bindings: media: add support for video hardware on QCS615 platform Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241219-add-venus-for-qcs615-v6-1-e9a74d3b003d@quicinc.com> References: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> In-Reply-To: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: , , , , Renjiang Han , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734586930; l=1224; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=401oRyKhkVAdNZCHfR00/dXgSqTVorIzFIEAVgh88BU=; b=XnCNKA/ONwnMA3YwguapcQ6QvZr1oQbwYraREsqKS45BjWuoPsmt7HPrIDPS0OaKtYjwKSEgo NX0HpMZd5oABbugN+uWXp4bhkfSGQDT5/dQljkKjaThyjmFdK+0zJTx X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ivf6dZl3_tlFs8ghqi-U7hTwglfRj8M4 X-Proofpoint-ORIG-GUID: ivf6dZl3_tlFs8ghqi-U7hTwglfRj8M4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 suspectscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190041 QCS615 uses the same video core as SC7180. Therefore, add qcom,qcs615-venus compatible to qcom,sc7180-venus.yaml to enable video hardware support on QCS615 platform. Make qcom,qcs615-venus fallback to qcom,sc7180-venus to ensure compatibility with existing configurations. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Renjiang Han --- Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml index 83c4a5d95f020437bd160d6456850bc84a2cf5ff..bfd8b1ad473128c974bce84639cb0aff59d8c2cc 100644 --- a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml @@ -18,7 +18,12 @@ allOf: properties: compatible: - const: qcom,sc7180-venus + oneOf: + - items: + - enum: + - qcom,qcs615-venus + - const: qcom,sc7180-venus + - const: qcom,sc7180-venus power-domains: minItems: 2 From patchwork Thu Dec 19 05:41:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13914474 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 DAC0915C13F; Thu, 19 Dec 2024 05:42:25 +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=1734586947; cv=none; b=Tkf3Gb777xdQ2Erd/DdCKjGEMq/c/aXQ2Mmcuxq44tBjAbIt3L+F83Ub3BYkOG7OLLjoDSPgQH1+nYbRJZGWnO6UNRm/5frXK6kxcgy/Gx2TaUfwUs5q0C9VFVEchWw6Sk067IL0NrcuRfWLRpxtQMbOzr9NL20ZtrPoFgU07bA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734586947; c=relaxed/simple; bh=510U+uKkX0qDkY7BPlsnMvmkk9nGx0by9ZVeg4BDFTQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=TWA5ucs01uBEQSrnARg9khfjU20tVX8+AsFdDCKK98eegy2Ngd4KyedFR6QrbkEvy52gUATm9p4+eN0U/Sb7S9D+uiB+9Dt92XEKdgEiD6itgvzTjsfNLOKT0zhOxft5iqqP4R/8sob2Vil0zdk2B9ejeSdmFLDEy8lQkHA4wGc= 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=MdZpI8w8; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MdZpI8w8" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIM2jcD027712; Thu, 19 Dec 2024 05:42:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 8+4048FnU1OL77hmK3IUJFhERyNfHeGNNrbPV8JAU6s=; b=MdZpI8w8ZEzFM6Pt ewBtEYFQBXVaPj7PCxKvWFfn0Jqo1bjNiZUZXYnSsTDDw9ov6qefhBcgIDzrHk0C rS4cf80GXAclCxwC8NMThuyuMbW/IxyECvIigcy/KnBFBaj7Yn933A1AlDJ+p0QG W546fzvulmI+3OJMUzjJYun+BWrxbSAmS2fB3MQzVN1aIbE++tVPasAo6DOidfw9 YKw/maEAC902wQlqIEJV+nqcdG9Y2c7LHYgM0BJjxwzcqmN43lBbG+4mQ9RW3Tl5 lassF9J47U5TkrMf1Mpo9KMt5lutZ5h4R5z/7zVcv4zjZPJzvxALMQGlvu07phLw qX0Hyw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43m6uertjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:21 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BJ5gKUV030200 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:20 GMT Received: from hu-renjiang-sha.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 18 Dec 2024 21:42:17 -0800 From: Renjiang Han Date: Thu, 19 Dec 2024 11:11:54 +0530 Subject: [PATCH v6 2/4] media: venus: pm_helpers: use opp-table for the frequency Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241219-add-venus-for-qcs615-v6-2-e9a74d3b003d@quicinc.com> References: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> In-Reply-To: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734586930; l=3991; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=510U+uKkX0qDkY7BPlsnMvmkk9nGx0by9ZVeg4BDFTQ=; b=OIq/mAGlcWHnn+oN5ux+JKmF3nR5gCNSS9JBgvr1lMkqOKL6OIVFhTFmvqNmwqSzFa+/tUkI8 R8DbXWcADI6BtFQk1v8v66UjxURg3jNg6enrbLCp+HyObFcaaHCY14U X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jqXCNcAkcl2kWhjwMdYzXwxDjc_ZnC3i X-Proofpoint-ORIG-GUID: jqXCNcAkcl2kWhjwMdYzXwxDjc_ZnC3i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 clxscore=1015 impostorscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190043 The frequency value in the opp-table in the device tree and the freq_tbl in the driver are the same. Therefore, update pm_helpers.c to use the opp-table for frequency values for the v4 core. If getting data from the opp table fails, fall back to using the frequency table. Signed-off-by: Renjiang Han --- drivers/media/platform/qcom/venus/pm_helpers.c | 53 +++++++++++++++++++------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 33a5a659c0ada0ca97eebb5522c5f349f95c49c7..b61c0ad152878870b7223efa274e137d3636433b 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -43,14 +43,20 @@ static int core_clks_enable(struct venus_core *core) const struct venus_resources *res = core->res; const struct freq_tbl *freq_tbl = core->res->freq_tbl; unsigned int freq_tbl_size = core->res->freq_tbl_size; + struct device *dev = core->dev; + struct dev_pm_opp *opp; unsigned long freq; unsigned int i; int ret; - if (!freq_tbl) - return -EINVAL; - - freq = freq_tbl[freq_tbl_size - 1].freq; + opp = dev_pm_opp_find_freq_ceil(dev, &freq); + if (IS_ERR(opp)) { + if (!freq_tbl) + return -EINVAL; + freq = freq_tbl[freq_tbl_size - 1].freq; + } else { + dev_pm_opp_put(opp); + } for (i = 0; i < res->clks_num; i++) { if (IS_V6(core)) { @@ -627,12 +633,15 @@ min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load, bool lo static int decide_core(struct venus_inst *inst) { + const struct freq_tbl *freq_tbl = inst->core->res->freq_tbl; const u32 ptype = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE; struct venus_core *core = inst->core; u32 min_coreid, min_load, cur_inst_load; u32 min_lp_coreid, min_lp_load, cur_inst_lp_load; struct hfi_videocores_usage_type cu; - unsigned long max_freq; + unsigned long max_freq = ULONG_MAX; + struct device *dev = core->dev; + struct dev_pm_opp *opp; int ret = 0; if (legacy_binding) { @@ -655,7 +664,11 @@ static int decide_core(struct venus_inst *inst) cur_inst_lp_load *= inst->clk_data.low_power_freq; /*TODO : divide this inst->load by work_route */ - max_freq = core->res->freq_tbl[0].freq; + opp = dev_pm_opp_find_freq_floor(dev, &max_freq); + if (IS_ERR(opp)) + max_freq = freq_tbl[0].freq; + else + dev_pm_opp_put(opp); min_loaded_core(inst, &min_coreid, &min_load, false); min_loaded_core(inst, &min_lp_coreid, &min_lp_load, true); @@ -1078,7 +1091,9 @@ static int load_scale_v4(struct venus_inst *inst) unsigned int num_rows = core->res->freq_tbl_size; struct device *dev = core->dev; unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0; + unsigned long max_freq = ULONG_MAX; unsigned long filled_len = 0; + struct dev_pm_opp *opp; int i, ret = 0; for (i = 0; i < inst->num_input_bufs; i++) @@ -1104,19 +1119,29 @@ static int load_scale_v4(struct venus_inst *inst) freq = max(freq_core1, freq_core2); - if (freq > table[0].freq) { - dev_dbg(dev, VDBGL "requested clock rate: %lu scaling clock rate : %lu\n", - freq, table[0].freq); + opp = dev_pm_opp_find_freq_floor(dev, &max_freq); + if (IS_ERR(opp)) + max_freq = table[0].freq; + else + dev_pm_opp_put(opp); - freq = table[0].freq; + if (freq > max_freq) { + dev_dbg(dev, VDBGL "requested clock rate: %lu scaling clock rate : %lu\n", + freq, max_freq); + freq = max_freq; goto set_freq; } - for (i = num_rows - 1 ; i >= 0; i--) { - if (freq <= table[i].freq) { - freq = table[i].freq; - break; + opp = dev_pm_opp_find_freq_ceil(dev, &freq); + if (IS_ERR(opp)) { + for (i = num_rows - 1 ; i >= 0; i--) { + if (freq <= table[i].freq) { + freq = table[i].freq; + break; + } } + } else { + dev_pm_opp_put(opp); } set_freq: From patchwork Thu Dec 19 05:41:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13914475 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 EDD1A217657; Thu, 19 Dec 2024 05:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734586950; cv=none; b=JXABS1uzDByINx1g6PDL73Y29JFYu4cXapr2m0Gie9nkNsS3EYJ7xh1jgq7SvsOhj0yCEPwBdT+jYApb4M7+IgCbaNuu/QA0axDfzKNkdA9a+/fEy/RCckKD9F2YH6RQLIrh0ZmfBGUL5nJJtfLdy7zS+RJIG0duVzZegD88V14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734586950; c=relaxed/simple; bh=MwcPFLWKasXCraPczL+0Aqnwq6fomCVk51E5cEgKDYk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=USaS+PbLKniyAPF2/WT7RlG8mK1cKd6U2d9LW0aa5akwAqRh8yXmGu+BsGVeGi7dr3lXxeV1r7eBd20e82T32FBOpYPQu3CXKa0ziVt1wyFk17li8liReiHVV4YGc2ouP42+tuO45EcNCo+3lGLRtc5eOanhOdttJ040uE5XHag= 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=YtWnF08n; arc=none smtp.client-ip=205.220.168.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YtWnF08n" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIGR1rI000501; Thu, 19 Dec 2024 05:42:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= CW+mGabla1LIoGyHWkbTbyAzKKAjinbAPEAVvN+GeIs=; b=YtWnF08nZaEM/Rxk ibjwb1LoJuJr/Y3aK/+be1oDCmSMKh6UcSsGWybdaucF1U9GHII/81SeBIK1ereV R/jiaSit8bYhlmQwkG3iKCiujb4WBY/S8JgkuYxrFsoJVWNu/Oa2wuZYMCn0SPO0 R0KG8M2lFh6HaF34WRA1tf3A/G4Bu0DgtVvUUBTq7/0eadLgL9WFgJJGbICVapJU xd6W8nPaX7ImvTrGaRFb62xxSNes/oDwkpLpl8GedSl+67oUdxu2TvSWNbckmGc0 OBcydZZE5jFMdu7LnS4syxkTVSoMQRnBj/DchES7+NsQHtwZ5YFFD5gCFTlUh6d1 StgrDA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43m0su9ted-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:24 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BJ5gNpb002890 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:23 GMT Received: from hu-renjiang-sha.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 18 Dec 2024 21:42:20 -0800 From: Renjiang Han Date: Thu, 19 Dec 2024 11:11:55 +0530 Subject: [PATCH v6 3/4] arm64: dts: qcom: qcs615: add venus node to devicetree Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241219-add-venus-for-qcs615-v6-3-e9a74d3b003d@quicinc.com> References: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> In-Reply-To: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734586930; l=3154; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=MwcPFLWKasXCraPczL+0Aqnwq6fomCVk51E5cEgKDYk=; b=K8PvaJ28mmN7Z1W9i077lmA6xgCRi0i2L7cLzv4iVG3qaFPFEyxnBSGFzhaoQWeiePisrmdwL l2OK/IfStI8DaS1LjYUk7aOoyH2+pvI6xjPpgnkAhAv5wIgPYondtWV X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: X0MUs2Uda_gAvui04vMhmlC3rVCfeHNU X-Proofpoint-ORIG-GUID: X0MUs2Uda_gAvui04vMhmlC3rVCfeHNU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=546 spamscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 phishscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190043 Add the venus node to the devicetree for the qcs615 platform to enable video functionality. The qcs615 platform currently lacks video functionality due to the absence of the venus node. Fallback to sc7180 due to the same video core. Signed-off-by: Renjiang Han --- arch/arm64/boot/dts/qcom/qcs615.dtsi | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs615.dtsi b/arch/arm64/boot/dts/qcom/qcs615.dtsi index 872de9ab8f38d64e8f979bf3af8f122f8ff075d8..174d0a459a3c15defaebef16c7586dcda8618590 100644 --- a/arch/arm64/boot/dts/qcom/qcs615.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs615.dtsi @@ -427,6 +427,11 @@ smem_region: smem@86000000 { no-map; hwlocks = <&tcsr_mutex 3>; }; + + pil_video_mem: pil-video@93400000 { + reg = <0x0 0x93400000 0x0 0x500000>; + no-map; + }; }; soc: soc@0 { @@ -2807,6 +2812,79 @@ gem_noc: interconnect@9680000 { qcom,bcm-voters = <&apps_bcm_voter>; }; + venus: video-codec@aa00000 { + compatible = "qcom,qcs615-venus", "qcom,sc7180-venus"; + reg = <0x0 0x0aa00000 0x0 0x100000>; + interrupts = ; + + clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>, + <&videocc VIDEO_CC_VENUS_AHB_CLK>, + <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC0_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC0_AXI_CLK>; + clock-names = "core", + "iface", + "bus", + "vcodec0_core", + "vcodec0_bus"; + + power-domains = <&videocc VENUS_GDSC>, + <&videocc VCODEC0_GDSC>, + <&rpmhpd RPMHPD_CX>; + power-domain-names = "venus", + "vcodec0", + "cx"; + + operating-points-v2 = <&venus_opp_table>; + + interconnects = <&mmss_noc MASTER_VIDEO_P0 QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, + <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS + &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ALWAYS>; + interconnect-names = "video-mem", + "cpu-cfg"; + + iommus = <&apps_smmu 0xe40 0x20>; + + memory-region = <&pil_video_mem>; + + status = "disabled"; + + venus_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-133330000 { + opp-hz = /bits/ 64 <133330000>; + required-opps = <&rpmhpd_opp_low_svs>; + }; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000>; + required-opps = <&rpmhpd_opp_svs>; + }; + + opp-300000000 { + opp-hz = /bits/ 64 <300000000>; + required-opps = <&rpmhpd_opp_svs_l1>; + }; + + opp-380000000 { + opp-hz = /bits/ 64 <380000000>; + required-opps = <&rpmhpd_opp_nom>; + }; + + opp-410000000 { + opp-hz = /bits/ 64 <410000000>; + required-opps = <&rpmhpd_opp_turbo>; + }; + + opp-460000000 { + opp-hz = /bits/ 64 <460000000>; + required-opps = <&rpmhpd_opp_turbo_l1>; + }; + }; + }; + videocc: clock-controller@ab00000 { compatible = "qcom,qcs615-videocc"; reg = <0 0xab00000 0 0x10000>; From patchwork Thu Dec 19 05:41:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13914476 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 22A64217718; Thu, 19 Dec 2024 05:42:31 +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=1734586953; cv=none; b=kpy8krT2dwHblMXjpFA9tZFOrxgSnVoGCN+0+v18yKtKgQOLtxQpOIIi2aZqVcPSP8T34IkQP6xEHgl99r5GeFV7vV9EZqHfPlWHizF1qKWXfP09StcOg2JaIJp7ffiZumf7F6S6kG+v4tjRP5L4czsd56yE8nlRV5hUYJgD3Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734586953; c=relaxed/simple; bh=C0E2b4Hyps9Q/DWoHwWSfXox4cvkifP40WaddWc7jWE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=hu3yXYQem3KRp8P5xvDESpzzxRvsYSrblIRfcCNvFm9aU0yDO+bhSnGe4RdySLQpvP4Aiat/NYSc3wGEce0MJHsHV8cATYeFHZjljDUdXLxdOSqUHE/itSbWNGuzpnwkpTbSCZaHqoxVRfnLNVDChNVRKrNOG4/fXnnl/ICmESM= 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=Tvpytr4Y; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Tvpytr4Y" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIKCRLW013236; Thu, 19 Dec 2024 05:42:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Oy/Zsd2bM+jXGQzD1FrhI+LrB+yj3i1aS/C+f57OcCA=; b=Tvpytr4YywK/DNAl Tdx/bNei9C9jHX8xowJMotdwwKktR1qNXdQ7QDQMpS0j5+yKlaayXRUWj9tk1+Ht E0ctKBf4DN061Wp/KH7CUViurQEHcI/oQ9vmlYNnrtVJCtnsNfDg/uCR1IiG7qpd 3tWzoHLX+bW2KjCm+FMsW/2Gt4+FaxbchARtLXA2hh7isFkFzcJ44Zlu/ekYSznC THWmJ1+jKLdXdfuDewXYXvK0qnz4xupPzDXLA5xo/CcZWgJGlNIQQ/PqCEi2SY4e iEWay02+KnAlnkowZmkLDJT329MjeEQqMxi5xXhGmlhl7kCArpe9JZZzpW9Te2Jh EVZUKw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43m57h11bp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:27 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BJ5gQGv016144 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 05:42:26 GMT Received: from hu-renjiang-sha.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 18 Dec 2024 21:42:23 -0800 From: Renjiang Han Date: Thu, 19 Dec 2024 11:11:56 +0530 Subject: [PATCH v6 4/4] arm64: dts: qcom: qcs615-ride: enable venus node to initialize video codec Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241219-add-venus-for-qcs615-v6-4-e9a74d3b003d@quicinc.com> References: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> In-Reply-To: <20241219-add-venus-for-qcs615-v6-0-e9a74d3b003d@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734586930; l=721; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=C0E2b4Hyps9Q/DWoHwWSfXox4cvkifP40WaddWc7jWE=; b=T26Eff806fA9gfmDcf3V/J6oFK3XTeklO/H3zuXWiMIRJ7Lv4VwemrklSsjKKhhKL/Bil4LD7 zdZ6Z9I0kDqAud8S7P43zuHY9078ssxZY52SdNg9Zlo3y5TAxCX3+oJ X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: D4shSl5ElbF2GCeLUS60Ly_UJHnhh5DT X-Proofpoint-ORIG-GUID: D4shSl5ElbF2GCeLUS60Ly_UJHnhh5DT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 mlxlogscore=643 mlxscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190043 Enable the venus node to allow the video codec to start working properly by setting its status to "okay". Signed-off-by: Renjiang Han --- arch/arm64/boot/dts/qcom/qcs615-ride.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs615-ride.dts b/arch/arm64/boot/dts/qcom/qcs615-ride.dts index a25928933e2b66241258e418c6e5bc36c306101e..de954ede27f0942397d982f9aa725e59a8de9657 100644 --- a/arch/arm64/boot/dts/qcom/qcs615-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs615-ride.dts @@ -237,6 +237,10 @@ &usb_1_dwc3 { dr_mode = "peripheral"; }; +&venus { + status = "okay"; +}; + &watchdog { clocks = <&sleep_clk>; };