Commit Graph

468 Commits

Author SHA1 Message Date
qctecmdr
f7485924fd Merge "video: driver: reject unsupported resolution in output streamon" 2021-05-26 22:06:37 -07:00
qctecmdr
6229c69253 Merge "video: driver: deinit core from a valid session only" 2021-05-26 20:51:39 -07:00
qctecmdr
337953d000 Merge "video: driver: Add missing H264 levels" 2021-05-26 19:50:13 -07:00
Maheshwar Ajja
d0af60e008 video: driver: deinit core from a valid session only
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>
2021-05-26 18:18:44 -07:00
Darshana Patil
4e5c57950d video: driver: reject unsupported resolution in output streamon
For decoder, reject unsupported session during output
port streamon.

Change-Id: I048bf86cce1357a8db6c4ed5fc15508db1382916
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-26 16:02:11 -07:00
Akshata Sahukar
6e9150c232 video: driver: Enable low latency mode for CBR rc type
Enable low latency mode for CBR rc type.

Change-Id: I80230e5d2acab94820b1401ffa6e6fe372398397
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-26 13:42:17 -07:00
Akshata Sahukar
b35579ad54 video: driver: always caliberate gop size
[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>
2021-05-26 11:47:40 -07:00
Mihir Ganu
9c7b878359 video: driver: Add missing H264 levels
Add the missing H264 levels supported currently.

Change-Id: Iea071aef46ea6be6f6f10c3a799b7f8aba26c08f
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-26 11:31:10 -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
qctecmdr
421d199f44 Merge "video: driver: modify VBV delay min value to 200" 2021-05-25 22:23:22 -07:00
qctecmdr
6bd6a4e1b8 Merge "driver: waipio: set static priority configuration to firmware" 2021-05-25 21:01:15 -07:00
Akshata Sahukar
079b161c66 video: driver: modify VBV delay min value to 200
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>
2021-05-25 19:02:29 -07:00
Vikash Garodia
252625c6d0 driver: waipio: set static priority configuration to firmware
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>
2021-05-25 16:59:26 +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
Mihir Ganu
702fe54c21 video: driver: Always raise interrupt request
Skip optimizations in read/write queues and always
raise interrupt request.

Change-Id: I36457e92f0a54b73af6d20748c9bb50bccdd6610
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-24 14:21:38 -07:00
Maheshwar Ajja
4e4e404c32 video: driver: avoid integer overflow issue
Use u32 instead of int to avoid interger overflow.

Change-Id: I4e2971a11074539d49d612a9ef1bda0502970afa
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-05-21 19:04:33 -07:00
Akshata Sahukar
e54ba4a130 video: driver: Align hfi buffer macro file with CL: 30790445
Remove SE stats Buffer calculation to align hfi buffer macro file
with CL: 30790445.

Change-Id: Ia5db786e5ba1fddafe6c25555b3f45ea915b389e
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-21 16:18:45 -07:00
qctecmdr
70eb3b1a5d Merge "video: driver: reject odd resolution for encode sessions" 2021-05-21 14:19:15 -07:00
qctecmdr
173b9f8b09 Merge "driver: waipio: allow higher fps rate" 2021-05-21 14:19:15 -07:00
Darshana Patil
d538a9ff99 video: driver: optimise release buffer function
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>
2021-05-21 17:44:17 +05:30
qctecmdr
502487ee71 Merge "video: driver: printk fault from __load_fw_to_memory" 2021-05-21 02:55:23 -07:00
Vikash Garodia
edce8f49c9 driver: waipio: allow higher fps rate
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>
2021-05-21 15:07:46 +05:30
qctecmdr
3353bfaa62 Merge "video: driver: update removable buffer condition" 2021-05-21 01:15:17 -07:00
qctecmdr
db3c2f79da Merge "video: driver: Update MBPF session admission check" 2021-05-20 23:17:47 -07:00
qctecmdr
a4038a8565 Merge "video: driver: fix core lock acquire and release sequence" 2021-05-20 18:12:48 -07:00
Darshana Patil
2fa47b832d video: driver: printk fault from __load_fw_to_memory
fix printk fault from __load_fw_to_memory.

Change-Id: I50a8594f99b478cb5e9d6859c2212afd238cf1e8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-20 17:49:42 -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
qctecmdr
1b620d866b Merge "waipio: driver: Fix decoder log during low latency" 2021-05-20 15:17:18 -07:00
Darshana Patil
ec5c6643a3 video: driver: update removable buffer condition
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>
2021-05-20 11:05:56 -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
7f084e9a18 video: driver: add additional profile support for image session
Added main & main10 profile support for HEIC image session.

Change-Id: I738c6e55c361bdccac7c4d1165abcf9363d80eb7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-20 16:27:15 +05:30
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
Vikash Garodia
cc037ae3de waipio: driver: Fix decoder log during low latency
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>
2021-05-20 10:08:50 +05:30
Akshata Sahukar
945883602d video: driver: add support to set csc coefficients
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>
2021-05-19 17:17:01 -07:00
Darshana Patil
6a6a3cba5c video: driver: update alignment for p010
update alignment to 128 for stride in  pixel
calculation for p010 color format.

Change-Id: I0fda66f06409bb9947c88a60a88a9ea8f70505a5
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-05-18 12:41:51 -07:00
qctecmdr
c3bed56c94 Merge "video: driver: modify bytesused if DPB tag list enabled" 2021-05-17 21:49:01 -07:00
qctecmdr
0287f0d1f4 Merge "video: driver: modify unmap excess mappings" 2021-05-17 21:49:01 -07:00
Darshana Patil
cad8267eca video: driver: modify bytesused if DPB tag list enabled
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>
2021-05-17 18:43:37 -07:00
Darshana Patil
da09aa48ed video: driver: modify unmap excess mappings
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>
2021-05-17 17:15:29 -07:00
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
288887b59d Merge "video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes" 2021-05-15 14:39:13 -07:00
qctecmdr
279c643900 Merge "msm: vidc: Add support of timestamps based frame rate" 2021-05-15 14:09:18 -07:00
qctecmdr
76b516e7e6 Merge "video: driver: Add index check in enum format" 2021-05-14 21:48:57 -07:00
Akshata Sahukar
724e5f525e video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes
[1] Update enc input min count buffers count when HB layer encoding
    is enabled.
[2] Also align hfi buffer macro file with CL: 30683524.
[3] This change also fixes VPSS buffer size mismatch issue.

Change-Id: I63d91ff204f1e11e71e3c0633b582c47c5e9b102
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-14 21:40:28 -07:00
qctecmdr
cdda26a16e Merge "video: driver: define hfi setter for configuring pipe" 2021-05-14 16:18:08 -07:00
Mihir Ganu
3f52f1e392 video: driver: Add index check in enum format
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>
2021-05-14 14:46:12 -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
90d7de5658 video: driver: define hfi setter for configuring pipe
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>
2021-05-14 23:48:15 +05:30