커밋 그래프

172 커밋

작성자 SHA1 메시지 날짜
Akshata Sahukar
b4b2a856e3 video: driver: allow main and main 10 profiles for heic enc
allow main and main 10 profiles for heic enc.

Change-Id: I5ce6f24fede3d7b2267a97a0aaf01e19e9894ba3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-26 18:57:55 -07:00
qctecmdr
a71714eae3 Merge "video: driver: tune dcvs and batching buffer count" 2021-05-26 10:07:11 -07:00
Govindaraj Rajagopal
63a42011b2 video: driver: tune dcvs and batching buffer count
[1] add dcvs cushion buffers, only if core supports dcvs
[2] update buffer_count for dcvs & batching for priority
    static control.
[3] add max_fps & max_mbpf checks to disable decode_batching.
[4] add low_latency check in msm_vidc_allow_dcvs api.

Change-Id: Iafb7ad4aa601a0a3753e30475a8709f261719b0c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-26 20:59:13 +05:30
Govindaraj Rajagopal
b0e9eab96d video: driver: treat sesion_open and session_close failure as fatal
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>
2021-05-26 12:12:32 +05:30
Darshana Patil
e5ec6843e8 video: driver: modify max mapped output count
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>
2021-05-24 16:58:19 -07:00
qctecmdr
70eb3b1a5d Merge "video: driver: reject odd resolution for encode sessions" 2021-05-21 14:19:15 -07:00
qctecmdr
db3c2f79da Merge "video: driver: Update MBPF session admission check" 2021-05-20 23:17:47 -07:00
Darshana Patil
c897e250bd video: driver: reject odd resolution for encode sessions
reject odd resolution for encode session only.

