Commit Graph

141 Commits

Author SHA1 Message Date
Mihir Ganu
113c10c489 video: driver: Enable Subsystem Restart (SSR) testing
Enable Subsystem Restart test support.
Clients can trigger SSR through debugfs as follows:

echo <trigger_val> > /d/msm_vidc/core/trigger_ssr

u64 trigger_val provides:
  /* <test_addr><sub_client_id><ssr_type>
   * ssr_type: 0-3 bits
   * sub_client_id: 4-7 bits
   * reserved: 8-31 bits
   * test_addr: 32-63 bits */

Change-Id: If23fce3084de00461f1e5cc57884e10d15ad66a9
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-29 10:21:27 -07:00
qctecmdr
c04cf38091 Merge "video: driver: Add support to advanced bitrate ctrls" 2021-03-26 13:38:24 -07:00
Govindaraj Rajagopal
1524ddc445 video: driver: remove smmu_fault_work_handler
Remove separate fault_work_handler and print all needed
debug info as part of smmu_fault_handler callback itself,
to avoid race between fault handler invocation and core
deinit sequence.

Change-Id: Ib47e3d457a5a3e33497c71d5920382cb43baed79
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-26 16:37:52 +05:30
Akshata Sahukar
14efc2a0bc video: driver: Add support to advanced bitrate ctrls
Add support to below properties:
- HFI_PROP_BITRATE_BOOST
- HFI_PROP_CONTENT_ADAPTIVE_CODING
- HFI_PROP_MAINTAIN_MIN_QUALITY
- HFI_PROP_VBV_DELAY
- HFI_PROP_TOTAL_PEAK_BITRATE
- HFI_PROP_BITRATE_LAYERx.

Change-Id: I1072f97c7c202c7f4fc38c26e0ab9274ae06fce0
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-25 14:50:20 -07:00
qctecmdr
2bf32ad110 Merge "video: driver: add support to print noc error log registers" 2021-03-25 11:28:06 -07:00
qctecmdr
c2003a1836 Merge "video: driver: remove release of dpb buffers" 2021-03-25 10:41:25 -07:00
Govindaraj Rajagopal
a7bdc410ef video: driver: add support to print noc error log registers
Added support to print noc error log registers at below places.

- smmu_fault_handler path
- handle_system_error path.

Change-Id: I9e195bd82a2058f533df8713368e61f57b537b87
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-25 16:10:49 +05:30
Darshana Patil
74b6d67205 video: driver: remove release of dpb buffers
remove release of dpb buffers as part of start
of output port.
handle watchdog interrupt incase of page fault

Change-Id: Idaccbcaa92d4835dea2da3d8b6f645114baa338a
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-24 17:58:21 -07:00
Sebastian Dang
fb6421e3e9 video: driver: Add mmrm api
Add mmrm apis to driver.
Replace clk_set_rate with mmrm client set value.
Scale branch clock values.

Change-Id: I8ea35b668e4c7d6157c9c4f7120e6a4237cf65de
Signed-off-by: Sebastian Dang <sebastiandang@codeaurora.org>
2021-03-23 22:55:41 -07:00
qctecmdr
c07fa5dd60 Merge "video: driver: add RGBA format support" 2021-03-23 13:37:09 -07:00
Chinmay Sawarkar
7b9c3cb048 video: driver: Enable encoder input CR stats
Enable encoder input Compression Ratio (CR) stats.
Input CR stats are provided by clients for each input buffer
and used in bandwidth calculations.

Change-Id: Ibd910118837148b0b9dcc288069237f9a2d8f225
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-22 20:09:45 -07:00
Darshana Patil
48912aee84 video: driver: add RGBA format support
add RGBA and RGBA_UBWC color format support
for encoder.

Change-Id: I3e179ae9769d851afc5a6f11e1afb14d96e92073
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-22 18:12:16 -07:00
Govindaraj Rajagopal
d238d03c1b video: driver: refine image session handling
Amended below logics for image session.

