From mboxrd@z Thu Jan 1 00:00:00 1970 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 21AEB376BC1 for ; Wed, 10 Jun 2026 06:30:39 +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=1781073044; cv=none; b=ddaO8qNVfUvbrpIavf8DAEsXRszl1NrDsrwjNMmU0Rg4g0djJXyieIQ3wZdY2s68K4GlG4xHTDahv5mMAqMipwmm+L5F7vIVj9wh1z9jyumFi9tNRI4zeW+MvuZL7VAW3SQL68viHuJVvvFFn13DN8PHW1LKPF9ZW6Qm+bapz2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781073044; c=relaxed/simple; bh=xu0XPQQrGgIcADZXkcWURUAsf1MnYM7xyMfECG6R4iY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ekq3XtUb42Ax/2CL5TtheFd2Tyevhe02rEZSM27EmUCYSB567puwHe2crHNWK3ybDbfUz3mXB4s7uga191i/fqaDAC6pMjpnBG6ZVEpgdSe35VnnDStkSbdIRs64W/rJlQfDbT0hQsIhLWtc0mc2oeOg/dByFbIXhDKFrtc/ADU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=AIu5OqaU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=CdCI10nj; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="AIu5OqaU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CdCI10nj" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65A2efT2241014 for ; Wed, 10 Jun 2026 06:30:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= yRWghUWFVPf3fPEbC/Fe3T/IcSJlI8g6PwLdmF+HWAk=; b=AIu5OqaU11VlkgCu io1f17qEYHMztmqZbaxrGPlMzRwhWQywIko15R9+cbIg8vahzI5f6+YPP+MajUj1 6uH8UpoNEl1vWnRGWWdjkgeRb8ElZJlW52TEoIUYDKdEaY4B7g0Ht2jP+K91ocIc z09tNlRwKIAzqaU0/pacnpWWQ8in88PphDLZGdGN1yOjNp98mkcv+G/KsaIu9eoR dzWrlizqF5i0yMFTvssoe4bKEJI1wkOzSCm04OIiIg6aR1mdX7wcBLfbp3rQ4S+G 0DNGPFGLdRDtzvNpxARHkEBwFb1IMgJWwT9l4HzcEop/ZQrbcDUPmJc9mX2VXewh NASfxA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4epukesk3g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 10 Jun 2026 06:30:37 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-36bbcd40642so4893594a91.0 for ; Tue, 09 Jun 2026 23:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781073037; x=1781677837; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yRWghUWFVPf3fPEbC/Fe3T/IcSJlI8g6PwLdmF+HWAk=; b=CdCI10nj7L/GTe3Lo75iJNNNBKjH5gcEqvHANgx+nIYpLeeZb5ihmwvVBFpM1qq1/m 6qMCe1I2RYvuOj7bMWSG+eCLegOUDLCSNf1kadOfw5A/e6ebgG+AT5+o1MWA1OlnBvSP CzWer7ODmf72vEOAC2YInvn7fSN0qkbmP9rqIoE2qXm37jDPTHaFfnPsNYmAChwlemJI N/9euORghx8jjBcJMOLQLZlMldAfEjEDcAaQdBc6ZpQ2FmDSJrySE1oAMAS46g3cMK+i ByE4ycJs4bJRp79xHquakPj/Vgv9hUbAqexIben9zJ0UDN4nw5qdEVnTD9ITzOBKqLWY 74mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781073037; x=1781677837; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yRWghUWFVPf3fPEbC/Fe3T/IcSJlI8g6PwLdmF+HWAk=; b=BwV+pnjsDlfb5mo0EXiJW6SyIFNwfselVruZynZ/GF/SaNtLgQQLM/pfbQyu+4XqVU PcV7UgMHwl7ZGJVufSP2hrgyxum6mc3AcG7V7OsdbO5CiaSUZsQG2++q1s6wmk/1hFmb rUPGN2tO0d8NKPpbezqSV6VBADnymF/fa1lJqhXib+UI04B1dqk+nL7q2ajzFl1KjhMN x1MnkY+a9JcQHG7ZBfvZyxN7RV1F0DK+9s7UrHlFIxHvBcpxcIM2g4iiN1BAr4wwYbWu aKqhMsmqzR2RBaip9P1ajL1z94r1aLaAarIA6CPEs0wJvHf2MziDI7QZSagQDbBG6nVN KDxg== X-Gm-Message-State: AOJu0YyolmAfKSsruP2Gmkkm6LkWvtmCpV2o0ntGCpH0IwmXnIkKUErG 01CO2tl844T8LVHPnE2VouDTNuLOZlJb1S5wsY+2yq1fUS85QA9WcIEWiTfixR3ZA5dTj22mz2z IKyvHM9a4XCiEZYBbjpaPHYOmgtsCxQ6Nk+x4AfJtIrc2hWvEI77sRrPiMf4foH9TsZ8= X-Gm-Gg: Acq92OEchMamZcGC272V48JY0w3rurE3xSza6/pOJQCrXltCA+DIaTHJdqauia53S6d qZj/vu0LMir4cu+EFRfLNmWDC4vXeLgeqjUlUxW1pauzZt/3wJpDks3sDoAbhDV22MChTCtq2pa h5Ei1fkaL2WczOlWj4edACwOqBpftZoz/KXZoWCoW1yXnLbxG0Txt6DnG1RW4PBfJYbQguRQkYK sUZPJzxKANmWH2WdjXDrjfubmhYnobbqcqxjPxfeSuPvkpmcnW7S252fCR/itiwgEcSC6hWoA2t AgEARGhrjcvO37HasIOf4ljR2IDhwVKWM3Lwb+55ATE2Iy6wptGnSb/fzD5ATZDQO2E2vUxLG6i L0CNZNZcBfIXi7CyhwONS4QcY62t/t4521NOfenc8Cim8vRTNICnvu2H85hvDyO8VsQ== X-Received: by 2002:a17:90b:3c4f:b0:36b:93f7:a903 with SMTP id 98e67ed59e1d1-370f057b7f0mr26101939a91.18.1781073035546; Tue, 09 Jun 2026 23:30:35 -0700 (PDT) X-Received: by 2002:a17:90b:3c4f:b0:36b:93f7:a903 with SMTP id 98e67ed59e1d1-370f057b7f0mr26101909a91.18.1781073035080; Tue, 09 Jun 2026 23:30:35 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36f70a2892esm21580420a91.10.2026.06.09.23.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 23:30:34 -0700 (PDT) From: Vishnu Reddy Date: Wed, 10 Jun 2026 11:59:40 +0530 Subject: [PATCH v8 04/12] media: iris: Add context bank hooks for platform specific initialization Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260610-glymur-v8-4-1c79b9d51fc0@oss.qualcomm.com> References: <20260610-glymur-v8-0-1c79b9d51fc0@oss.qualcomm.com> In-Reply-To: <20260610-glymur-v8-0-1c79b9d51fc0@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1781073002; l=3955; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=xu0XPQQrGgIcADZXkcWURUAsf1MnYM7xyMfECG6R4iY=; b=bhxQGFLqPTHgIUNF7liZjSwOjDJVrophzNwIhKAIt7mP8Rj0AmnNn/j2fvNMuvpvvrPzTfDor Ok9eX9jBxT6DBvC+J8JzDCx4VCOhGvpkppCPigyec28OnF9HI+6Q93O X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjEwMDA1OSBTYWx0ZWRfX9Jcrk8t2hl8U 8jmAITYb2rUhalmuoPCmE5uQfWv8w4IKCxZXpRISBukG8E4ctzLA/EBQ8j068Rhw7jqCfZ7uyho CW8lB4hVwiw8p6wwDbZQnXHEOe59iQlzldtlwffCy6/MZxk2+8qTQO7Jg2eaxclGgqLabLAEHWL J060ngfa+SW/VScR7gwKeSEnQjFYlk2AWjawvpOcBegqAxfQ+gnof8/cAucNhUoZ9nqUO7LeY5g fAbAWOf3syvdk8M64aRQM0TqwTbTjXIMET4ry2D8j6NsNSe8Mh5lvBQfwCLg8ZM/KyISBg2gNZQ dgS+ItN7JeufA86dtILUIbFWMuvk1ZXnSIFa3I2DjwAoNSuZ3YQXhPs/FhQuW5Delf0jXWUbFwq 7klKAR45Wv/UTw+f/p//apLO9I72f0y69dEUrktCqFZEHvjLl+sDTyyjOC997RK7gn5B61/u7dD /Py88KgHevZaLVmD/GA== X-Proofpoint-ORIG-GUID: KCgSNX7dhnZ64KaIwHHaJVpNFF_PYgCl X-Proofpoint-GUID: KCgSNX7dhnZ64KaIwHHaJVpNFF_PYgCl X-Authority-Analysis: v=2.4 cv=DNG/JSNb c=1 sm=1 tr=0 ts=6a29048d cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=ZwZBACt1qYONU4SPBGcA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-10_01,2026-06-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 spamscore=0 impostorscore=0 priorityscore=1501 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606100059 The glymur platform requires a dedicated firmware context bank device to boot firmware where linux runs as the hypervisor and driver needs to manually manage the firmware IOMMU mapping. Add init and deinit hooks in the vpu ops for context bank setup. These hooks allow platform specific code to initialize and tear down context banks. Reviewed-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_core.c | 9 ++++++++- drivers/media/platform/qcom/iris/iris_vpu_common.c | 14 ++++++++++++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.c b/drivers/media/platform/qcom/iris/iris_core.c index 52bf56e517f9..89dbe9bbf6b0 100644 --- a/drivers/media/platform/qcom/iris/iris_core.c +++ b/drivers/media/platform/qcom/iris/iris_core.c @@ -19,6 +19,7 @@ void iris_core_deinit(struct iris_core *core) iris_fw_unload(core); iris_vpu_power_off(core); iris_hfi_queues_deinit(core); + iris_deinit_cb_devs(core); core->state = IRIS_CORE_DEINIT; } mutex_unlock(&core->lock); @@ -58,10 +59,14 @@ int iris_core_init(struct iris_core *core) core->state = IRIS_CORE_INIT; - ret = iris_hfi_queues_init(core); + ret = iris_init_cb_devs(core); if (ret) goto error; + ret = iris_hfi_queues_init(core); + if (ret) + goto error_deinit_cb_devs; + ret = iris_vpu_power_on(core); if (ret) goto error_queue_deinit; @@ -94,6 +99,8 @@ int iris_core_init(struct iris_core *core) iris_vpu_power_off(core); error_queue_deinit: iris_hfi_queues_deinit(core); +error_deinit_cb_devs: + iris_deinit_cb_devs(core); error: core->state = IRIS_CORE_DEINIT; exit: diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/media/platform/qcom/iris/iris_vpu_common.c index ab41da1f47c8..8bdfee672954 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -319,6 +319,20 @@ int iris_vpu_switch_to_hwmode(struct iris_core *core) return core->iris_platform_data->vpu_ops->set_hwmode(core); } +int iris_init_cb_devs(struct iris_core *core) +{ + if (core->iris_platform_data->vpu_ops->init_cb_devs) + return core->iris_platform_data->vpu_ops->init_cb_devs(core); + + return 0; +} + +void iris_deinit_cb_devs(struct iris_core *core) +{ + if (core->iris_platform_data->vpu_ops->deinit_cb_devs) + core->iris_platform_data->vpu_ops->deinit_cb_devs(core); +} + int iris_vpu35_vpu4x_power_off_controller(struct iris_core *core) { u32 clk_rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/media/platform/qcom/iris/iris_vpu_common.h index 09799a375c14..e0dc109bbe6a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -22,6 +22,8 @@ struct vpu_ops { void (*program_bootup_registers)(struct iris_core *core); u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); int (*set_hwmode)(struct iris_core *core); + int (*init_cb_devs)(struct iris_core *core); + void (*deinit_cb_devs)(struct iris_core *core); }; int iris_vpu_boot_firmware(struct iris_core *core); @@ -33,6 +35,8 @@ int iris_vpu_power_on_controller(struct iris_core *core); int iris_vpu_power_on_hw(struct iris_core *core); int iris_vpu_set_hwmode(struct iris_core *core); int iris_vpu_switch_to_hwmode(struct iris_core *core); +int iris_init_cb_devs(struct iris_core *core); +void iris_deinit_cb_devs(struct iris_core *core); int iris_vpu_power_on(struct iris_core *core); int iris_vpu_power_off_controller(struct iris_core *core); void iris_vpu_power_off_hw(struct iris_core *core); -- 2.34.1