Commit Graph

384 Commits

Author SHA1 Message Date
qctecmdr
395e8686ec Merge "video: driver: Use max bitrate depending upon session" 2022-06-01 21:40:44 -07:00
Deepa Guthyappa Madivalara
0160053f46 video: driver: Use max bitrate depending upon session
1. Host will use HQ quality mode for all INTRA encoding case
2. Cap bitarate and bit rate boost to max bitrate of current
   session config

Change-Id: I8e8d19998ebeff992c290fbd18c072b2b93ffef2
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-06-01 11:36:14 -07:00
qctecmdr
5dc3050cce Merge "video-driver: Add support for subframe_input" 2022-05-27 13:07:50 -07:00
qctecmdr
80ff8d2af2 Merge "video: driver: enable transcode stat for decoder" 2022-05-27 00:44:21 -07:00
qctecmdr
ccb76eb0e9 Merge "video: driver: Use vzalloc instead of kzalloc" 2022-05-26 19:19:15 -07:00
Deepa Guthyappa Madivalara
13d203ba7f video: driver: Use vzalloc instead of kzalloc
kzalloc might fail to allocate physically contiguous
memory which may not be available always and hence use
vzalloc to allocate virtually contiguous memory

Change-Id: I8ad89ef107da301217f3d1ec307b9b27b4edd2de
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-05-26 15:25:26 -07:00
Darshana Patil
2a687b2750 video: driver: introduce client lock
Acquire client lock for every entry point
in driver. This is needed especially for
streamoff and close calls where inst lock
is released while driver is waiting for
stop_done and close_done responses from fw.
When inst lock is released, client can send
a new ioctl call and driver state machine
can get updated leading to unexpected behaviour.

Change-Id: Ibb62c3431c88e2f1d9088d54fe7c9e53b1c284fd
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-05-26 14:34:36 -07:00
Vedang Nagar
078aebf73a video-driver: Add support for subframe_input
Add support for 'HFI_PROP_SUBFRAME_INPUT'.
Payload '1' indicates that input buffer is
processed. However, FW expects more inputs
to construct a full YUV output buffer.
Overloading 'MSM_VIDC_BUF_FLAG_ERROR' code to
ensure HAL work completion

Change-Id: I05b24a50e587dfd96457af508267843ac3840fbf
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-05-26 20:36:45 +05:30
Mahesh Kumar Sharma
8d0a217984 video: driver: enable transcode stat for decoder
Subscribe and enable HFI_PROP_TRANSCODING_STAT_INFO property
in order to enable transcoding stat for decoder.
This stat is used further by encoder to improve encoder quality
decision for transcode case.
Ideally we want to avoid CAC-BRS multiple times for same encoded bitstream.

When user does recording (1st encode), So we have CAC enabled bitstream.
Now, if user wants to send it via some app.
So, it will be decode -> (optional GPU) -> (2nd) encode

For 2nd encode -> we would like to not apply same CAC. It needs either tuning.
But we don't have a way from bitstream to know whether it went via CAC.

This feature enables to use the stat info received from decoder to fine tune encoding.

Change-Id: Iaf640878f5554b16aad3314ba4e26f99638c43af
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-05-18 19:27:42 -07:00
Akshata Sahukar
3964fa9159 video: driver: Create and use single spin lock for dma fence
Create and use single spin lock per session (per fence context)
rather than creating spin locks per dma fence to possibly
resolve flickering in video playback.

Change-Id: I01286ae375dfedc0da26a1be4ded1bd1e02767ba
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2022-05-18 14:23:17 -07:00
Vikash Garodia
5a7898589e video: driver: keep default complexity as 50
Complexity parameter defines the encoding tools used
during an encode session. Higher the complexity implies
more quality with advance encoding tools used.
Keeping the default value as moderate or acceptable
range.

Change-Id: I3ee66d3a6612d5d60cd63a0698a4248f48ee8e2d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-05-13 09:55:40 +05:30
Mihir Ganu
2de81c4c69 video: driver: Configure UBWC stride/scanlines for AV1D
Set stride/scanline (in bytes) for UBWC color formats.
This is required to keep fixed stride/scanline during
in-sequence frame resolution changes in AV1 bitstreams.
Driver sets this property before resume/start.

