On Wed, Jan 08, 2025 at 03:22:49PM +0530, Dikshita Agarwal wrote: > > > On 1/6/2025 6:06 PM, Joel Stanley wrote: > > On Thu, 12 Dec 2024 at 22:23, Dikshita Agarwal > > <quic_dikshita@xxxxxxxxxxx> wrote: > >> > >> Introduce support for Qualcomm new video acceleration hardware i.e. > >> iris, used for video stream decoding. > >> > >> Iris is a multi pipe based hardware that offloads video stream decoding > >> from the application processor (AP). It supports H.264 decoding. The AP > >> communicates with hardware through a well defined protocol, called as > >> host firmware interface (HFI), which provides fine-grained and > >> asynchronous control over individual hardware features. > >> > >> This driver implements upgraded HFI gen2 to communicate with firmware. > >> It supports SM8550 which is based out of HFI gen 2. It also supports > >> SM8250 which is based out of HFI gen1. > > > > I tested this on an x1e based machine, a Surface Laptop 7. I had some > > errors with loading the firmware which triggered some warnings when > > trying to tear down the driver. I've pasted the WARNs at the end of > > this mail. > > > > I was using the firmware from linux-firmware, as packaged by distros: > > > > 4d2dae9a8187b728939e9c79fa68012b qcom/vpu/vpu30_p4.mbn > > > Hi Joel, > > I tried again with firmware (qcom/vpu/vpu30_p4.mbn) available in > linux-firmware[1] on my setup i.e SM8550 MTP and don't see any issue with > firmware load. Of course. MTP is not fused to reject firmware not signed by a particular vendor key. Production devices are. Please test that the driver works correctly if the firmware gets rejected by TZ. > could you pls share from where you are taking the firmware? > > [1] git clone > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git > > Thanks, > Dikshita > > It appears to be signed by a test key, which I assume was the cause of > > the failure. Replacing it with a properly signed version worked, and I > > was able successfully decode a test video with ffplay: > > > > $ ffplay -codec:v h264_v4l2m2m test.mp4 > > ... > > [h264_v4l2m2m @ 0xffff500054b0] Using device /dev/video0 > > [h264_v4l2m2m @ 0xffff500054b0] driver 'iris_driver' on card > > 'iris_decoder' in mplane mode > > [h264_v4l2m2m @ 0xffff500054b0] requesting formats: output=H264/none > > capture=NV12/yuv420p > > > > Cheers, > > > > Joel > > --- > > [ 2.587909] qcom-iris aa00000.video-codec: error -22 initializing > > firmware qcom/vpu/vpu30_p4.mbn > > [ 2.588095] qcom-iris aa00000.video-codec: firmware download failed > > [ 2.588250] ------------[ cut here ]------------ > > [ 2.588251] Unmap of a partial large IOPTE is not allowed > > [ 2.588256] WARNING: CPU: 4 PID: 659 at > > drivers/iommu/io-pgtable-arm.c:649 __arm_lpae_unmap+0x3cc/0x468 > > [ 2.588335] CPU: 4 UID: 0 PID: 659 Comm: v4l_id Tainted: G W > > 6.13.0-rc4-00092-g1bbe1a937cf6 #21 > > [ 2.588338] Tainted: [W]=WARN > > [ 2.588339] Hardware name: Microsoft Corporation Microsoft Surface > > Laptop, 7th Edition/Microsoft Surface Laptop, 7th Edition, BIOS > > 160.2.235 08/05/2024 > > [ 2.588340] pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) > > [ 2.588342] pc : __arm_lpae_unmap+0x3cc/0x468 > > [ 2.588344] lr : __arm_lpae_unmap+0x3cc/0x468 > > [ 2.588345] sp : ffff80008259b690 > > [ 2.588346] x29: ffff80008259b690 x28: ffff80008259bc30 x27: ffff80008259b8f8 > > [ 2.588349] x26: ffffb973346978d0 x25: ffff68590225e7f0 x24: ffff80008259b8f8 > > [ 2.588351] x23: 00000000dfc00000 x22: 0000000000001000 x21: ffff68590396ce80 > > [ 2.588354] x20: ffff6859068fa4f8 x19: ffff6859068fa480 x18: fffffffffffef6a8 > > [ 2.588356] x17: ffff685900b8c040 x16: 0000000000000000 x15: ffff80008259b248 > > [ 2.588359] x14: ffffb9733457e768 x13: 6465776f6c6c6120 x12: 746f6e2073692045 > > [ 2.588362] x11: ffffb9733457e768 x10: 000000000000030c x9 : ffffb973345d6768 > > [ 2.588364] x8 : 0000000000017fe8 x7 : 00000000fffff30b x6 : ffffb973345d6768 > > [ 2.588367] x5 : ffff685c75f4b848 x4 : 40000000fffff30b x3 : ffffaee941a6a000 > > [ 2.588369] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff68590bc25640 > > [ 2.588372] Call trace: > > [ 2.588373] __arm_lpae_unmap+0x3cc/0x468 (P) > > [ 2.588376] __arm_lpae_unmap+0xf4/0x468 > > [ 2.588379] __arm_lpae_unmap+0xf4/0x468 > > [ 2.588381] arm_lpae_unmap_pages+0x70/0x84 > > [ 2.588383] arm_smmu_unmap_pages+0x48/0x10c > > [ 2.588385] __iommu_unmap+0xf0/0x1c0 > > [ 2.588387] iommu_unmap_fast+0x10/0x20 > > [ 2.588389] __iommu_dma_unmap+0xb8/0x2c0 > > [ 2.588391] iommu_dma_free+0x2c/0x54 > > [ 2.588392] dma_free_attrs+0x9c/0xc0 > > [ 2.588395] iris_hfi_queues_deinit+0x70/0xa0 [iris] > > [ 2.588399] iris_core_init+0xd8/0x138 [iris] > > [ 2.588401] iris_open+0x3c/0x318 [iris] > > [ 2.588403] v4l2_open+0xa8/0x124 [videodev] > > [ 2.588406] chrdev_open+0xb0/0x21c > > [ 2.588409] do_dentry_open+0x138/0x4c4 > > [ 2.588412] vfs_open+0x2c/0xe4 > > [ 2.588413] path_openat+0x6fc/0x10a0 > > [ 2.588415] do_filp_open+0xa8/0x170 > > [ 2.588417] do_sys_openat2+0xc8/0xfc > > [ 2.588418] __arm64_sys_openat+0x64/0xc0 > > [ 2.588420] invoke_syscall+0x48/0x104 > > [ 2.588423] el0_svc_common.constprop.0+0xc0/0xe0 > > [ 2.588426] do_el0_svc+0x1c/0x28 > > [ 2.588428] el0_svc+0x30/0xcc > > [ 2.588431] el0t_64_sync_handler+0x10c/0x138 > > [ 2.588433] el0t_64_sync+0x198/0x19c > > [ 2.588435] ---[ end trace 0000000000000000 ]--- > > [ 2.588438] ------------[ cut here ]------------ > > [ 2.588439] WARNING: CPU: 4 PID: 659 at > > drivers/iommu/dma-iommu.c:841 __iommu_dma_unmap+0x290/0x2c0 > > [ 2.588497] CPU: 4 UID: 0 PID: 659 Comm: v4l_id Tainted: G W > > 6.13.0-rc4-00092-g1bbe1a937cf6 #21 > > [ 2.588499] Tainted: [W]=WARN > > [ 2.588500] Hardware name: Microsoft Corporation Microsoft Surface > > Laptop, 7th Edition/Microsoft Surface Laptop, 7th Edition, BIOS > > 160.2.235 08/05/2024 > > [ 2.588501] pstate: 81400005 (Nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) > > [ 2.588502] pc : __iommu_dma_unmap+0x290/0x2c0 > > [ 2.588503] lr : __iommu_dma_unmap+0xb8/0x2c0 > > [ 2.588505] sp : ffff80008259b8f0 > > [ 2.588505] x29: ffff80008259b930 x28: ffff80008259bc30 x27: 0000000000020100 > > [ 2.588508] x26: 0000000000020100 x25: ffff68590bf76a08 x24: ffff80008259b910 > > [ 2.588511] x23: ffff80008259b8f8 x22: ffff6859113cd260 x21: ffff68590bf76a00 > > [ 2.588513] x20: 00000000dfc00000 x19: 0000000000001000 x18: fffffffffffef6a8 > > [ 2.588516] x17: ffff685900b8c040 x16: 0000000000000000 x15: ffff80008259b248 > > [ 2.588518] x14: ffffb9733457e768 x13: 6465776f6c6c6120 x12: 746f6e2073692045 > > [ 2.588521] x11: ffffb9733457e768 x10: 000000000000030c x9 : ffffb973345d6768 > > [ 2.588523] x8 : 0000000000017fe8 x7 : 00000000fffff30b x6 : ffffb973345d6768 > > [ 2.588525] x5 : ffff685c75f4b848 x4 : 40000000fffff30b x3 : ffffaee941a6a000 > > [ 2.588528] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 > > [ 2.588530] Call trace: > > [ 2.588531] __iommu_dma_unmap+0x290/0x2c0 (P) > > [ 2.588532] iommu_dma_free+0x2c/0x54 > > [ 2.588534] dma_free_attrs+0x9c/0xc0 > > [ 2.588535] iris_hfi_queues_deinit+0x70/0xa0 [iris] > > [ 2.588537] iris_core_init+0xd8/0x138 [iris] > > [ 2.588539] iris_open+0x3c/0x318 [iris] > > [ 2.588541] v4l2_open+0xa8/0x124 [videodev] > > [ 2.588543] chrdev_open+0xb0/0x21c > > [ 2.588545] do_dentry_open+0x138/0x4c4 > > [ 2.588547] vfs_open+0x2c/0xe4 > > [ 2.588549] path_openat+0x6fc/0x10a0 > > [ 2.588550] do_filp_open+0xa8/0x170 > > [ 2.588551] do_sys_openat2+0xc8/0xfc > > [ 2.588553] __arm64_sys_openat+0x64/0xc0 > > [ 2.588555] invoke_syscall+0x48/0x104 > > [ 2.588557] el0_svc_common.constprop.0+0xc0/0xe0 > > [ 2.588560] do_el0_svc+0x1c/0x28 > > [ 2.588562] el0_svc+0x30/0xcc > > [ 2.588564] el0t_64_sync_handler+0x10c/0x138 > > [ 2.588566] el0t_64_sync+0x198/0x19c > > [ -- With best wishes Dmitry