Commit grafiek

155 Commits

Auteur SHA1 Bericht Datum
Govindaraj Rajagopal
0fde3a9aca video: driver: fix static and dynamic property setting sequence
Added changes to reuse caps_list for setting static properties
and also modified dynamic property setting sequence. Removed
redundant implementations.

Change-Id: I5829d3c98b0159916d7794f43e445a6191050182
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-18 18:20:39 +05:30
Akshata Sahukar
22cc24de7f video: driver: Enhance fence support
- Introduce V4L2_EVENT_VIDC_METADATA to post fence fd returned in
  ETB metadata done buffer.
- V4L2_CID_MPEG_VIDC_SW_FENCE_FD g_ctrl support for client to get
  fence fd for requested fence id.
- Addition of fence delivery and subscribtion support.
- Fence property packetization to send to firmware via FTB buffer.

Change-Id: Ifb289849e352af2c4729aa95040bd83753979970
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-17 13:16:53 -08:00
Govindaraj Rajagopal
93b88b9d69 video: driver: re-organize enums and add comments
Re-organized enums(msm_vidc_inst_capability_type) in below
order.

[1] Root(no parents) enums,
[2] Intermittent(having both parents & children) enums,
[3] Leaf(no children) enums.

Also added proper comments in header file.

Change-Id: I2bda51b54b6fa6e190098f16dd60090004cfbecf
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-17 10:33:11 -08:00
Akshata Sahukar
0a5549a6a9 video: driver: decouple fence structure from video buffer
Decouple fence structure from video buffer. Also add some
misc fence flow setup support.

Change-Id: Ia4e223a3a288f0dae3238850685f3a73d4b9400a
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-14 09:46:11 -08:00
qctecmdr
fe6594bcce Merge "video: driver: add support to send input meta buffer via request" 2022-02-07 20:52:22 -08:00
Darshana Patil
9978dc376e video: driver: add support to send input meta buffer via request
Client can enable V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE
control and send input metadata buffer via request.

Change-Id: Icccdada8253d1d0291c01e2e539968141f7ddd2c
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-04 13:47:34 -08:00
qctecmdr
dc71b3eaf1 Merge "video: driver: misc video changes" 2022-02-03 14:48:53 -08:00
Maheshwar Ajja
ef829ce44f video: driver: add fence support
Add fence support for decoder output buffers for
the consumer to use it to improve latency.

Change-Id: I7384b4a9793248988a2d2d546a535f26636d5bb3
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-02-02 21:43:52 -08:00
Govindaraj Rajagopal
0ba80e3956 video: driver: misc video changes
[1] Remove CAP_FLAG_ROOT flag. Root willbe identified
    with has_parents() api.
[2] Replace field(struct msm_vidc_inst_cap) cap -> cap_id.
[3] Rename below pool apis.
    msm_memory_alloc    -> msm_memory_pool_alloc
	msm_memory_free     -> msm_memory_pool_free
[4] Remove struct msm_vidc_inst_cap_entry usage in inst.
	inst->firmware.list -> inst->firmware_list
	inst->children.list -> inst->children_list
[5] Organize msm_vidc_inst_capability_type enums in such
    a way that all parents placed first then children. It
	will save CPU cycles while preparing caps_list.

Change-Id: I376f4e6ddec37ce326c393fba133e19ba70bab09
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-03 09:58:19 +05:30
Mihir Ganu
9bacc5d124 video: driver: Add HFI and internal buffer changes for AV1 DRAP
Add changes for AV1 DRAP (Delayed Random Access Point) handling:
1) Add config in kalama database to control DRAP and the HFI property
to set DRAP config.
2) Update buffer calculations:
- When DRAP is disabled, COMV buffer must be allocated
and PERSIST buffer must be allocated with total_ref_count = 0
- When DRAP is enabled, COMV buffer must not be allocated -
it is part of PERSIST buffer. Persist buffer must be allocated with
the max_width, max_height and total_ref_count configured for DRAP.

Change-Id: I2d2e8fd3f63ea8f9fc2845acd0b4e16ba4776a6b
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2022-02-01 15:32:01 -08:00
Darshana Patil
dce0ce7996 video: driver: add input metadata fd control
Added an extension to allow client to send
input metadata buffer fd via request api.

Change-Id: I8e05e53512b3f5dd31fa16ea64ee5d97ef2de7b4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-01-28 13:14:31 -08:00
Darshana Patil
acc83ca211 video: driver: request api changes for dynamic controls
- Request api allows to synchronize controls along
  with buffers.