- set constant quality
- set tier: V4L2_MPEG_VIDEO_HEVC_TIER_MAIN
- frame_rate: 1
- enable subframe metadata
- stage:
	- image encode: 2 stage
	- image decode: 1 stage
- pipe: 4(work_route)
- power mode: max_quality.

Change-Id: I67acd5284910e7cbe26446b5dfc526d002b98981
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-22 12:26:54 +05:30
Akshata Sahukar
7a9d3462dd video: driver: fix colorspace subscribe params initialization
Initialize subscribe params for colorspace using OUTPUT
port params and use right mapper function

Change-Id: Ie6be50c1de20e351bad0fc4b015bcc4d72d1711b
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-19 17:32:12 -07:00
Akshata Sahukar
98e799da29 video: driver: Add support to handle GOP and its dependencies
Add support to below mentioned properties:
- HFI_PROP_LAYER_ENCODING_TYPE
- HFI_PROP_LAYER_COUNT
- HFI_PROP_MAX_GOP_FRAMES
- HFI_PROP_MAX_B_FRAMES.

Change-Id: I3be975a48dc668d0ec83f6ff13837488fc570b78
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-19 12:33:27 -07:00
Darshana Patil
3dc0696b1d video: driver: enable thumbnail mode
enable thumbnail mode depending upon
the thumbnail capability in database.

Change-Id: I2f3a36ae0ee785e73a009cfc385290c983a43e29
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-16 22:25:02 -07:00
Govindaraj Rajagopal
f4045ecbd6 video: driver: enable image encode and decode support
Added change to enable image encode and decode support.

Decoder:
    - codec: hevc
    - input buffer size: yuv size
    - run as turbo session
    - all intra session
    - disable dcvs & batching
    - ignore admission control(skip mbps, mbpf check)

Encoder:
    - codec: hevc
    - rc mode: CQ
    - profile: MainStillPic
    - all intra session
    - output buffer size: 2 * yuv size
    - output dimension: 512 x 512
    - disable dcvs & batching
    - ignore admission control(skip mbps, mbpf check)
    - skip scaling check
    - hfi: set grid enable & disable time_delta based rc.

Change-Id: I0af47de1406a53d8d8bf1969a65b3a390b0aacb5
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-13 18:44:11 +05:30
Mihir Ganu
ccb6da7567 video: driver: Add support for non-secure pix context bank
- Add support for a new non-secure pix context bank.
- Remove usage of deprecated 'buffer-types' in context banks.

Change-Id: I3a21eb8ce1d9aff277568d54aadb54193ad0ce75
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-10 11:18:12 -08:00
Darshana Patil
03bda80d9e video: driver: add release done flag support
update hfi command header file to include
release done flag and related hfi buffer flag
changes. add functionality to release and
unmap buffer if this flag is sent by fw.

Change-Id: I03fdd7776fcd6ac5e8a147c7dff2dfb6a15250e9
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-09 18:38:01 -08:00
Govindaraj Rajagopal
6d97dd3795 video: driver: refine queue work functionality
[1] remove unwanted switch cases to reduce code complexity
[2] refine queue_response_work functionality.

Change-Id: I91aabb2eb4c64caea09a26895358544972a7d427
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-09 23:41:35 +05:30
qctecmdr
74f2907a9f Merge "video: driver: Enable CR and CF" 2021-03-08 15:08:22 -08:00
Chinmay Sawarkar
1a9c2e36bb video: driver: Enable CR and CF
Enable Compression Ratio and Complexity Factor property.

Change-Id: Ia34ffe0a91b0b3b9941ccb0bbb0eacfdb16b51e9
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-03-08 12:06:51 -08:00
Darshana Patil
41d465f5cf video: driver: add dpb tag list metadata support
- add DPB tag list capability in database
- subscribe in metadata mode for the dpb tag list
  property if enabled

Change-Id: Id4b9b7392b7b26cccf0860d578b8a0cb8d798d04
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-05 16:36:29 -08:00
qctecmdr
9800ae3f27 Merge "video: driver: update sizeimage during set ctrl" 2021-03-04 16:11:41 -08:00
Darshana Patil
3f9d032aa1 video: driver: update sizeimage during set ctrl
update input port sizeimage for a decode session
during set control of bitsream size overwrite
control.

