Occationally when multiple sessions are waiting for firmware
response and at the same time if there was a system error
received which will deinitalize the core and remove all sessions
from core list. If client opened new session which will initialize
the core and start the new session. As there will be no response
for old sessions, eventually, they will timeout and try to deinitialize
the core which will reset new session also which is not correct.
So check if timed out session is valid (present in core list) before
deintializing the core from timeout session.
This change also addresses below race condition issue -
If client is opening multiple new sessions and multiple old sessions
are also timedout at the same time and all are waiting for core lock
to be acquired. The new session does init_completion(&core->init_done);
and release core lock before waiting for completion event. As core lock
was released the timed out session will acquire the core lock and deinit
the core and release core lock. As core was deinited, another new session
will do init_completion(&core->init_done); on which the previous session
was waiting for completion event. doing init_completion again on an
already waiting completion event will result in list corruption issues.
Change-Id: I94766ead8b3ecad7d0b87f4b999608f435d0cee2
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
For decoder, reject unsupported session during output
port streamon.
Change-Id: I048bf86cce1357a8db6c4ed5fc15508db1382916
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
[1] Irrespective of layer encoding type P or B, always
caliberate gop size to have gop size multiple
of sub gop size.
[2] Do not cap enh layer count value to max 1 value when
cvp is disabled.
Change-Id: I10f602202ce007707c0fee76d9f847db70798754
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
do core_deinit for sesion_open and session_close failures, to
handle recurring clock prepare failure.
Change-Id: I1c305f9e6269f7176b8283dbe91712f9e31448f5
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
min VBV delay value supported is changed from 100 to 200
in firmware. Pick up the change in driver.
Change-Id: I200bdd4c35aa463d64baee0fa2ca330dc1eb0ad2
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Existing video driver expects session priority to be set
explicitly during static configuration. CAP_ROOT is not
enabled for decoders, hence explicit setting is needed.
Change-Id: Id754b38f15e9e045d31797557a4a7aa7a296346e
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
adjust MAX_MAP_OUTPUT_COUNT based on resolution
to enhance performance and reduce memory pressure.
- For 8K session: count = 20
- For 4K session: count = 32
- For 1080p session: count = 48
- For all remaining sessions: count = 64
reduce MAX_DPB_COUNT to 32.
reduce DEFAULT_MAX_HOST_BUF_COUNT to 64.
Change-Id: I0e6d25121947524b843e9cce96b75871aba174af
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Use u32 instead of int to avoid interger overflow.
Change-Id: I4e2971a11074539d49d612a9ef1bda0502970afa
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Do not unmap buffers when firmware sends release
done. Only delete these buffers from release list.
Unmap buffers when removing stale entries from
mappings list.
update max dpb count to 32 and host buf count to 128.
Change-Id: I71fc3f722f068d8f2eeeb81041d4e495092c254f
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Driver would allow clients to set any value for rate during
static state. In dynamic state, if the rate value is such
that it crosses the maximum supported load, the setting
is rejeceted. Again the rejection is only for realtime session.
Change-Id: Iaeb786243fe4ca61f9e6f671a24a09dc98eaabfa
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
added condition that a buffer should not be present
in release list while removing excessive mappings.
Change-Id: Ib74396ab20720399f4a077fbbc23b97f11f439d7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Update session admission check to enforce max MBPF limit
by considering both realtime and non-realtime sessions.
Change-Id: I2556a6d7e4220f3151406febef3f0ebde9b4a20b
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
[1] Added return type to strict_check() api and bail out if
strict_check fails.
[2] Fix all the failures with #1.
[3] Added WARN_ON() for strict_check failure.
[4] Ensured &core->lock is acquired before calling below api's.
- __write_register
- __write_register_masked
- __iface_cmdq_write_relaxed
- __suspend
- __resume
- venus_hfi_core_init
- venus_hfi_core_deinit.
Change-Id: I7f0a3ca6c2aec2758220c90bff9260367f10820b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
In low latency mode, for a decode session, low latency
is being configured properly. But the log still indicates
that low latency is not enabled. The change fixes the same.
Change-Id: I65a88fb6dff639dd78522316e839fc05d43ec39c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Add support to honor client enablement of csc custom
matrix and set csc coeff to video firmware.
Change-Id: I14d702eb7033541aa439bebe11df7fc4aa49ffdb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
update alignment to 128 for stride in pixel
calculation for p010 color format.
Change-Id: I0fda66f06409bb9947c88a60a88a9ea8f70505a5
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
vb2 is not allowing client to pass data in output meta plane.
adjust the bytesused as client will send buffer tag metadata
in output meta plane if DPB_TAG_LIST metadata enabled.
Change-Id: I2d99d0acf559c4b92e0610d518f6cfbdd54a2c19
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Unmap only those entries with refcount 1 and
which are not present in read_only buffers
list.
Change-Id: I0bc918c3f5c1fe1a1ed62a0c16b578155a8e6d6e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
If workqueue creation fails, driver is accessing buffer lists
in session close sequence, which is not yet inited and leading
to NULL ptr dereferrence issue, while traversing uninitialized
list. So added change to avoid accessing list without init
completion.
Change-Id: Icb3aa6b7edaf27e73873ec289d6a921a2613e77e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Add index check in enum fmt call and add the missing
break statement in handle_session_property.
Change-Id: Ida294f9ad4b8fa5c86d73b0e5bbd5297d8dbcd1b
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Deprecate custom pipe setting and use the hfi setter
to configure it alongwith other configurations.
Change-Id: Iffbd25df89f43cf77c1fa85ffa97601a31998410
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>