summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/qcom/venus/hfi_parser.c
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2020-12-04 11:01:37 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-13 09:06:17 +0100
commit20891170f339a8754312a877f3d17f0e5dadd599 (patch)
tree087fa77a444163b2d9288702231a1c958dc245af /drivers/media/platform/qcom/venus/hfi_parser.c
parent5f2ca73dcca96c3de96a0e4d9ea24ebb46c55d2e (diff)
downloadlinux-stable-20891170f339a8754312a877f3d17f0e5dadd599.tar.gz
linux-stable-20891170f339a8754312a877f3d17f0e5dadd599.tar.bz2
linux-stable-20891170f339a8754312a877f3d17f0e5dadd599.zip
media: venus: Limit HFI sessions to the maximum supported
Currently we rely on firmware to return error when we reach the maximum supported number of sessions. But this errors are happened at reqbuf time which is a bit later. The more reasonable way looks like is to return the error on driver open. To achieve that modify hfi_session_create to return error when we reach maximum count of sessions and thus refuse open. Tested-by: Fritz Koenig <frkoenig@chromium.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/venus/hfi_parser.c')
-rw-r--r--drivers/media/platform/qcom/venus/hfi_parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
index 363ee2a65453..52898633a8e6 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.c
+++ b/drivers/media/platform/qcom/venus/hfi_parser.c
@@ -276,6 +276,9 @@ u32 hfi_parser(struct venus_core *core, struct venus_inst *inst, void *buf,
words_count--;
}
+ if (!core->max_sessions_supported)
+ core->max_sessions_supported = MAX_SESSIONS;
+
parser_fini(inst, codecs, domain);
return HFI_ERR_NONE;