Change-Id: I40526793cee36ad110f40e6ce110cda8070864d7
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-05-03 13:48:45 -07:00
Vikash Garodia
e3da5c43e2 driver: video: Add critical priority and reserve duration
Critical priority - A video session which is prioritized above
all concurrent sessions. Such sessions have low latencies and
at the same time they cannot be rejected due to overload.
Reserve duration - Duration by which a session reserves the
video hardware for processing frames from that session.
Both the above aspects are implemented with these changes.

Change-Id: I58aef5f239e5ee106201d6819d2228784f0f0ad0
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2022-05-02 11:17:18 +05:30
Akshata Sahukar
91f3bc9ab7 video: driver: fix invalid output buffer tag receipt in fence usecase
When fence is enabled, output buffer tag is sent to fw via
output metadata buffer. Since fw relies on bytesused field of
output metadata buffer to invalidate cache and perform read operation,
output metadata buffer's filled length cannot be zero.
Hence set valid size for bytesused field to fix this issue.

Change-Id: I7bd87ec49508402d2d654095f06e75992771c39d
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-04-29 20:00:28 -07:00
qctecmdr
57b55c5c22 Merge "video: driver: Add support for slice encode delivery" 2022-04-29 15:44:27 -07:00
qctecmdr
cf5a48074b Merge "video: driver: introduce metadata size macro" 2022-04-29 13:19:19 -07:00
Chandrakant I Viraktamath
308499361d video: driver: Add support for slice encode delivery
Add support to enable slice encode delivery for
HEVC and AVC codec. Basically in this mode, each
encoded slice is given as a separate FBD to the client.

Change-Id: Ia30fde9abaf2b38fb486113807fbb7f19110225c
Signed-off-by: Chandrakant I Viraktamath <quic_civirakt@quicinc.com>
2022-04-29 22:18:06 +05:30
Mahesh Kumar Sharma
a079cc43f3 video: driver: preprocessing pass required additional cycles and bw
Encoder preprocessing feature requires additional cycles
and bw to support this feature if it is enabled.

Change-Id: I46de42dd0cb0d5a7cd9fdf00beeaefd50e40798e
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-04-28 17:02:55 -07:00
Darshana Patil
808cebd0b4 video: driver: introduce metadata size macro
introduce encode input and output metadata
size macro in the interface file.

Change-Id: I40776018c5c3278d40a426c2afde4d56e90066e2
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-04-28 14:36:19 -07:00
Akshata Sahukar
047ed11bf7 video: driver: add restrictions for dec fence enablement
- Allow dec sw fence enablement only if decode order is set and
 non interlace type session.
- Enable low latency mode if sw fence is enabled.
- Signal fence if FBD length > 0.

Change-Id: Ib59c2de51f621b796e68fe2aba68d9fca3ff4272
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-04-26 13:28:13 -07:00
Deepa Guthyappa Madivalara
59b8019b9d video: driver: amend priorities to allow more sessions
1. adjust client set non-realtime priroty with NRT_PRIORITY_OFFSET (2)
2. if total mbps is more than max_mbps
    a. allow encode session by reducing decoder sessions priority by 1
    b. allow decode session by moving it to non-realtime session
        in order to not disturb the ongoing sessions

Change-Id: I96fd2ac75c123d681982fb9a2c06ac51d15bd59a
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-22 11:55:29 -07:00
qctecmdr
e7a0e95217 Merge "video: driver: add macros for kernel space logs" 2022-04-14 18:23:36 -07:00
Deepa Guthyappa Madivalara
7e9d5106f6 video: driver: add macros for kernel space logs
adding kernel space logs used by post processing
scripts as macros to avoid changes in them.

Change-Id: Iea0fb0514c134767f063902ff98fd756898ef7c4
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-14 15:06:12 -07:00
Akshata Sahukar
ae362a4130 video: driver: Set 1 stage for Byte based Slice mode
Set 1 stage for Byte based Slice mode.

Change-Id: I9924535234e202e83d6f33b03ebc7de578e7aa48
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2022-04-08 22:02:14 -07:00
Mahesh Kumar Sharma
508f4a0282 video: driver: inline preprocessing improvement
For VPSS, FW requests more bandwidth from HW.
In order to support inline processing, FW introduced
request preprcess property.

Enble this property only when following conditions are met:
- CAC-BRS is required
- don't have EVA stats.
- Upto 4k@60 fps, max( frame rate, operating rate) <= 60