Change-Id: I4cb7d6c8d416f187e1ac557d3b423acfdbcb7a60
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-04 12:06:27 -08:00
Govindaraj Rajagopal
a7670d7f42 video: driver: enable decoder batching support
Added change to enable decoder batching feature.

Batching willbe enabled only when below conditions were met.

[1] platform supports batching
[2] decode session
[3] realtime session
[4] non-thumbnail session
[5] non-heif session
[6] 2-stage decode only(low_latency not supported).

Change-Id: I54b601814c3b5fa2077dc41c5b0ac84964c2674a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-04 09:38:55 +05:30
Darshana Patil
596ca194de video: driver: add thumbnail and priority support
- add thumbnail mode and priority in database.
- modify output min count for thumbnail session
- deprecate is_turbo_session.
- deprecate flags variable in instance structure and
  use database entries.

Change-Id: I04a3386f1e2eb9fb97bd550d6f169f9510f462c8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-03 18:13:09 -08:00
Akshata Sahukar
660008370e video: driver: Add NAL length based encoding
Add support to set HFI_PROP_NAL_LENGTH_FIELD property to
video firmware.

Change-Id: I20db36bad394fe0b5163a156199340836af3f740
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-03 11:43:00 -08:00
Maheshwar Ajja
b297e04dee video: driver: initialize subscribe parameters
Initialize subscribe parameters before input port settings
change event from firmware to avoid uninitialized subscribe
params usage in video driver.

Change-Id: I39a1e6646a845836a406193ace7a5fb71edee192
Depends-On: I07c7c8b4faaccc896249b2da84148ec05c2047da
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-03-02 17:04:40 -08:00
Maheshwar Ajja
395d4a9ff5 video: driver: amend interlace detection logic
As per HFI_PROP_CODED_FRAMES details, 0x0 is field interlace,
0x1 is progressive and 0x2 is adaptive frame field bitstream.
Treat 0x1 as progressive and both 0x0 and 0x2 as interlace in
driver.

Change-Id: I07c7c8b4faaccc896249b2da84148ec05c2047da
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-03-02 09:44:17 -08:00
Darshana Patil
481a6117d8 video: driver: update license year
update license year to 2020-2021

Change-Id: I5a67bf49c386e86337bc7449ded08d186fc9a280
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-01 18:07:35 -08:00
qctecmdr
382a48ec9c Merge "video: driver: increase encoder max host buffer count" 2021-03-01 12:42:30 -08:00
Govindaraj Rajagopal
f7dc3c7789 video: driver: increase encoder max host buffer count
Increase encoder max host bufcount 64 -> 256 to support
superframe(encoder batching) usecase.

Change-Id: I8607b8302a10c52ac47a0c67ee7c359c62aa1d02
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-01 11:47:08 +05:30
Govindaraj Rajagopal
f25d5c7078 video: driver: handle race between streamoff and qbuf sequence
Currently stramoff releases inst->lock and waits for response from
firmware i.e race issue. Streamoff released int->lock and that got
acquired by qbuf. So 2 FTB's were queued to firmware after streamoff
request.

Receiving qbuf after streamoff is treated as fatal at firmware side
and it sends session error as response to host. Added change to
avoid such issues.

Change-Id: I6da8ac0d3d30b540784e3c03c423270cb5212af2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-01 09:17:24 +05:30
qctecmdr
7fdf00010a Merge "video: driver: Resolve empty brace compilation issue for VS" 2021-02-26 13:28:47 -08:00
Akshata Sahukar
20d30c5dd2 video: driver: amend colorspace info setting
v4l2 enums for color space info are not one to one
mappings with hevc spec values. Hence, introduce and
use corresponding mapper functions.

Change-Id: I37a79a9b34b66184ece9a284ae98c9fa4efd248f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-26 12:52:14 -08:00
Akshata Sahukar
a774cd62bb video: driver: Resolve empty brace compilation issue for VS
Empty braces caused compilation issue on VS. Resolved
the same to now compile complete driver code on VS
with no additional change requirements.