- Client allocates a request fd. This request fd is
  associated with control and set using s_ext_ctrls.
  Such controls are stored by the framework and not
  applied immediately.
- Request fd is also associated with input qbuf and
  queued to driver. Following this actual request is
  queued. Buffers do not enter the queue untill the
  request is queued.
- As part of qbuf, driver call request_setup() which
  inturn sets the control to driver.

Change-Id: I316c4dc2a0091b21059230be5ee5fd6379259456
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-01-27 15:02:27 -08:00
Govindaraj Rajagopal
1e55de3d4a video: driver: add support for timestamp reorder
Added support for timestamp reorder. It is default
disabled.

Change-Id: I51a6fc785860081b651fc67f443132cb2675b9fd
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
60c04ed08d video: driver: enable session stability testing
Enable session stability test support.

Clients can trigger session stability through debugfs as follows:
echo <trigger_val> > /d/msm_vidc/core/trigger_stability
u64 trigger_val provides:
    <payload><sub_client_id><stability_type>
    stability_type : 0-3 bits(one of the HFI_STABILITY_TYPE_*)
    sub_client_id  : 4-7 bits(1 - CCE, 2 - VSP, 3 - VPP, 4 - CPUSS)
    reserved       : 8-31 bits(Not used)
    payload        : 32-63 bits(depends on stability_type)

For e.x, to VCODEC_HUNG on CCE hardware module for 5 consequtive frames.
adb shell "echo 0x500000011 > /d/msm_vidc/core/trigger_stability".

Change-Id: I604f0430e3ab905504c4f0b7c84b157a5d464958
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
6e916441fc video: driver: Removed unused macro and variable
- Removed unused macro
- Removed unsed constant variable.

Change-Id: I43ff39d498637fb0aa721660fae0ca3dd7073e88
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Priyanka Gujjula
a646e75752 video-driver: Optimize enc o/p buffer size
Allocate YUV_size * 2 for <=360p

Change-Id: I5c7b4ad2d2accf40943e880562f96af2d7c81509
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2022-01-13 17:29:22 +05:30
Mihir Ganu
1b5a6b1d6f video: driver: Add support for AV1 dynamic frame resolution change
AV1 bitstream frames can have different resolutions than
sequence resolutions. Subscribe to BITSTREAM_RESOLUTION and
CROP_OFFSETS metadatas and exopose them to clients so that
clients can receive per-frame resolution and crop.

Change-Id: I7c0503f25ddde201979d13ff18028681f685d649
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-17 10:58:35 -08:00
Mihir Ganu
04304a466f video: driver: Add changes to enable AV1 Decoder
Add definitions, controls and codec-specific handling
to enable AV1 Decoder.

Change-Id: Ica2f4e298e43aa713188d3374f8705688d0ed912
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
2021-12-09 16:59:23 -08:00
Chinmay Sawarkar
1068661f6d video: driver: Fix dma_buf_vmap arguments
New dma_buf_vmap api takes dma_buf_map struct as argument,
instead of kvaddr.

Change-Id: I2843a28b2c0c2de2d9cd1bfa96fb1a86ffba6059
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2021-12-06 09:47:16 -08:00
Praveen Chavan
53d5efcd7c Merge branch 'video-kernel-waipio.lnx.1.0' into kailua_1.0 2021-11-29 13:38:02 -08:00
Mahesh Kumar Sharma
767c8ad13d video: driver: Fix dlkm compilation
1.) New dma_buf_vmap() returns SUCCESS or FAIL unlike legacy dma_buf_vmap()
    which return type is vmap address. dma_buf_vmap() takes two arguments now.
    Now it returns vmap address in pointer passed as second argument.
2.) If defined, use V4L2_CTRL_CLASS_CODEC else use V4L2_CTRL_CLASS_MPEG.
3.) iommu_dma_enable_best_fit_algo is commented temporary.
4.) remove subsystem_resart.h

Change-Id: I73c6a840fa6028f021debff33b88178ac74dcef9
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
2021-11-03 16:32:50 -07:00
Priyanka Gujjula
e786da48eb video: driver: Use max fps from inst caps
Use maximum framerate from published
instance caps to make it platform
agnostic.

