From patchwork Fri Dec 13 09:56:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13906801 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 0F4591B4126; Fri, 13 Dec 2024 09:57:33 +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=1734083856; cv=none; b=bMgGzooHReMgnP6+5TLijX/ASJFqwnGRnSOxMOi44CTEXuy6ovoSvLNn237w4zWcisBrZ6cQOmtfoXe6C9DuEok2x1NwN2HY6NW/iIGheNlCUrwPu5Wg8dHNbf8smaRt6PkjzOwkh6rv9UGF789+CpyTubgDY7tz1fjF4H6UsBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734083856; c=relaxed/simple; bh=nVU23QDeAUD8yiafCqoD5xrazbt1IBvpnfozPSD/x2M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Q3brAY8STogejEGT9U0NoU4962fk0Zi34h644cvNyxV74yl3TOghR9fvgmhZKWIsogAGald/e0eYfffD2QWpsZ/1UiOxkXTVybAMMfvGSCpiE9IcyKprEukSpPkmugG30517KC8RBA0LO4pqaYemtokf3gk7APZpUEk69t9HFx4= 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=IFKtB3J5; 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="IFKtB3J5" 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 4BD9nZTa017417; Fri, 13 Dec 2024 09:57:29 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= n/ZM6z3aN2dNtQWXvRJjBjbmmWfS4QZwT/82jlW+/Rc=; b=IFKtB3J58fOBf+gV XTr9zD+hGV4HY/WSrFGBXCSA8LTwkwgyPv+fMMTtySlLCwpax+GoBOB+tkviaLIw U9xvQdHZ/bgnqOzicb6blDf3bYk+5aMZqg+//vlQ3yhNIdQq4XGFLSfTUcAloZDn JAh45hpEazatVWlKJMWhdD1KP/izUi9h3RpGutKk3kjFKMhX+F8oDGwoTqHz7QDI mhb5Mvp8IQFc1D0wmfOozjXA1ksZJG6mLFQWrof7XFD+xYVbg0WBeMCQ92bpQUg7 j25+Gl6aSrPfmsm0UZlqP0NM03UvEM7JxGvPEABdatK56u26fF6KcNsJBrepx9mL L4hLtw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43gjmt00xf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:28 +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 4BD9vRh9028932 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:27 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; Fri, 13 Dec 2024 01:57:23 -0800 From: Renjiang Han Date: Fri, 13 Dec 2024 15:26:46 +0530 Subject: [PATCH v4 1/4] dt-bindings: media: add support for video hardware Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241213-add-venus-for-qcs615-v4-1-7e2c9a72d309@quicinc.com> References: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> In-Reply-To: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: Stanimir Varbanov , , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734083839; l=1036; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=nVU23QDeAUD8yiafCqoD5xrazbt1IBvpnfozPSD/x2M=; b=UEbC3p4I9Qm9ML+933v4PwnIx9tN5JjYvdjNDTZ0oIQqjV1TEO6gqesSRM+pVTqNeVbycxcnq gAX/Cycda20AFH2e5MQ3+WDDaxVOhOkbm1zIp64G0BjE1crezm5J8u2 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: vryCoU3tSddQ43hOM9fBH1u7JmJeCRJp X-Proofpoint-ORIG-GUID: vryCoU3tSddQ43hOM9fBH1u7JmJeCRJp 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 lowpriorityscore=0 mlxscore=0 phishscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 malwarescore=0 clxscore=1011 adultscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412130067 Add qcom,qcs615-venus compatible into qcom,sc7180-venus.yaml for the video, and let qcom,qcs615-venus fallback to qcom,sc7180-venus on QCS615 platform. Signed-off-by: Renjiang Han Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml index 5cec1d077cda77817f6d876109defcb0abbfeb2c..6dee45b7366578e51319b575e5dd2587dc84baeb 100644 --- a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml @@ -18,7 +18,13 @@ 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 Fri Dec 13 09:56:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13906803 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 03A711BAEFD; Fri, 13 Dec 2024 09:57:37 +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=1734083859; cv=none; b=JLa6aCUADTz/WkGMmL74A5ApBJnVbWy84Zjqo991FL4nuQvBbiUnPLn+NHnQGAa3IC6lxWrF0LTrpcdrANBb3gKuwp2eQGuf9Vc+rEZTvHVzVR4JkcKFvfcr69S2gjcGnoSDARj82JC+bQLBxqvGZt0BZGIUKUj9rgZakPXOIm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734083859; c=relaxed/simple; bh=PtbKU2NbH1OC4Aalx07D79W7HwShdufL1WIaf7DMRz8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=hzm7rPXsWHiQWx33y+B7999t+iJ9eM/EBvJFfyRz/NKqDXlWN8xmv/FpAWfzakgrFmkzAejcSEDCfxSplnheByOCgvAOpczY/xZ8EZf/sBlxNlDwVjJM3bJInM+RP2w7x9x5TeDre/w+c00vw4rYK9+azzGldeYWREmBTNfxq5Q= 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=GiWhxtKd; 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="GiWhxtKd" 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 4BD9t2sW006142; Fri, 13 Dec 2024 09:57:33 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= crPXWjd+zSPfRQ1mGUgQy9a80oU6zTphxnSkNMvFw24=; b=GiWhxtKdGY1k7WCP 7OW8E3s7ln6YOnAq2EjxUppn13ZIYOQGPoujlwt5VhSTRiHaub8kclmOXkUym5g+ qTioVLdT8drWJ4YTbc+5P3WGdZFjQn7qmii9p7XcVFO5Bwa4lKEUrnGnOzY5dixf y+RimbuaLtwqNYfVmASdWaQ/my6GfD/A915gu2JrMs3mUvXCs9LWrGqZp79w+P2j ng0RBy1Wf9VXbCcGZSBiiNqxM0dOpAfAKs6feDOZo2TTNpeEd4Tas3g/zDYEOAyt 6HnmEAGDAZywKe+Ugu27dytz2S+AgGM1zNBB60P/N3zmYHEw6naDWxlr8nu020Ar fyGdEg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43g6xuspfr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:32 +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 4BD9vVXD006805 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:31 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; Fri, 13 Dec 2024 01:57:27 -0800 From: Renjiang Han Date: Fri, 13 Dec 2024 15:26:47 +0530 Subject: [PATCH v4 2/4] media: venus: core: use opp-table for the frequency Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241213-add-venus-for-qcs615-v4-2-7e2c9a72d309@quicinc.com> References: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> In-Reply-To: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: Stanimir Varbanov , , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734083839; l=4573; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=PtbKU2NbH1OC4Aalx07D79W7HwShdufL1WIaf7DMRz8=; b=CeRn9z6VdBwXYbEIbCCNEnrvD6LCzSaLHah8Pti/6V812DAVSMPAll/gdCUHYUUo4SuZ3PSWX mpq3dYTrs6pC1qVm7+7FdLyNEvDiYej5zBhJA/WwnqISaknb64svwp5 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-ORIG-GUID: 0mqueVSx6E9bb2RGeA46tm0ob8Slf5Ds X-Proofpoint-GUID: 0mqueVSx6E9bb2RGeA46tm0ob8Slf5Ds 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 priorityscore=1501 impostorscore=0 clxscore=1011 malwarescore=0 adultscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412130067 Get frequency value from the opp-table of devicetree for the v4 core. For compatibility, if getting data from the opp table fails, the data in the frequency table will be used. The order of variable definitions is adjusted only to keep the reverse Christmas tree order coding style. Signed-off-by: Renjiang Han --- drivers/media/platform/qcom/venus/pm_helpers.c | 67 ++++++++++++++++++-------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 33a5a659c0ada0ca97eebb5522c5f349f95c49c7..a5c3f9ad2088d8c80247b52d5c1b8e053f499bfe 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -40,17 +40,23 @@ static int core_clks_get(struct venus_core *core) 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; - unsigned long freq; + const struct venus_resources *res = core->res; + struct device *dev = core->dev; + unsigned long freq = 0; + struct dev_pm_opp *opp; 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; + u32 min_coreid, min_load, cur_inst_load; + struct venus_core *core = inst->core; 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); @@ -1073,12 +1086,14 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst, static int load_scale_v4(struct venus_inst *inst) { + const struct freq_tbl *table = inst->core->res->freq_tbl; + unsigned int num_rows = inst->core->res->freq_tbl_size; + unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0; struct venus_core *core = inst->core; - const struct freq_tbl *table = core->res->freq_tbl; - unsigned int num_rows = core->res->freq_tbl_size; + unsigned long max_freq = ULONG_MAX; struct device *dev = core->dev; - unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0; 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 Fri Dec 13 09:56:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13906804 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 9CE971DEFE5; Fri, 13 Dec 2024 09:57:42 +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=1734083864; cv=none; b=uqXV/ViOrAWmLFPMG/RaT5x2yadpXSRLbdYoesjF76QofmXuAPQcC2QdtIuEWD7n+N+Pky27M289ZzhcS0UYGhrsgBG9apyTIc85wQ2X1NNDxibD2jYHRx11Yl+2vT7R5RM5pdix81Hj1xUgMQDvFWxW3zOmqjF1HRYXQThl2EE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734083864; c=relaxed/simple; bh=nXcNEm67V47ZebsUBjblYE6CLq1+oZBnGezqSftQzq8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Q74AV6nLwDgIlckEOnedDKiDm903h9F0Una3Q+uhkpZO7BT1rQnk06jGCliLlHS3Tr/Rz1QbGf9BFZ+6IaRpqYz/uHsx9q7d/3ZaSaXONJOMURSf7wbAYFTyGkKJOgozeFaQkkgbsDNXEsWopZWNWmFVuL/YaatMYF5GQ57bxuI= 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=T62CrJqv; 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="T62CrJqv" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BD46J7C018810; Fri, 13 Dec 2024 09:57:37 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= 5CHvFQcmpzm++D7MnZ4odqGK/4ffhYvLKraVgutRSSI=; b=T62CrJqv7Nw/BvFj bEmMfEVlDqjFQIaiSNWisjSkFVl6QqnKyPV0+vV/+AWIGVUwbrYFUMtm7rAZx559 2v16TtALgIUhUnM2vbnR9PPZjqoa0vfdT4EPEX1+Ief/RxzaWaAgpRzWXKrPSnGX hsw1LYsr17sZfbxXr04B0OjugEyk7cjBG5812U9ZknDwtxEhBYaGkNwGVQfC9Z3H E3hQBxiLXqk+kXEHJ5morDABHEL5CqAYwKdDo0KMrLJzdg8Mek/IiSS092ku3mJn NICt3+fZSKCFEdM/JqJQG9G/l5zqpLytKyiJgtR1sGuQZ+6ggg2YykR4CsKRRH7Q 79UJhw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43gdkn0uy3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:36 +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 4BD9vZ9S029373 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:35 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; Fri, 13 Dec 2024 01:57:31 -0800 From: Renjiang Han Date: Fri, 13 Dec 2024 15:26:48 +0530 Subject: [PATCH v4 3/4] arm64: dts: qcom: add venus node for the qcs615 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241213-add-venus-for-qcs615-v4-3-7e2c9a72d309@quicinc.com> References: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> In-Reply-To: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: Stanimir Varbanov , , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734083839; l=3165; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=nXcNEm67V47ZebsUBjblYE6CLq1+oZBnGezqSftQzq8=; b=69xNNkopdk1mdp4D7fmb89HzdSZZ13QXTvyqzzewphxtC6xq4ETgdZr9ZjICD3R8O9F2C1Hv5 SkC+vjB5jWkDK5JkjSEmWEZN67eIVrxDyfOJrYOzWDlS1D+grtl2lQt 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: rihk4omJB5qy4fiduwciXif_iBWYbM71 X-Proofpoint-ORIG-GUID: rihk4omJB5qy4fiduwciXif_iBWYbM71 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 spamscore=0 mlxlogscore=681 impostorscore=0 lowpriorityscore=0 clxscore=1011 priorityscore=1501 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412130067 Add venus node into devicetree for the qcs615 video and fallback qcs615 to sc7180 due to the same video core. Signed-off-by: Renjiang Han --- arch/arm64/boot/dts/qcom/qcs615.dtsi | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs615.dtsi b/arch/arm64/boot/dts/qcom/qcs615.dtsi index 37a189e0834d2f4b75ed9deb6fff73da163cb3a3..c08da80c7fd8fa8c69aff04b14784b821ce3ea13 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 { @@ -2806,6 +2811,87 @@ 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"; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + + 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 Fri Dec 13 09:56:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han X-Patchwork-Id: 13906805 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 8E8051DF724; Fri, 13 Dec 2024 09:57:45 +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=1734083867; cv=none; b=F28eBgtc2+TgJ2Rxr79ARo2sMgcyGiXc9txXBxC3jUjknZEo6ZJVZ42scfS1Jd1BnTyq8olx+HoLs7Rr5enbCNMw4oDl46I/nva9JqS8DsW97T9acy9hy6uiJVlzPHgzPQQsUhvf5OeY2V6GCs9f73iTKk6HIWFNZ7LL5O8Y6zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734083867; c=relaxed/simple; bh=KwWEWFCB5ShOc5u4wAgQHgytmXEGoQcKusA3At0d9GU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=aVH8RxcQcLBBqFxa3lRBvJ67VRztZSPv2C+QYnOxgifOctfcX6vnIgAfICTNfWojprhQ8EPflHixT0NV4TmRZGykdCjW8FhGGUTaqtBwEiri3o4VTF8HDWq6Bu6UX42wb2EfwhJejqgdAgblilZWFc8k6qFI9j3qGgwcGXTjqdE= 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=L4AwSnpJ; 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="L4AwSnpJ" 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 4BD1Vq8J001463; Fri, 13 Dec 2024 09:57:40 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= 4SElXYnGf35AatXlxXldZcr44qubrPnAWZUpZmhsISg=; b=L4AwSnpJV3FowTuk sF5JSjzO1lLHQtbLllzL3FsRv5Dbj5YJDOOO/najpE3eaYkx2eFLqFgFqVs3OVtv BB6l/3blW3EMaoRSAr6+7eqXbxcxzXR52g7SVyoiYhGVx/JAvIvk2xBNz+PKYgzS cgsernB0oyx51LcV8afFkV5JO4r4I+1eF+lKj8AhLv5B+8ItsDxyJEQgF7NJQ7GB BAC9OJWP00PA0l+w595f7ycXAgISCleU3Q8I7LgSfZWLo/x5jtpXZ9kAX1v/yHu6 iuDr54j1JXzyxskqZg5wPz6vzvxuUNgyrKYT9RDAFlHAPUsilqXTBphw7BsXWQyc 63vm5Q== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 43fqes4cky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:40 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4BD9vdSt016969 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Dec 2024 09:57:39 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; Fri, 13 Dec 2024 01:57:35 -0800 From: Renjiang Han Date: Fri, 13 Dec 2024 15:26:49 +0530 Subject: [PATCH v4 4/4] arm64: dts: qcom: qcs615-ride: enable venus node Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241213-add-venus-for-qcs615-v4-4-7e2c9a72d309@quicinc.com> References: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> In-Reply-To: <20241213-add-venus-for-qcs615-v4-0-7e2c9a72d309@quicinc.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio CC: Stanimir Varbanov , , , , , Renjiang Han X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1734083839; l=680; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=KwWEWFCB5ShOc5u4wAgQHgytmXEGoQcKusA3At0d9GU=; b=ZiQaIIEmjgrVpjfXtPxAIoMt44O5pgBIH/00mAzebjp1Hb2KryCBYJ3hr5gDNsSm+WSa7uj96 r/Pm+XANo0kDXOli5HHneGi5DbXwXs6Aj9ipN4YQwYyVaxmcqnP3/CP 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: HHa_j0bMl6_KD_p64ulH_iovaJ3LtY22 X-Proofpoint-ORIG-GUID: HHa_j0bMl6_KD_p64ulH_iovaJ3LtY22 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 spamscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1011 malwarescore=0 mlxlogscore=559 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412130067 Enable the venus node so that the video codec will start working. 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>; };