Change-Id: Ib63aad3d104362c17c952780f40cd6e381902343
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-26 12:51:10 -08:00
Govindaraj Rajagopal
e743f5dd48 video: driver: use char array for printing vidc logs
Instead of formulating session_id, codec_type, domain at
each log print, used pre-formatted char array to print
the vidc logs.

Change-Id: If7a93ecb25a7b1b98ebca6f39e3990079c00b5dd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-26 22:10:16 +05:30
Govindaraj Rajagopal
4055a23255 video: driver: enable smmu_fault_handler support
Added smmu_fault_handler support and printing all buffers,
allocations, mappings list details as part of smmu fault
handling.

Change-Id: Idb5d28357f9fb885adf7ae16f328b4963c56aa8c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-25 12:26:46 +05:30
qctecmdr
ff1ac5427b Merge "video: driver: fix video driver remove" 2021-02-24 17:45:46 -08:00
Chinmay Sawarkar
92a5583706 video: driver: fix video driver remove
While removing driver fw should be unloaded.
Also improved error handling.

Change-Id: Ia9f224da6f176c8a50c153f67fe8a77a92b7b08f
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-24 16:29:41 -08:00
qctecmdr
e6b6c34490 Merge "video: Added more validations" 2021-02-24 15:25:50 -08:00
Karthikeyan Periasamy
0e491223d5 video: Added more validations
Fixes for KW security issues.
CRs-Fixed: 2836558

Change-Id: I0c8ca6b13c00420a50b8518caea6ad51ed1268bb
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2021-02-24 14:27:10 -08:00
Akshata Sahukar
17addfbc6d video: driver: add support to few properties
Add support to below properties
- HFI_PROP_MULTI_SLICE_BYTES_COUNT
- HFI_PROP_MULTI_SLICE_MB_COUNT
- HFI_PROP_CHROMA_QP_OFFSET
- HFI_PROP_REQUEST_SYNC_FRAME

Change-Id: I4cc62870756d058e7a7b15290f5d6797b3be243c
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-24 12:06:26 -08:00
Darshana Patil
d4b5661567 video: driver: modify msm_media_info.h to fix 10bit
- introduce STRIDE_BYTES and STRIDE_PIX to
  calculate size is bytes and pxls respectively.
- DEPRECATE VENUS_BUFFER_SIZE and introduce
  VIDEO_RAW_BUFFER_SIZE. All buffer sizes are
  calculated by using STRIDE_BYTES.
- For s_fmt, use STRIDE_PIX to calculate size.
- For v4l2 bytesperline, use STRIDE_IN_BYTES to
  calculates size in bytes

Change-Id: I3db4d843d1834b25c6160ebc318572ac67e22806
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-23 20:02:29 -08:00
Govindaraj Rajagopal
f02bbaf836 video: driver: enable encoder superframe batching support
Added HFR/HSR superframe handling support for encoder.

Change-Id: I28ced3f223cd78d00b1a654a79bcac3b02f378dc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-22 11:52:43 +05:30
Chinmay Sawarkar
6070bc2523 video: driver: enable interframe power collapse
Hand off regulators to hw to enable interframe power collapse.

Change-Id: I11d3d96f0a6cce23ef374e2065532a13af38d2f4
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-19 21:31:27 -08:00
Darshana Patil
02346b9728 video: driver: modify internal buffer counts for vp9
modify internal buffer counts for vp9. fix comv and
noncomv buffer count to 0 for vp9 as they are not
supported for this codec.

Change-Id: I5d504128ab587c425d4cd4cfd2059241e8d256aa
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-19 18:02:17 -08:00
qctecmdr
4154ca00cf Merge "video: driver: fix error handling sequence in msm_vidc_open" 2021-02-19 17:45:22 -08:00
Darshana Patil
52e7bb2213 video: driver: set default_header property at session level
set default header property once per session for decoder.

Change-Id: I5ca9088b8bed09907f2c9f829acec3db23e65a7c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-19 11:46:38 -08:00