Commit Graph

117 Commits

Author SHA1 Message Date
Vikash Garodia
e923948da6 msm: vidc: Fix priority level determination
Priority level was not determined at few sequences.
Determine the priority level and set to firmware, if
there is a change in driver and firmware priority.

Change-Id: I97861fd4ce8cfb7cf828a8da9a5ce8ba900280ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-04 21:04:58 +05:30
Govindaraj Rajagopal
1f46168b9f video: driver: print more info on debug logs
Currently driver prints hex values for codec type, pixel
format and port number. So added change to print strings
instead of hex values.

Removed unnecessary logs to avoid overlogging timeout
issues.

Change-Id: Ia44401990797dc20eae0a35631e9ed6a0b094c20
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-04 19:26:34 +05:30
Mihir Ganu
6b548ba181 video: driver: Update VP9 Line buffer size for QP metadata
Update VP9 decoder Line buffer size by considering VP9 frame
QP Metadadta.

Change-Id: I9b7b5ed32378af19fa3dd1106515b05974ab1a83
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-06-03 10:29:41 -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
8d81cd480b video: driver: tune clock and bus vote calculation
Use bitstream fps in clock and bus vote calculation, if
bitstream detected fps is higher than client set rate.

Change-Id: I58fa1a8725086c112796b3ce5172a39f322e178e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-27 14:32:05 +05:30
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
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
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
a4038a8565 Merge "video: driver: fix core lock acquire and release sequence" 2021-05-20 18:12:48 -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
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
qctecmdr
288887b59d Merge "video: driver: hb layer buf count and hfi buffer macro CL:30683524 changes" 2021-05-15 14:39:13 -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
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
Akshata Sahukar
6ec3f9e960 video: driver: Align buffer interface file with CL: 30395412
Align driver buffer macro interface file with firmware file.

Change-Id: I5f3d2a581150452f9becb2dec871040ced6803c5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-29 11:51:49 -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
Mihir Ganu
cf3fd457b3 video: driver: Enable flip and rotation
Enable encoder flip and rotation preprocessing features.

Change-Id: Icb0448c2d09fbe9504e3f58701cd2653dc4559b0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-23 16:44:42 -07:00
Govindaraj Rajagopal
b1fbc46396 video: driver: select target and vpu variant based on dtsi
- enable conditional compilation based on defconfig
- compile only needed files based target & vpu variant
- enabled stubs to avoid compilation issues, for all
  target variant and vpu types
- add support for qcv(same lunch combo) for different
  PT & VT chipsets.

Change-Id: Ic446349fd1532885d7a2e94895d807c62f1ab6e4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-15 20:14:04 +05:30
Govindaraj Rajagopal
d6890cd14a video: driver: print buffer_name instead of hex value
Handled below items as part of this change.

- print buffer_name instead of hex value.
- enable dcvs only for realtime sessions.
- enhanced max_input_data_size handling at
  msm_vidc_scale_power.

Change-Id: If5ac810f4e020bee54364161596c5547af94161a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-03 00:43:18 +05:30
Mihir Ganu
6368b78d5f video: driver: Align buffer macros with HFI file CI: 29670767
Align hfi_buffer_iris2.h file with hfi interface file
hfi_lx_mem_v1.0_doc.h.

Change-Id: Ie44ee4be1ae5df440906411c7cdfa4b8a8a01194
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-30 13:37:56 -07:00
Vikash Garodia
0017afac21 video: driver: Add handling for session priority
Following changes are added with this:
1. Handle and adjust session priority.
2. Session addmission based on priority.
3. Power (clock and bus) scaling based on priority.
4. Handle s_parm influence on priority.

Change-Id: I12dec5fb03d733f07b0b0a24b4d74d1ccd4bf791
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-03-29 22:47:28 +05:30
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
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
Govindaraj Rajagopal
c148cf0bb5 video: driver: add heic 10bit image encoding support
- fix 10bit internal buffer allocation handling
- profile: MAIN_10
- pixfmt: linear 10bit(MSM_VIDC_FMT_P010).

Change-Id: I49ffd221927e5eb59915405ff62c038ae05b84f3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-23 14:00:00 +05:30
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
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
Akshata Sahukar
479023c98c video: driver: Align buffer macros file with hfi file CI: 29354708
Align hfi_buffer_iris2.h file with hfi interface file
hfi_lx_mem_v1.0_doc.h.

Change-Id: Ie3811f58a94798d135ccfa1cb15d24900c2629d3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-17 11:09:39 -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
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
67ac13840f Merge "video: driver: align buffer hfi interface file with CI: 29135164" 2021-03-04 15:25:10 -08:00
Akshata Sahukar
11642f3144 video: driver: align buffer hfi interface file with CI: 29135164
Align hfi_buffer_iris2.h file with corresponding hfi
interface file.

Change-Id: I2af476ad71e4aa99c93492be7d358087a38c79ce
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-03-04 10:33:31 -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
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
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
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
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
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
Chinmay Sawarkar
8cd787ac52 video: driver: Set lx arch to fw before fw boot
To simplify the boot process, firmware needs to know the type of architecture
before it boots up.

Change-Id: I42ff87094b816f9783d18fa67126e9b7a4dab320
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-09 14:24:02 -08:00
Sebastian Dang
5220f1f7f2 video: driver: Convert debug messages
Add new print format using msm_vidc_inst.
    Convert existing sid print statements.

Change-Id: Iba6774c31ff92997b4f8598e6a705f58bfa1b03c
2021-02-02 10:21:34 -08:00
qctecmdr
d172684c07 Merge "waipio: driver: Set missing video domain for bw" 2021-01-28 21:49:18 -08:00
Chinmay Sawarkar
6b6b21c705 waipio: driver: Set missing video domain for bw
Video domain information is required to make correct
BW vote calculations.

Change-Id: I36cf1d157ba50f43a64e736f7d3e86d15d195244
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-01-28 18:56:07 -08:00
Darshana Patil
b226d6a089 video: driver: fixes for nv12 format and dpb buffer
fixes for nv12 format and dpb buffers. modified
PIX_FMTS and corresponding driver color format
structure, therby fixing enum_fmts.

Change-Id: I955b76dd4938e96fe259311e107a0cdca39425bc
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-01-28 15:42:40 -08:00
qctecmdr
ad18bb5c23 Merge "video: driver: print error message from FW" 2021-01-27 19:21:59 -08:00
Akshata Sahukar
c0b11f6482 video: driver: fix line and dpb buffers for enc
- Removed internal bufsize hack to increase bufsize by
  100MB.
- update enc internal buf size adn count macros to align
  with video fw macro definitions.
  P4 cl: 28472789 and 28496178

Change-Id: I30a4d043a07c6e890d58f4138590f112d192080a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-01-27 17:52:08 -08:00
Darshana Patil
24de4a8b91 video: driver: print error message from FW
print error message from FW during system error

Change-Id: Id27469d786b647d2b61e8090fa1f4337b8bc79f6
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-01-27 17:09:17 -08:00
Darshana Patil
60b7435a4c video: driver: add nv12 format support
add nv12 format support

Change-Id: I6a9f2eb814504e35797fb91053417f16cfdf8b25
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-01-25 16:12:48 -08:00
Darshana Patil
3b10d3f3d8 video: driver: internal buffer size for h264d
add internal buffer size change for h264 decoder.

Change-Id: Idc5aa592ff7cd5a04c5e982becb128e626455ef2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-01-22 13:25:26 -08:00