allow main and main 10 profiles for heic enc.
Change-Id: I5ce6f24fede3d7b2267a97a0aaf01e19e9894ba3
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>
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>
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>
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>
Latency property is set to firmware during streamon output port,
if set as part of initial configuration by client.
During runtime, the property is set as and when configured by
client.
1. Make the latency property dynamic for decoder.
2. For encoder, the same gets set to firmware with regular
v4l2 set properties.
3. For decoder, set the property explicitly during streamon
output port.
Change-Id: I35990614b95e57f113ddacfc2272cad6ae0dde82
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Core is moved to init state before completing full init sequence.
So subsequent new open request assumes core is already inited and
attempts to initiate a hfi_session with firmware, which is not
correct and core_init is a sync cmd, so core->lock() is released,
so that reverse thread can issue sys_init_done. But new session is
acquiring core->lock() and corroupting core->init_done.task_list
completion structure variable i.e leading to list_corruption issues.
So added change to address these issues.
Change-Id: I0b983a06b8ea58134ea93831246309c9ccbdf0d1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
V4l2 clears buffer state related flags. So for driver errors
send state as error to avoid skipping V4L2_BUF_FLAG_ERROR
flag at v4l2 side.
Change-Id: Ifcb96d390746a71e8dbcf261f718439ef9ecfc91
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
In V4L2 definition, bytesused contains both data_offset
and actual payload size, whereas in HFI definition, data_size
only contain actual payload size after data_offset.
Add conversions to correctly support non-zero data_offset.
Change-Id: Ib581e942e39e0adbb673c53d1b31e669bdb2b998
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Added support for V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10_STILL_PICTURE.
It willbe used in 10bit image encoding usecases.
Change-Id: I14877547f1f4792eefb0ea6bcecf2643627c125a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
- check total mbps is within range(including current session)
- check total mbpf is within range(including current session)
- image session:
- decode: Only non-secure allowed
- encode: check basic image_encode requirements
- wxh should be within allowed cap range
- only linear fmt
- input & output is 512 aligned
- only CQ bitrate mode
- GOP size should be zero
- b-frame count is zero
- timedelta based RC disabled
- still-pic profile for 8bit and main10 for 10bit
- interlace resolution should be less than (1920*1088)/256.
- reject odd input or output resolution
- output resolution is with in inst->cap [min, max] range.
- current session mbpf is less than inst->cap[MBPF].max
Change-Id: I81c46950a8ef5b64bf5ac94564613998b1079b52
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
To avoid memory leakage, clean children and firmware lists
at session close, error cases, and at the end of each usage.
Change-Id: I1eadbf81da207bd987c50428c0c7cf4967a8885f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Allocate VPSS buffers in venus_ns_pixel region instead of
venus_ns to avoid bitstream corruption for downscale plus
rotation usecases.
Change-Id: Iab03f23d30c8476c90e958411944db058582a9fb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Added change to address below 2 issues.
[1] buffer_counter is not getting incremented for batching usecase,
it always runs with max clk and bus votes. So moved buffer_counter
increment logic to msm_vidc_queue_buffer, so that it will be used
for all usecases.
[2] iris2 clock calculations were using core->capabilities but all
needed infos were present in inst->capabilities. So junk values from
core->capabilities was used in clock calculations and values always
shooting to highest corner.
Change-Id: I0927899244b5de2bd46d238100fdaecd78c6fe28
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Update output buffer min & extracount, if thumbnail mode is set
and also tune extracount at input psc sequence.
Change-Id: I77b28198257d127454ee3e9b2a307e1931547e8f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Due to delayed unmap feature on decoder output buffers,
refcount will become one when no one uses the buffer
in driver. In release done functonality, remove the
buffer from maps list only if refcount equal to one.
If refcount is more than one indicates the buffer is
being used, so do not remove from maps list. There are
chances that same decoder output buffer might be queued
by the client in which case we are not supposed to
unmap it from maps list in release done.
Change-Id: I69250c3efa89d77055e89770fd441af1fb50b755
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Before output buffer is queued to FW,
checking if it is pending release and refcount
accordingly. The check needs to be added just
before queueing to FW to handle batch usecase
as well.
Change-Id: I2d394b5642ed8fa916e86ebc59ea414300415fab
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
In Secure session, BIN buffer should be allocated from Secure Bitstream
region. Allocated buffer must be hypassigned using the DMA buffer
Lend call.
Change-Id: If5303e78975aab55ac7475ca3ac9f6272585a44b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Compare buffer with release list only after updating
buffer device_addr field.
Change-Id: Ie1c21fd9496fb4deb735938efeff61b90b96362f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
If current qbuf entry is already present in release buffer list,
then as part of release done, refcount will get decremented and
for current qbuf, there is 2 possibilities of outputs from fw.
FBD with RO and wo RO. So if firmware gives FBD with RO, we are
currently decrementing refcount from 1 -> 0. So mapping gets
destroyed. But firmware is still holding RO referrence and
leading to smmu fault issues. So added hadling to increment
recount by 1, if current buffer(qbuf) is already present in
release buf list.
Change-Id: Icbe8ce0b1c9b47c4450d17650b63a575e1037ce3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Allow priority control in streaming state
Change-Id: I98a0983026fdb37f6a5b94fb73082032158a7743
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
If client attempts streamoff and msm_vidc_close sequence
concurrently, then all buffers not returned back to client,
i.e leading to warnon at vb2_queue_cancel at vb2 layer.
So added change to send vb2_buffer_done at driver fd close
sequence.
Change-Id: I43d779000501907d12d5ba8e90e007bdf5b8b801
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Some clients attempt to invoke streamoff & driver fd close
(msm_vidc_close) sequence concurrently. So there might be chances
some commands willbe posted to command queue even after closing
hfi session(HFI_CMD_CLOSE) completed. So due to invalid session_id
firmware asserts.
Added change to avoid above mentioned issue and also amended minor
logging changes.
Change-Id: I2896567916cf5d18eb5b2a148efccf9bf07af3ea
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
- subscribe for dpb list property in combined
mode on output port.
- copy dpb list property payload from fw to
static array.
- using this array, mark read_only list buffers
as non-reference if not part of array. if count
of such buffers is greater than output min count,
send to fw for release.
- once fw returns them, destroy these buffers.
- unmap stale output mappings due to lazy unmap feature.
- unify release internal functions into common function.
Change-Id: Id32f04efb19eecaff453cc4383ee8296a0246263
Signed-off-by: Darshana Patil <darshana@codeaurora.org>