Change-Id: I319768e722774969287abb9e782ddbece7593ff9
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-25 21:38:58 +05:30
Priyanka Gujjula
4970193ad1 video-driver: add mmrm query support
[1] Disable MMRM if platform feature
    does not support.
[2] Query for scaling support from
    mmrm driver and enable/disable
    based on queried support
    accordingly.

Change-Id: I34cf9a9e150b0823828507e3f5d680aae6eb14d4
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
2021-10-21 23:16:13 +05:30
Darshana Patil
fc6c35e8de video: driver: add all intra encoding support
add ALL_INTRA database entry and its dependencies.
implement adjust functions.

Change-Id: Ib4522666b6c2ef7dcb5adf9110a2fd5d2daf4654
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-10-04 10:40:32 -07:00
Akshata Sahukar
e2ec45b2e0 video: driver: reject 7th VP9 decoder session
reject 7th VP9 decoder session.

Change-Id: I2b739be0aff5492bd10d00c3068aa44e0895ee09
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-09-16 16:06:59 -07:00
Gaviraju Doddabettahalli Bettegowda
9110a87846 video: driver: Update msm_vidc statistics delay from command-line
Currently, statistics is printing for every 2 second
And these delay is hardcoded.
So changes added to update the statistics delay from the command-line.

- adb shell "echo 200 > /d/msm_vidc/core/stats_delay_ms"
- adb shell cat /d/msm_vidc/core/stats_delay_ms

Use above command to update & read statistics delay.

Change-Id: I523a870203ee460d1dba8208b798f28253407e73
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
2021-09-09 11:24:23 +05:30
qctecmdr
404bc1d0cb Merge "video: driver: allow two 8k sessions support" 2021-08-27 10:01:26 -07:00
Darshana Patil
e17abd45c1 video: driver: limit max number of sessions based on resolution
add checks to limit max number of sessions supported based on
resolution.
max number of 720P sessions: 16
max number of 1080P sessions: 8
max number of 4K sessions: 4
max number of 8K sessions: 2

Change-Id: I2a784a0d28ba050923bdc7f42a21ee9801d01d86
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-26 15:51:34 -07:00
Darshana Patil
b965b9307f video: driver: allow two 8k sessions support
Allow one 8k + one 4k realtime sessions.
Maximum allow two 8K sessions which includes RT and NRT sessions.

Change-Id: I68acfc4942c5c930bed7d9584cd82f2667010136
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-26 15:51:23 -07:00
Chandrakant I Viraktamath
a626d5c731 video: driver: Add checks for fw configured session params
Query final values of session params like stage,
pipe and quality mode from FW and check if they
are the same intended values as configured by
the driver.

Change-Id: I1a504401a599860ab971e34e1e184e67631d6120
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
2021-08-13 13:17:56 +05:30
Darshana Patil
05270719fb video: driver: add max num reorder frames support
add support for HFI_PROP_MAX_NUM_REORDER_FRAMES.
add ctrl for this metadata for avc and hevc.

Change-Id: I9a7b95f130e58f810255aff23e9b605304841072
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-08-09 11:39:57 -07:00
Govindaraj Rajagopal
5c297b7d26 video: driver: print buffer statistics once at every sec
- Added change to print buffer statistics like total and avg
etb, ebd, ftb, fbd counts, client set fps, actual fps,
bitrate values in 1 sec window and these stats currently
configured to print at every 1sec boundary.
- Convert meta buffer prints to low level logs.

Change-Id: I1c93eea90fbd5460eb51bbf133c513157003d51e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-07-22 19:13:19 +05:30
Akshata Sahukar
942f406c42 video: driver: Cap chroma qp offset value other than -12 as 0
Cap chroma qp offset value other than -12 as 0.

Change-Id: I0ca9c4844ab835a9365e695f38deff90768191aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-15 10:23:02 -07:00
Akshata Sahukar
423459fcfc video: driver: enumerate color format based on preference
Enumerate supported color formats based on preference.
Compressed format should be populated first, then linear formats.

Change-Id: I82ebd9b9386098575c257b193be37e07ab476d9a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-07 15:23:07 -07:00
Govindaraj Rajagopal
659ec59888 video: driver: dump queues for system error
Add support to dump all queues(cmd, msg, dbg) as part
of handle_system_error using devcoredump framework.