Change-Id: I3cf83483d9320e5dfe20617b37a54b9d5fbcffd8
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-04-08 18:52:52 -07:00
Darshana Patil
2d69ee17ae video: driver: remove support of s_parm/g_parm for decoder
remove support of s_parm/g_parm for decoder

Change-Id: I5b35b33610eb96bbfc26181c8c249316ee65b31b
2022-04-07 15:27:43 -07:00
Deepa Guthyappa Madivalara
fdef18ef50 video driver: remove session priority handling
1. Removes depenceny of priority from frame rate
    and operating rate.
2. Removes changing priority from s_param

Change-Id: Iec51173eab5a3d59b841315549d1420df422d37f
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-06 09:22:38 -07:00
qctecmdr
3183f5831b Merge "video: driver: keep all platform common api in a single file" 2022-04-01 11:33:47 -07:00
Ankush Mitra
6d48bb4854 video: driver: keep all platform common api in a single file
update msm_vidc_platform.c to keep all common API's
and macro's in a single file to avoid redundancy.

Change-Id: I43869f54514ab8c531b6e27b84ce0a6c1f1806ce
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-04-01 01:29:40 -07:00
Dikshita Agarwal
8f0e12cc93 video: driver: add support for cyclic intra refresh
Currently driver supports only random intra refresh, extend
it to support cyclic intra refresh too.
Cyclic intra refresh is supported dynamically as well.
- If intra refresh type is set and num of LCU’s to be refreshed
  are non-zero before session start, intra refresh will be enabled
  throughout the session.
  Any further dynamic settings in the number of LCU’s including 0
  will be honored accordingly.
- If intra refresh type is set and num of LCU’s to be refreshed are zero
  before session start, intra refresh will be disabled.
  When client sets it to non-zero value dynamically, driver will set
  HFI_PROP_REQUEST_SYNC_FRAME with
  HFI_SYNC_FRAME_REQUEST_WITH_PREFIX_SEQ_HDR.
  Driver needs to send HFI_PROP_REQUEST_SYNC_FRAME only at time of
  CIR Enable, no need to send at time of disable/enable again.

Change-Id: I10a2fb22d131353721ee658213ed807ce0794009
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-04-01 11:08:19 +05:30
Akshata Sahukar
0abd877e95 video: driver: fix for fence support
- Add METADATA_PICTURE_TYPE support.
- some fixes for fence support.

Change-Id: Icd2285aa9fef57775122e9d2433f1e5d708ccdd3
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-31 16:43:00 -07:00
qctecmdr
f1918f5314 Merge "video driver: calculate power based on max rate" 2022-03-31 07:49:35 -07:00
qctecmdr
812f40eff9 Merge "video: driver: use custom v4l2 ctrls in place of S/G_PARM on decoder" 2022-03-30 15:32:02 -07:00
Deepa Guthyappa Madivalara
ab684e15f6 video driver: calculate power based on max rate
1. Remove load based admission control for decoder.
2. For decoder, use max of frame rate, operating rate,
    timestamp rate and input rate for power calculations.
3. For encoder, use max of frame rate and operating rate
    for power calculations.

Change-Id: Ibdb2d4b29438d7f656a27771953d10e0a0e72edd
2022-03-30 13:03:24 -07:00
qctecmdr
8c00483b2c Merge "video: driver: decouple min quality, CAC and quality boost" 2022-03-30 10:28:20 -07:00
Dikshita Agarwal
f60ff0d92c video: driver: use custom v4l2 ctrls in place of S/G_PARM on decoder
Introduce new v4l2 controls to set frame rate and operating rate
on decoder as VIDIOC_S/G_PARM is not allowed on decoder.

fix: v4l2-compliance:S/G_PARM

Change-Id: I6c090c0ae541a086c73bb79564dd29ed4aa755b3
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-03-29 11:45:17 -07:00
Darshana Patil
accb365696 video: driver: v4l2 compliance fixes for test formats
v4l2 compliance fixes for test formats

fixes:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK

Change-Id: I23c193ab5785bb10d070fa3085678d9669f53a92
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-03-28 11:58:06 -07:00
Manikanta Kanamarlapudi
ab51846ea0 video-driver: Add support for saliency metadata
Add support for saliency metadata control.