Change-Id: I197688edb9e7f40d8b43524f7423ba52bb738cc2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-20 17:46:34 -07:00
Mihir Ganu
4eda00e068 video: driver: Update MBPF session admission check
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>
2021-05-20 10:51:34 -07:00
Govindaraj Rajagopal
53578c8ec2 video: driver: fix core lock acquire and release sequence
[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>
2021-05-20 14:34:11 +05:30
Govindaraj Rajagopal
d9518d9182 video: driver: fix list usage without init
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>
2021-05-17 21:51:03 +05:30
qctecmdr
279c643900 Merge "msm: vidc: Add support of timestamps based frame rate" 2021-05-15 14:09:18 -07:00
qctecmdr
cdda26a16e Merge "video: driver: define hfi setter for configuring pipe" 2021-05-14 16:18:08 -07:00
Darshana Patil
e7c7a2fb02 video-driver: add decode QP metadata support
add v4l2 extension and necassary support for
decoder QP metadata.

Change-Id: I364ef9b7b3a63bef0a59c955018bc8456f12d03f
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-14 13:43:16 -07:00
Vikash Garodia
75ecec1bb5 video: driver: Add support dynamic low latency for decoder
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>
2021-05-14 23:47:30 +05:30
Govindaraj Rajagopal
003d8a79fa msm: vidc: Add support of timestamps based frame rate
Add timestamp based frame rate detection.

Change-Id: Id0c522e01769ea6cf214c7b84c11faae6049e2ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-12 21:50:05 +05:30
qctecmdr
992a58254f Merge "video: driver: update proper state in vb2_buffer_done" 2021-05-11 20:49:09 -07:00
qctecmdr
849dab200f Merge "video: driver: handle race condition in msm_vidc_core_init" 2021-05-11 00:44:17 -07:00
qctecmdr
4837c16676 Merge "video: driver: add frame_skip mode control setting for heic" 2021-05-10 18:11:09 -07:00
Govindaraj Rajagopal
9a7e929dfe video: driver: handle race condition in msm_vidc_core_init
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>
2021-05-10 17:20:58 +05:30
Govindaraj Rajagopal
57180ce6f2 video: driver: update proper state in vb2_buffer_done
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>
2021-05-10 10:48:15 +05:30
Qiwei Liu
2e2fbdb7e5 video: driver: support non-zero data_offset
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>
2021-05-07 07:31:39 -07:00
Govindaraj Rajagopal
0995dfc215 video: driver: add frame_skip mode control setting for heic
Added V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE support for
heic codec type.

Change-Id: I4eaca697729c45ebf72067a9d34a7dc8d607f0fa
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-07 14:21:48 +05:30
Govindaraj Rajagopal
f05007686d video: driver: add support for main10StillPic profile
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>
2021-05-06 22:09:25 +05:30
Govindaraj Rajagopal
03db3bfd7f video: driver: add check_session_supported for session admission
- 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>
2021-05-04 14:21:57 -07:00
qctecmdr
db185fcf81 Merge "video: driver: free children and firmware list memory" 2021-05-03 15:24:29 -07:00
Akshata Sahukar
ce09f77e44 video: driver: free children and firmware list memory
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>
2021-04-30 18:42:34 -07:00
Akshata Sahukar
3c72173fec video: driver: fix to allocate enc VPSS buffers in CB7
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>
2021-04-30 11:58:32 -07:00
qctecmdr
b85c9199af Merge "video: driver: refine power settings" 2021-04-27 20:34:02 -07:00
Govindaraj Rajagopal
e0637a30b8 video: driver: refine power settings
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>
2021-04-27 18:58:51 +05:30
Govindaraj Rajagopal
5a374e3ed4 video: driver: reduce output buffer count for thumbnail usecase
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>
2021-04-27 11:43:39 +05:30
Maheshwar Ajja
09356ed279 video: driver: amend delayed unmap feature
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>
2021-04-19 19:05:36 -07:00
Maheshwar Ajja
da6943c26a Revert "video: driver: refine refcount handling for release buffer"
This reverts commit bdd7a33bfb.
2021-04-19 19:03:23 -07:00
Maheshwar Ajja
ebf199bf2f Revert "video: driver: update device_addr for comparison"
This reverts commit a4905e8bfd.
2021-04-19 19:03:06 -07:00
Maheshwar Ajja
abe44a0089 Revert "video: driver: handle release during batching"
This reverts commit 0f066190b1.
2021-04-19 19:02:41 -07:00
qctecmdr
6b20be1d9b Merge "video: driver: Fix bin buffer allocation in secure usecase" 2021-04-19 15:52:57 -07:00
Darshana Patil
0f066190b1 video: driver: handle release during batching
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>
2021-04-16 22:27:02 -07:00
Chinmay Sawarkar
3964d13a63 video: driver: Fix bin buffer allocation in secure usecase
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>
2021-04-16 21:57:20 -07:00
Govindaraj Rajagopal
a4905e8bfd video: driver: update device_addr for comparison
Compare buffer with release list only after updating
buffer device_addr field.

Change-Id: Ie1c21fd9496fb4deb735938efeff61b90b96362f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-16 22:05:10 +05:30
Govindaraj Rajagopal
bdd7a33bfb video: driver: refine refcount handling for release buffer
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>
2021-04-16 14:39:18 +05:30
qctecmdr
4db216ad30 Merge "video: driver: Allow priority control in streaming state" 2021-04-15 13:26:53 -07:00
Manikanta Kanamarlapudi
8c7c63ec2d video: driver: Allow priority control in streaming state
Allow priority control in streaming state

Change-Id: I98a0983026fdb37f6a5b94fb73082032158a7743
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2021-04-15 10:53:10 -07:00
qctecmdr
18c7822b0d Merge "video: driver: add fix to avoid race condition in session close" 2021-04-15 10:21:19 -07:00
Govindaraj Rajagopal
6f281973aa video: driver: add fix to return all buffers back to client
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>
2021-04-15 20:33:16 +05:30
Govindaraj Rajagopal
3d6ff3ea8e video: driver: add fix to avoid race condition in session close
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>
2021-04-15 20:30:41 +05:30
Darshana Patil
23605ffffb video: driver: handle dpb list property
- 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>
2021-04-09 18:21:34 -07:00
qctecmdr
5fc9f66269 Merge "video: driver: Fix buffer type and region mapping" 2021-04-09 12:35:39 -07:00
Chinmay Sawarkar
29f8295bae video: driver: Fix buffer type and region mapping
Fixed incorrect mapping and restructured code for readability.

Change-Id: Iaef5e780d168883ff2cc7b243b1bf3aa094e3df2
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-04-09 10:54:14 -07:00
Akshata Sahukar
7c612dd033 video: driver: Deprecate private ctrls and use upstream ctrls
Remove private ctrl definitions, and use upstream ctrls
in source code.

Change-Id: Ib12cae5b78be69936bf0f97ca09483f5baa60350
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-08 12:10:39 -07:00
qctecmdr
c2501b7b53 Merge "video: driver: optimize thumbnail input buffer count" 2021-04-05 14:47:48 -07:00