mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
media: iris: Add hooks for pixel and non-pixel context banks
Iris platforms use separate context-bank devices for the pixel, non-pixel firmware domains. Add platform hooks to create and destroy those subdevices, providing a interface for their lifecycle management across platforms. Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Tested-by: Daniel J Blueman <daniel@quora.org> Link: https://patch.msgid.link/20260726-glymur-v10-11-de451559e88b@oss.qualcomm.com Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
This commit is contained in:
committed by
Abel Vesa
parent
5a32992ec5
commit
a3cca19fde
@@ -397,6 +397,52 @@ static u64 iris_vpu36_get_required_freq(struct iris_inst *inst)
|
||||
return max(vcodec0_freq, vcodec1_freq);
|
||||
}
|
||||
|
||||
static int iris_vpu3x_init_cb_devs(struct iris_core *core)
|
||||
{
|
||||
struct device *dev;
|
||||
|
||||
dev = iris_create_cb_dev(core, "non-pixel");
|
||||
if (IS_ERR(dev))
|
||||
return PTR_ERR(dev);
|
||||
|
||||
core->np_dev = dev;
|
||||
|
||||
dev = iris_create_cb_dev(core, "pixel");
|
||||
if (IS_ERR(dev))
|
||||
goto unreg_np_dev;
|
||||
|
||||
core->p_dev = dev;
|
||||
|
||||
dev = iris_create_cb_dev(core, "video-firmware");
|
||||
if (IS_ERR(dev))
|
||||
goto unreg_p_dev;
|
||||
|
||||
core->fw_dev = dev;
|
||||
|
||||
return 0;
|
||||
|
||||
unreg_p_dev:
|
||||
if (core->p_dev)
|
||||
platform_device_unregister(to_platform_device(core->p_dev));
|
||||
core->p_dev = NULL;
|
||||
unreg_np_dev:
|
||||
if (core->np_dev)
|
||||
platform_device_unregister(to_platform_device(core->np_dev));
|
||||
core->np_dev = NULL;
|
||||
|
||||
return PTR_ERR(dev);
|
||||
}
|
||||
|
||||
static void iris_vpu3x_deinit_cb_devs(struct iris_core *core)
|
||||
{
|
||||
if (core->fw_dev)
|
||||
platform_device_unregister(to_platform_device(core->fw_dev));
|
||||
if (core->p_dev)
|
||||
platform_device_unregister(to_platform_device(core->p_dev));
|
||||
if (core->np_dev)
|
||||
platform_device_unregister(to_platform_device(core->np_dev));
|
||||
}
|
||||
|
||||
const struct vpu_ops iris_vpu3_ops = {
|
||||
.power_off_hw = iris_vpu3_power_off_hardware,
|
||||
.power_on_hw = iris_vpu_power_on_hw,
|
||||
@@ -435,4 +481,6 @@ const struct vpu_ops iris_vpu36_ops = {
|
||||
.set_hwmode = iris_vpu36_set_hwmode,
|
||||
.check_core_load = iris_vpu36_check_core_load,
|
||||
.get_required_freq = iris_vpu36_get_required_freq,
|
||||
.init_cb_devs = iris_vpu3x_init_cb_devs,
|
||||
.deinit_cb_devs = iris_vpu3x_deinit_cb_devs,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user