Change-Id: Ia1b011a29e6bc657eb002dbba09deab62dc0b2b2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-24 17:10:17 +05:30
qctecmdr
0df7a874b9 Merge "video: driver: Add support for enc auto framerate" 2021-06-18 10:32:00 -07:00
qctecmdr
cbcb2b94fa Merge "video: driver: handle dynamic qp setting" 2021-06-17 22:15:54 -07:00
Darshana Patil
bd41af8c21 video: driver: handle dynamic qp setting
- make B and P frame QP controls as dynamic.
- enable I/P/B QP to fw as and when these
  controls are set to the driver.
- remove HEIC qp support.

Change-Id: I7f45ab0bda75df8128bbbdfcebe66c2cae208b06
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-17 18:11:55 -07:00
Priyanka Gujjula
e61b55879b video: driver: Add support for enc auto framerate
1. Calculate framerate based on buffer timestamp
2. If framerate changed and stable for 2 frames,
   update it to firmware and in driver internally.

Change-Id: I7feda86dec8fcfc1dff6defac8c15a97c1b8393e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-06-17 22:54:34 +05:30
Govindaraj Rajagopal
3e4248dfb0 video: driver: optimize buffer pool implementation
- Maintain free & busy pool to track buffers separately
- track double-free cases during msm_memory_free()
- track memory leak, by checking busy pool buffer count.
  it is expected to be zero at the end of a session.
- maintain common api's to init, alloc, free, destroy
  for all below buffer types.
    - struct msm_vidc_buffer
    - struct msm_vidc_alloc
    - struct msm_vidc_map
    - struct msm_vidc_timestamp.

Change-Id: Ib8655047c3883ea6601344661058d7a629ffd5bd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-17 17:22:06 +05:30
Akshata Sahukar
36a4971392 video: driver: Add enc vbr min quality restrictions
Do not support vbr min quality with below configs:
- HEVC 10bit
- Bitstream fps > 60
- ROI enabled/support
- HP encoding
- External Blur
- Resolution beyond 1080P.

Change-Id: I5e4a420abdd0c6fee4342c3c097684ef69bb0597
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-15 18:23:36 -07:00
Vikash Garodia
72699f7278 video: driver: Add encoder complexity to decide power mode
Client can choose to run an encode session to acheive maximum
performance rather than maximum quality.
Add the handling to configure video core accordingly for the
configured video session.
Such configuration is only applicable for non-realtime session.

Change-Id: Ife290b377c844e5b1d3be93b2509c787f8e05c59
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-10 05:43:00 -07:00
Govindaraj Rajagopal
2c0d2faefa video: driver: limit vp9 max spec to 4K@60
Added change to limit VP9 decode max spec is upto 4K@60.

Change-Id: I5939a8cf6cd227d2cced5adb3628b36493b7b1fc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-09 21:07:54 +05:30
qctecmdr
1f8bf0bd92 Merge "video: driver: modify priority level enum" 2021-06-02 15:31:22 -07:00
Darshana Patil
8d33375a96 video: driver: modify priority level enum
modify priority level enum values to set
correct values to fw.

Change-Id: Ifd33b17db58b06d281ad930f7629d9a4575d0956
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-02 12:57:06 -07:00
Govindaraj Rajagopal
a33041f799 video: driver: add scaling checks for encode session
Encoder supports downscale with scaling ratio upto 1/8 of width
and 1/8 of height. So added necessary scaling checks at streamon.

Change-Id: I3a29b43c79cf4e693ba2c0d9f98ec24410d50fbd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 11:26:12 +05:30
Govindaraj Rajagopal
b2e9fada31 video: driver: restrict image load to 16K x 16K
Add strict check in msm_vidc_check_mbpf_supported() to
reject image session, if total image load exceeds 16K.
Added msm_vidc_print_insts_info() support to print all
running instance info, if new session is rejected due
to mbpf/mbps checks.

Change-Id: I98bab985fcf4f4d20c6f263c48e0c701ec86ab6f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-31 17:11:46 +05:30
Govindaraj Rajagopal
69e6b8c0ca video: driver: fix race between streamoff and ipsc
During input port streamoff, state is changed from START_INPUT
to OPEN and then sent CMD_STOP to firmware. So reverse thread
acquired the lock and trying to process IPSC. Since IPSC is
not allowed in OPEN state, driver treats that as a fatal issue
and moves inst->state to ERROR state. Added change to avoid
above mentioned issue.

Change-Id: If0e18f01b6ecac3c810c0dab878ae392c48ffc27
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-28 11:24:52 +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
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