media: venus: Limit HFI sessions to the maximum supported
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Fri, 4 Dec 2020 10:01:37 +0000 (11:01 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 13 Jan 2021 08:06:17 +0000 (09:06 +0100)
commit20891170f339a8754312a877f3d17f0e5dadd599
tree087fa77a444163b2d9288702231a1c958dc245af
parent5f2ca73dcca96c3de96a0e4d9ea24ebb46c55d2e
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>
drivers/media/platform/qcom/venus/core.h
drivers/media/platform/qcom/venus/hfi.c
drivers/media/platform/qcom/venus/hfi_parser.c