Change-Id: I6bfe54f58494a8189484bfbb3c2d989010fe3a2b
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
2022-03-24 23:35:33 +05:30
Mahesh Kumar Sharma
5ae6ad83d2 video: driver: decouple min quality, CAC and quality boost
Remove dependency between min quality, CAC and quality boost.
Accept quality boost value from client and if client did not
set then enable max quality boost upto 4k@60fps and disable after that.

Change-Id: I0685065b8dee8754aff2cf5f176a2f40e9e080dd
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
2022-03-23 19:20:20 -07:00
Akshata Sahukar
8ac3cc7120 video: driver: Change v4l2 metadata controls to BITMASK type
Change v4l2 metadata controls to V4L2_CTRL_TYPE_BITMASK type

Change-Id: I7f19b5dbf268351d368d9824cb52569e60116ebb
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-23 14:54:09 -07:00
qctecmdr
2e1a127d25 Merge "video driver: calculate power based on input queuing rate" 2022-03-22 19:08:47 -07:00
Deepa Guthyappa Madivalara
dc38176276 video driver: calculate power based on input queuing rate
Use client input buffer queuing rate for power
calculations for non-realtime sessions

Change-Id: I498422ba1ae9ae96b782a2096dc0cd0aa7b05798
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-03-22 14:21:35 -07:00
qctecmdr
1cc8fd9df1 Merge "video: driver: Enable bitwise operations for metadata controls" 2022-03-19 21:19:38 -07:00
qctecmdr
b5824aaaa4 Merge "video: driver: Add support for AV1D IBC feature" 2022-03-18 15:47:43 -07:00
Akshata Sahukar
d85f112d92 video: driver: Enable bitwise operations for metadata controls
Enable bitwise operations for metadata controls with below
mentioned bit definitions:
- ENABLE (BIT 0): Enable metadata.
- TX_INP (BIT 1): Client transfers metadata in input port.
- TX_OUT (BIT 2): Client transfers metadata in output port.
- RX_INP (BIT 3): Client receives metadata in input port.
- RX_OUT (BIT 4): Client receives metadata in output port.

Change-Id: Ie3d720528a383632c7766a5ccb09cead0f6b9428
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-18 13:26:00 -07:00
qctecmdr
964a9fed8c Merge "video: driver: fix streamon deadlock issue" 2022-03-17 09:44:27 -07:00
Mihir Ganu
96358cee7d video: driver: Add support for AV1D IBC feature
Add support for AV1D Intra-Block Copy (IBC) feature. This requires a
dedicated internal buffer (HFI_BUFFER_IBC_AV1D), which was previously
part of LINE buffer. A new internal buffer type called
HFI_BUFFER_PARTIAL_DATA is introduced, and this buffer type holds
HFI_BUFFER_IBC_AV1D for AV1D. HFI_BUFFER_PARTIAL_DATA is mapped to
NON_SECURE_PIXEL context bank for non-secure and to SECURE_PIXEL
context bank for secure use case.

Change-Id: If7ae22495f9981f275d54acc342c25ccdfc0c7b9
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-03-16 16:48:08 -07:00
Renjiang Han
743df51b4b video: driver: ts_reorder for negative timestamps
The timestamp in the driver is stored in the U64 type, but if there
is a negative value in the timestamp and the timestamp needs to be
sorted, using the timestamp value directly to compare the size is to
use the U64 type, which will turn the negative timestamp value into
a very large positive timestamp value, resulting in the sorting
result of timestamp is incorrect.

Change-Id: I13ccdb2c0c4d7b4e32999c5e88092c636c1f0b69
Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
2022-03-15 19:51:05 +08:00
Darshana Patil
eef358cf9c video: driver: request api fixes for v4l2-compliance
- add support for prepare_buf
- check if client has configured invalid fd for metadata
  buffer fd control.

Change-Id: I576d02be05e4692a5ab45286895c34284f08651c
Signed-off-by: Darshana Patil <darshana@quicinc.com>
2022-03-14 16:44:15 -07:00
Govindaraj Rajagopal
4f1180f1a6 video: driver: handle static and dynamic properties for decoder
Added change at decoder side to use adjust/set functions for
static(streamon) and dynamic(s_ctrl) cases.

Change-Id: I3d8c32baaf2fa2c3a077cc936a8ff2159ababfe3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-03-08 19:46:05 +05:30