summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/amphion/vpu_core.h
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2022-08-18 05:18:21 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-08-30 15:27:51 +0200
commit0202a665bf17fbe98fed954944aabbcb4f14a4cc (patch)
tree166d233a00e7c4692d18595c12c886fd3bc4cdd0 /drivers/media/platform/amphion/vpu_core.h
parentc65c3f3a2cbf21ed429d9b9c725bdb5dc6abf4cf (diff)
downloadlinux-0202a665bf17fbe98fed954944aabbcb4f14a4cc.tar.gz
linux-0202a665bf17fbe98fed954944aabbcb4f14a4cc.tar.bz2
linux-0202a665bf17fbe98fed954944aabbcb4f14a4cc.zip
media: amphion: fix a bug that vpu core may not resume after suspend
driver will enable the vpu core when request the first instance on the core. one vpu core can only support 8 streaming instances in the same time, the instance won't be added to core's list before streamon. so the actual instance count may be greater then the number in the core's list. in pm resume callback, driver will resume the core immediately if core's list is not empty. but this check is not accurate, if suspend during one instance is requested, but not streamon, then after suspend, the core won't be resume, and led to instance failure. use the request_count instead of the core's list to check whether is the core needed to resume immediately after suspend. And it can make the pm suspend and resume callback more clear. Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/amphion/vpu_core.h')
-rw-r--r--drivers/media/platform/amphion/vpu_core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/platform/amphion/vpu_core.h b/drivers/media/platform/amphion/vpu_core.h
index 00a662997da4..65b562642603 100644
--- a/drivers/media/platform/amphion/vpu_core.h
+++ b/drivers/media/platform/amphion/vpu_core.h
@@ -11,5 +11,6 @@ u32 csr_readl(struct vpu_core *core, u32 reg);
int vpu_alloc_dma(struct vpu_core *core, struct vpu_buffer *buf);
void vpu_free_dma(struct vpu_buffer *buf);
struct vpu_inst *vpu_core_find_instance(struct vpu_core *core, u32 index);
+void vpu_core_set_state(struct vpu_core *core, enum vpu_core_state state);
#endif