Commit Graph

479 Commits

Author SHA1 Message Date
Manikanta Kanamarlapudi
ea096260e8 msm: vidc: Fix core id value
Add definition for decide_core_and_power_mode
to fix the core id issue. Wrong core id
results in incorrect clock values.

CRs-Fixed: 2572953
Change-Id: I2219df71f555fb34a69146821997bab5fa8971a9
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-01-02 12:36:25 -08:00
Dikshita Agarwal
a88ec175cd msm: vidc: update core ops for AR50LT bus calculation
Update core ops to invoke calc_bw_ar50lt API to
calculate bus bw requirement for ar50lt.

Change-Id: I1c8e1766d9aa2f8ad44498587b171c2827759ddb
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-01-02 12:25:27 -08:00
Chinmay Sawarkar
bcd5ad8e90 msm: vidc: Update cycle count for vpx
VPx cycle requirement is not same as CABAC.
Hence update required as per system recommendation.

CRs-Fixed: 2560714
Change-Id: If600bc9c4abb364dba5f807c944976be992567c9
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-01-02 12:22:49 -08:00
Vikash Garodia
c7abb94cc3 msm: vidc: add 32 bit support in video driver
The commit adds the following
1 Keep DMA mask aligned with api definition.
2 Replace the various division operations with 32 bit compatible modules.

Change-Id: I7bc931ffd124ef2b0be8d2bec44fbebf29d4cfb3
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-01-02 12:18:58 -08:00
qctecmdr
237897b02f Merge "msm: vidc: Update bitrate and frame-size capabilities" 2020-01-02 11:09:16 -08:00
Manikanta Kanamarlapudi
57b101caf9 msm: vidc: Update bitrate and frame-size capabilities
Update max bitrate, min frame width & height.
Add cabac bitrate capability.

CRs-Fixed: 2572200
Change-Id: I41caf4100a2f018d295fb9d802eb8353f9e67168
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2019-12-30 17:34:26 -08:00
qctecmdr
012bf64164 Merge "msm: venc: fix custom matrix enablement" 2019-12-30 17:27:42 -08:00
Shi Zhongbo
6fe257d27f msm: venc: fix custom matrix enablement
Fix to set 7 instead of 1 to firmware to
enable all custom bias, matrix and limit.

Change-Id: Idd8bf0f6036ef2919855f379fffa51d5339eba1d
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-30 16:32:50 -08:00
qctecmdr
d36a642601 Merge "msm: vidc: Fix Power Collapse issue" 2019-12-30 16:32:35 -08:00
qctecmdr
c18d461926 Merge "msm: vidc: Add video param capabilities" 2019-12-30 15:50:24 -08:00
qctecmdr
7fe2a8bf78 Merge "msm-vidc: add bw calculation for ar50LT" 2019-12-30 15:05:46 -08:00
Manikanta Kanamarlapudi
fb13af1aa4 msm: vidc: Add video param capabilities
Add heic & B-frame QP capabilities for
bengal target.

CRs-Fixed: 2558188
Change-Id: I3bfd4f2fc83792395e0a6bd9b4596d7823f92bc8
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2019-12-30 12:09:30 -08:00
Shi Zhongbo
a0e884a3b0 msm: venc: set operating rate to 1 for HEIC
Set operating rate to 1 by force for HEIC, so as
to avoid overloads.

Change-Id: If3f980e096c7e30368b9c6a280e78bbe1625e87a
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-30 11:00:51 -08:00
Manikanta Kanamarlapudi
f0cfef2440 msm: vidc: Fix Power Collapse issue
Driver is not polling for the PC Ready to be
set and truning of the regulators/clocks. Fix the
same.
H2X Interrupt has to be enabled for every boot.

CRs-Fixed: 2572953
Change-Id: Ib24b35dcebedf464bcd461718a18e732531ea4ce
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2019-12-30 11:00:30 -08:00
Dikshita Agarwal
c4f845c6e4 msm-vidc: add bw calculation for ar50LT
Add bw calculation logic for ar50LT.

Change-Id: I326a2d1999248cc189922cb124732e087ad9ff9e
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2019-12-30 10:59:44 -08:00
Shi Zhongbo
2b6da92f88 msm: vidc: fix CSC coefficients
Fix to use correct CSC coefficients for
BT601 to BT709 CSC.

Change-Id: I8365603fed10151db0efbea0058bb896c419c3f4
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-27 16:57:48 -08:00
qctecmdr
32e3693d10 Merge "msm: venc: use output resolution for vbv delay" 2019-12-27 13:12:36 -08:00
qctecmdr
b7e38e6b61 Merge "msm: venc: increase output buffer size only for hevc" 2019-12-27 12:26:39 -08:00
Shi Zhongbo
45a07678d1 msm: venc: use output resolution for vbv delay
Fix to use output port resolution to determine
vbv delay.

Change-Id: Id6dc80f1349d0f5b10be2fa6343fb98816156f58
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-27 10:52:20 -08:00
Govindaraj Rajagopal
18c386f2f5 msm: venc: increase output buffer size only for hevc
10 bit support is available only for hevc codec type.
So increase encoder output buffer size(factor - 1.25)
only for hevc.

Change-Id: I49f6bccc074814d8c737f47fd82907a018ac169a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-12-27 10:27:30 -08:00
Govindaraj Rajagopal
abe5948313 msm: vdec: reduce decoder input buffer count for > 480fps case
For HFR(like 960 fps) usecases requires higher buffer count-24.
But due to framework change(277033), We don't need any addtional
buffers for HFR usecases also. So reducing the count back to 12.

Change-Id: Ia3669858cde0962275d00f31d2bbb7308a3ce983
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-12-27 10:27:09 -08:00
Shi Zhongbo
73fa002b9b msm: venc: set perf mode for HEIC buffers
1. Set perf mode for image session buffers so that
they will be processed quickly.
2. Set max frequency for any turbo sessions.

Change-Id: Icf9b0af5cffcd395356783a9ff7a9421a309f52c
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-21 11:58:40 -08:00
Dikshita Agarwal
923758b884 msm: vidc: Add check to avoid NULL ptr dereference
Check ubwc_config for not being NULL before
dereferencing.

Change-Id: Ia4c87ea4a0e963b33165b0ea9a9c39339cc65832
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2019-12-20 15:52:40 -08:00
Manikanta Kanamarlapudi
0d502cfe48 msm: vidc: Update capabilities for bengal
Update few capabilities like B-frames, Max-MB's,
Codecs for bengal target.

Change-Id: I52bdf3e03ed78915aa3ca218cad89b6da938a606
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-20 15:51:02 -08:00
Qiwei Liu
f15e24f19f msm: vidc: support ROI map type query
Add new ioctl to query the supported ROI map type.
Based on vpu version, report whether support 2-bit type
ROI map, or 2-byte type ROI map.

Change-Id: I6db970f5f36e4cc61365867c2a07d63aaf9365ea
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-20 15:37:16 -08:00
qctecmdr
cba83aa665 Merge "msm: vidc: Add support to H264 CABAC bitrate" 2019-12-20 11:43:18 -08:00
qctecmdr
90df874a0c Merge "msm: vidc: align capabilities to 32 considering hevc" 2019-12-20 10:38:50 -08:00
qctecmdr
57625bccc6 Merge "msm: vidc: Update Enc/Dec o/p and i/p buffer calculations" 2019-12-19 21:26:35 -08:00
qctecmdr
64f370825e Merge "msm: vidc: Update input buffer counts in set format" 2019-12-19 16:13:39 -08:00
Akshata Sahukar
0867a4fbe9 msm: vidc: Add support to H264 CABAC bitrate
Update HEVC, VP8, and H264 CABAC supported bitrate ranges.
And also, added support to distinguish between H264 CABAC
and CAVLC bitrate.

Change-Id: I8e37aa78dbbc7e26faf99b9c1c27cba5a3462cb8
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-19 14:48:58 -08:00
Vikash Garodia
f6dab215cd msm: vidc: align capabilities to 32 considering hevc
For hevc codec, LCU sizes are 32x32 or 64x64. Existing
capabilities consider alignment with 16. Considering a
hevc clip of dimension 4096x2160, the coded resolution
becomes 4096x2176. Limiting the cap with 4096x2160 will
break such usecase, hence keeping the capabilities
considering 32-byte alignment.

Change-Id: I505843878f177c63b88959f92ce3a7d5a06b996b
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-19 14:44:36 -08:00
qctecmdr
610124440b Merge "msm: venc: modify log messages for vbvdelay" 2019-12-19 01:17:22 -08:00
Maheshwar Ajja
2264ab291f msm: vidc: Update Enc/Dec o/p and i/p buffer calculations
-Fix to add 4 extra dcvs buffers at encoder input and decoder
 output side irrespective of fps and resolution.
-Decrease total encoder input buffer count from 16 to 8 for non-hfr
 use-cases.
-Increase total encoder output buffer count for hfr use-cases
 irrespective of resolution.

Change-Id: I2fcda6e8c93bcc0df8c3168049ebf4a60e6bb5f1
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-12-18 20:41:58 -08:00
Darshana Patil
84b5664f36 msm: venc: modify log messages for vbvdelay
Modify log messages for vbvdelay.

Change-Id: I3f1b9458d73dbd2a1f18d1f8d8896e51cd513a07
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-12-18 14:39:29 -08:00
Chinmay Sawarkar
3f1571ff52 msm: vidc: Update input buffer counts in set format
Input buffer counts, ie Dec Bitstream and Enc Yuv,
depend on input resolution. Hence they should be recalculated
in set format. Stale values can result in excess memory usage.

CRs-Fixed: 2548727
Change-Id: I57c87270a6613da290f14484897cef16e964e27a
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-12-18 14:30:44 -08:00
Darshana Patil
e937ff6a51 msm: venc: Bump freq to next level for 1080p@480
Increase vpp cycles by 2% for 1080P@HSR480 encode
usecase so that the video core runs at higher
frequency(366Mhz) helping to achieve the desired
performance.

Change-Id: Id81abd36ab79067d52da9371d1dd5bdcfe622389
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-12-18 14:26:08 -08:00
Maheshwar Ajja
749c6aa9a9 msm: vidc: make video driver as module
make changes in video driver to make it as module.

Change-Id: I00788a1b72cc799f655b16e1bc6b7d6d6e0441f9
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-12-18 14:22:43 -08:00
Priyanka Gujjula
16e264d6fa msm: vidc: reject the buffer iova for incorrect mapping
Reject the buffer device address mapping when the device
address is mapped in secure context bank for a non-secure
instance and for the converse as well.

Change-Id: Ic2fc578acd23d3582b390b24cc9d829d49d00d4d
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-12-17 17:36:09 -08:00
Darshana Patil
a491b399dd msm: venc: Disable input extradata plane for secure encoding
For secure encoding case, there is no camera usage. Hence,
by default make number of planes as 1. If any input requires
extradata, client will enable it and driver will update
number of planes.

Change-Id: Id9afd0a286a53d5d4c6045ba58227f57a0a8e0ca
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-12-17 17:35:25 -08:00
Shi Zhongbo
3498fb8bbc msm: venc: fix to skip mbpf checking for HEIF
Fix to add condition to skip mbpf capability checking
for HEIF image encoding.

Change-Id: Ife323366b8c08040c3f6fab8a0d15b89fe6f6777
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-12-17 17:19:21 -08:00
Govindaraj Rajagopal
16c8cdbaaf msm: vidc: vdec: recalculate input buffer count for HFR
Default buffer count will not be sufficient for HFR(fps > 480).
So recalculate buffer count, if fps is updated before calling
vidioc_reqbuf.

Change-Id: Iec792892d283072f064c4148c65560b6a7e31d45
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-12-17 17:17:41 -08:00
Mihir Ganu
8bb21b0ecf msm: vidc: Set CABAC as the default entropy mode
Set CABAC as the default entropy mode for h264.
Also, check profile settings to ensure that CABAC mode
is set only for applicable profiles.

Change-Id: Id5e67c1a7ac0862ea963312ebdaee58945bf8bc0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-17 17:15:49 -08:00
Akshata Sahukar
9e9698a05c msm: vidc: Fix to set correct profile levels to Video Firmware
Avoid setting incorrect profile level to Video Firmware.

Change-Id: I4f7af01fe77269758d7bcead383e284e995238a2
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-17 17:04:52 -08:00
qctecmdr
347fcf6c7e Merge "msm: vidc: Update encoder scratch1 size" 2019-12-17 13:45:44 -08:00
qctecmdr
5aa8ec341f Merge "msm: vidc: Make sku index an optional property" 2019-12-17 13:04:19 -08:00
qctecmdr
0def9e80f6 Merge "msm: vidc: Update ddr type macro values" 2019-12-17 12:13:11 -08:00
qctecmdr
c4dc072632 Merge "msm: vidc: Increase hfr enc input buffers" 2019-12-13 18:12:27 -08:00
Darshana Patil
8830606bd6 msm: vidc: Update encoder scratch1 size
Update encoder scratch1 buffer size to
match hfi ccb change for downscalar cases.

Change-Id: I6d46227291d8ff3621a19c02940dd555f9103981
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-12-13 14:07:43 -08:00
Chinmay Sawarkar
185f5585f1 msm: vidc: Increase hfr enc input buffers
Increase total input buffers used for HFR cases. Required
for smooth performance.

Change-Id: Ia7dd49ead71239c2fb669e016d5e9fd2f94ca862
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-12-12 18:02:39 -08:00
Chinmay Sawarkar
85b4a06821 msm: vidc: Modify DCVS scaling window
DCVS scaling window should be equal to the additional buffers
allocated for DCVS and independent of the buffer count required
by Client and FW.

CRs-Fixed: 2527739
Change-Id: I665a3d9792f44ea031d6c8d05d6e7a546a22f9a8
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-12-12 17:20:03 -08:00
Chinmay Sawarkar
d8fbf67e63 msm: vidc: Make sku index an optional property
SKU index is not applicable for all targets. Hence no need
to keep it mandatory. SKU related changes will happen only
when the property is present otherwise will default to 0.

Change-Id: I88076ea95bccd4130202c055e5c148d817dd302e
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-12-12 12:20:59 -08:00
Chinmay Sawarkar
41d01ed113 msm: vidc: Update ddr type macro values
Add new DDR type 5X and deprecate DDR type 4Y.
Macro values also changed.

CRs-Fixed: 2534324
Change-Id: I0412b4e624df9c377db18b635d2cde321fccf8d0
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-12-12 12:19:56 -08:00
Govindaraj Rajagopal
b6bf411cd0 msm: vidc: venc: set signal_info to firmware always
Currently setting signal_info, only if colorspace info
is set properly. But sometimes client can set only range.
So need to send signal_info always to firmware.

Change-Id: I5282ec01b473485ec39f39abbf7160b9c5cc0256
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-12-10 11:18:27 -08:00
Govindaraj Rajagopal
1fc52e7df4 msm: vidc: enhance eos buffer handling
Eos buffer is queued to firmware and its ref is maintained
using eosbufs.list. Sometimes EOS request client sent even
before port_reconfig. In that case requeing same buffer
which is already with firmware at start_streaming. So during
handle_ebd of 2nd eos buffer, it can't find the entry at
eosbufs.list. So client closes the session.

Always check, if buffer is already queued, then do not queue
the same buffer again, during start_streaming after reconfig.

Change-Id: If934d8ce357226dee78db15ccb7b3c57103d2f12
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-12-09 14:01:35 -08:00
Qiwei Liu
bd3fc9ca56 msm: vidc: fix memory leak when set color format
When set color format constraints, one buffer is not
correctly freed, fix it.

Change-Id: Iad497f03981653a7f28524f1d9e4218f706dcca1
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-12-05 03:48:40 -08:00
Mihir Ganu
fc82551de5 msm: vidc: Migrate SCM calls
Migrate secure world calls to upstream qcom_scm driver.

Change-Id: I97fe0376bca265db9e2b851294c83f52e61c9544
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-12-02 12:00:46 -08:00
qctecmdr
9fc266c742 Merge "msm: vidc: update internal buffers size" 2019-11-26 17:08:19 -08:00
Rakshitha Shakamuri
d3f9e09c39 msm: vidc: update internal buffers size
h264d level 6 support needs update in internal buffer size.
updated below buffers size

- h264 decoder colocated motion vector buffer.
- h264 decoder VPP command buffer.
- h265 decoder VPP command buffer.

Change-Id: I696e1046d585e209bd45fd4fa3f3e3e9d7527b03
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2019-11-26 14:54:59 -08:00
Mihir Ganu
17ad9b8a4d msm: vidc: Fix bus BW range parsing
Parse both low and high ranges for each bus.

Change-Id: I01fb35976cf128cfebe390bd0fc780422cfe91d5
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-11-25 20:10:15 -08:00
Mihir Ganu
36e018e3ab msm: vidc: Initialize port format type
Initialize port format type to avoid failure
when g_fmt is called before s_fmt.

Change-Id: I37758f6d8be766c75cc8bc97147312b3b0bb0915
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-11-18 15:18:35 -08:00
qctecmdr
0c392a3e53 Merge "msm: vidc: ar50 and iris1 no longer needed" 2019-11-15 11:07:34 -08:00
Mihir Ganu
2ee4d803f6 msm: vidc: Update Lahaina platform data
Add Lahaina-specific platform data needed for driver probe
and remove data for older platforms.

Change-Id: I35e7711fd024467f0b6ce40aabdaf71f0c523e9a
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-11-08 14:46:03 -08:00
qctecmdr
2b03e2e748 Merge "msm: vidc: Migrate to icc API to set bus bandwidth" 2019-11-07 17:14:53 -08:00
Mihir Ganu
0a49ec7e24 msm: vidc: Initialize device_caps before device registration
Initialize device_caps with device capabilities before video
devices are registered, as required by V4L2 framework.

Change-Id: I9fc037ae65d352b15d78eee979df30a24137dea8
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-11-01 14:59:41 -07:00
Karthikeyan Periasamy
1ab80e3c13 msm: vidc: ar50 and iris1 no longer needed
ar50 and iris1 are no longer used.
Deleting the unused code pieces and files.

Change-Id: I01fab64b5e3682338fc0ffab986e7807a74c37b5
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2019-10-30 15:59:27 -07:00
Mihir Ganu
3ef057136a msm: vidc: Migrate to icc API to set bus bandwidth
- msm-bus API is deprecated in favor of upstream interconnect API
- Migrate all msm-bus functions to interconnect (icc) API
- Remove msm-bus sub-device probing and parse interconnect fields from
  msm-vidc device tree

Change-Id: Ibf08c52e001c5fde7e30d2aedbd3456a270f5b6c
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-10-30 10:55:45 -07:00
Karthikeyan Periasamy
2c2d48f5b6 msm: vidc: fix the compilation in lahaina
- Made the changes in video module to compile successfully.
 - Removed cvp and v4l2 private files.

Change-Id: Iaf5f29d6042a87d5b96b1fa4abb985ee3e592f0e
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2019-10-25 12:35:37 -07:00
Karthikeyan Periasamy
09e8935f10 msm: vidc: Lahaina bringup - Stage I
Bring all the missing changes from Kona
aa56c67 msm: vidc: Set fps to 1 for image encode sessions
bc60bd6 msm: vidc: Add support of level 6.1 to VP9 decoder
349732b msm: vidc: update LTRUse maximum limit
9d3a015 msm-vidc: calculate buffer size based on 512x512 for heic
46e2095 msm: vidc: Update Kona Profile Level Capabilities
ad8cd1c msm: vidc: delete v4l2 controls after queue release
ea1efd0 msm: vidc: Initialize core ops for bengal VPU version
533aa1c msm: vidc: don't skip set ctrl for the same value
e52cd53 msm: vidc: use macro to get/set fields
92344f3 msm: vidc:  Add new hfi file for AR50 lite
1931ba3 msm: vidc: Update bitrate constraint check
733ea29 msm: vidc: Add bengal specific functions
81b07d4 msm: vidc: Update control capabilities at SESSION_INIT stage
f3e9363 msm: vidc: deprecate firmware buffer requirement property
557ca13 msm: vidc: Update VSP cycle count calculation
7ff089a msm: vidc: fix kw issues
b9733c7 msm: vidc: Add config files for bengal
1b0c12b msm: vidc: Allow all-intra encoding in CBR_CFR
3ca1cf0 msm: vidc: Add platform specific data
a16c617 msm_vidc: venc: update HEIF output buffer count
622514e msm: vidc: fix extradata none parsing issue
1f61e2c msm: vidc: Update mb/frame resolution to 4096x2304
16ffe6b msm: vidc: add dynamic support of frame quality
46f2efd msm-vidc: return unknown ctrl for internal cvp client
043315f msm: vidc: add support for dpb_buffer_count payload

Change-Id: Iee095078d8cd558ea030e65e8d1895b4c7d78948
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2019-10-15 11:53:10 -07:00
qctecmdr
05586cb2b8 Merge "msm: vidc: Enable error recovery by default" 2019-09-05 18:22:38 -07:00
Shivendra Kakrania
530762b1be msm: vidc: Enable error recovery by default
Error recovery is enabled by default & it will get triggered
for all sys error reported by video firmware.

For debugging purpose it can be disabled as:
    1. disable error recovery for noc error:
       echo 1 > /d/msm_vidc/disable_err_recovery
    2. disable error recovery for non-noc error:
       echo 2 > /d/msm_vidc/disable_err_recovery
    3. disable error recovery for all cases
       echo 3 > /d/msm_vidc/disable_err_recovery

Change-Id: Ie260485842704d3e278ded8c6d1722bc19c80f6f
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
2019-09-05 15:02:50 -07:00
Govindaraj Rajagopal
bba6fe37af msm: vidc: print session specific logs based on logmask
print logs based on logmask set on debugfs entry
	(/d/msm_vidc/debug_level)
[1] 0xx -> print logs for all session type
[2] 1xx -> print only encoder logs
[3] 2xx -> print only decoder logs
[4] 4xx -> print only cvp logs

Change-Id: I8e01ee9c8b80a50b178ea87bf25d7ef25401f67a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-09-05 11:39:30 +05:30
qctecmdr
cb5bcb74ad Merge "msm: vidc: Enable secure CVP" 2019-09-04 20:10:40 -07:00
qctecmdr
0ee36d3ba7 Merge "msm: vidc: Add support to CVP skip ratio" 2019-09-04 16:07:41 -07:00
Akshay Chandrashekhar Kalghatgi
f74ea0c9ef msm: vidc: Enable secure CVP
Enable external CVP processing on secure encoder.
Correct vidc-CVP external function names according to naming conventions.

Change-Id: I1b177ca28838f63faee474a82ba76e7655554989
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2019-09-04 15:44:45 -07:00
Akshata Sahukar
6f422178aa msm: vidc: Add support to CVP skip ratio
Introduced CVP skip ratio property to indicate the number of
buffers skipped for CVP processing. This serves as a hint to Video
firmware to know the number of frames for which CVP metadata has to be
reused from earlier frame to which CVP metadata was sent

Change-Id: I58ad5daf9a9c6ae7a0aa48e3bd1d60e7dc9229e6
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-09-04 15:25:05 -07:00
qctecmdr
7103c35359 Merge "msm: vidc: Raise insufficient event for interlacing change" 2019-09-04 14:41:37 -07:00
Mihir Ganu
7960c3b3a9 msm: vidc: Raise insufficient event for interlacing change
Raise an insufficient event whenever there is a change reported
from interlace to progressive and vice versa so that driver can
set appropriate work/route mode.

CRs-Fixed: 2444064
Change-Id: Ic78867a2b51aa22de5dfeeb4b806014e2f0f23e6
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-09-04 11:23:08 -07:00
Govindaraj Rajagopal
2548b43adb msm: vidc: print session and codec type in dprintk
[1] Maintain log_ctxt cookie to track debug information.
[2] Print codec type and session type by default in logs.

Change-Id: I6c01f3238ba868fdc525f5c60f58545a07bdef3a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-09-04 20:52:25 +05:30
Govindaraj Rajagopal
c705bf58ef msm: vidc: print session_id in logs
Print session_id details in all possible call flow paths.

Change-Id: I0c583dc99d4ebee7fbcb4e36d917ba9120fa670e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-09-04 18:32:46 +05:30
qctecmdr
19cea22246 Merge "msm-vidc: add image encode capabilities for lito" 2019-09-03 01:27:31 -07:00
qctecmdr
e0f7d0bce7 Merge "msm: vidc: increase msm_vidc_hw_rsp_timeout to 1500" 2019-08-30 16:07:07 -07:00
Dikshita Agarwal
cb10315c3c msm-vidc: add image encode capabilities for lito
add image encode capabilities for lito.

Change-Id: Ic4fd706fc54c9e231cf6872e5478a0972ec78134
2019-08-29 11:55:05 +05:30
qctecmdr
810c1db795 Merge "msm: vidc: Fix to allocate right scratch1 buffer size" 2019-08-28 14:00:59 -07:00
Akshata Sahukar
72f29165b3 msm: vidc: Fix to allocate right scratch1 buffer size
Avoid allocating smaller encoder scratch1 buffer for Video
firmware when frame height is greater than frame width.

Change-Id: I663da164b3cbb945d7da2d6ab40199d8ef14d979
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-28 10:59:50 -07:00
Qiwei Liu
f9a35e6304 msm: vidc: remove redundant freq calculations
Remove freq list, which is unused in current dcvs design.
Remove unused dcvs load, load_low, load_norm, load_high,
as current dcvs design only use min_freq and dcvs_flags.

Change-Id: Ifbf251a9506286f2f34eca6eeb1af79bd07c0f43
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-28 06:01:30 -07:00
qctecmdr
75c4f9c1ef Merge "msm: vidc: Update CVP skip pattern logic" 2019-08-27 20:17:31 -07:00
qctecmdr
e554b07b4a Merge "msm: vidc: fix vp8 frame rate capabilities" 2019-08-27 13:09:18 -07:00
Darshana Patil
736bca1b48 msm: vidc: fix vp8 frame rate capabilities
Corrected VP8 frame rate capabilities for encoder
and decoder as per PRD.Added bframe ctrl capability
for VP8.Moved LTR count null check.

Signed-off-by: Darshana Patil <darshana@codeaurora.org>

Change-Id: I2111719e711d6bc67c2279d4c4fc6ef63215a5cb
2019-08-27 10:18:08 -07:00
qctecmdr
bbca9aa4f6 Merge "msm: vidc: Update video-CVP interaction call flow" 2019-08-26 22:07:04 -07:00
Akshata Sahukar
17ed11c5ea msm: vidc: Update CVP skip pattern logic
Update CVP metadata skip logic to send a frame for CVP
processing every time frame rate or operatimg rate changes
dynamically. This helps in handling skipping of CVP metadata
processing for a random number of frames whenever frame rate
or operating rate changes dynamically, and avoid sending
CVP metadata to video firmware for an unpredictable frame.

Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>

Change-Id: I049f0c0ade1700816203713cd82382c2a614f20a
2019-08-26 16:47:04 -07:00
Vikash Garodia
d168b1dab5 msm: vidc: Invalidate encoder output buffer cache
For encode usecase, video driver operates cache always on
the encoded data length rather than the buffer length.
This is an optimization and saves cache operation on unused
memory region.
VB index is used to identify a buffer given to client and fed
again to encoder. Based on that, the filled length of that
buffer is then operated for cache operations.
For certain usecases, it is difficult to identify the buffer
based on VB index. Hence keep a counter to track the max filled
length during the usecase and operate cache on that length

Change-Id: I62cfe876077786ec9d14f541a0080cd2fc124b01
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-08-23 14:42:49 +05:30
qctecmdr
185da22f03 Merge "msm_vidc: vdec: add codec check for reconfig event" 2019-08-22 20:06:58 -07:00
qctecmdr
8c35bce4a2 Merge "msm_vidc: Skip mbpf check for image sessions" 2019-08-22 13:53:46 -07:00
qctecmdr
191e3fd62e Merge "msm: vidc: Set ETB extradata address to NULL during EOS" 2019-08-22 13:00:08 -07:00
qctecmdr
8dde95e9eb Merge "msm: vidc: Remove cluster controls" 2019-08-22 12:03:29 -07:00
Vikash Garodia
65106f1bc6 msm: vidc: Remove cluster controls
V4L controls are made to be part of a cluster when they
are interdependent. If any one control in that cluster
is updated, all the remaining controls get updated as well
with the current control value.
Existing video usecase does not require any v4l controls
to be clustered. Hence removing the cluster controls.

Change-Id: I98dfc4af5291837054a8a28b00942fea6866f0a9
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-08-21 20:20:52 +05:30
Shi Zhongbo
040e0b96c7 msm_vidc: vdec: add codec check for reconfig event
Add codec check for bit depth or color space only reconfig
event. VP9 and HEVC have bit depth reconfig event while only
HEVC has color space reconfig event.

Change-Id: Ia6732e31a15957dc7116535131203a69fe19c987
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-21 10:24:37 +08:00
Akshay Chandrashekhar Kalghatgi
5becaa4682 msm: vidc: Update video-CVP interaction call flow
Update video-CVP interaction with new call flow sequence. Add session create
and session delete commands (reference gerrit#2756413). Remove CVP persist
buffer release command.

Change-Id: Ia3a9ad10e93e19a26f59d9abb7dcccd1605e1ff9
2019-08-20 19:22:36 -07:00
Amit Shekhar
b6d2a31088 msm_vidc: Skip mbpf check for image sessions
MBs per frame for HEIF encode can be pretty large for high resolution
images. Skip mbpf check for image sessions.

Change-Id: I993115743f4792377a3a008b341d4c8256b102b9
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-08-20 18:22:31 -07:00
Govindaraj Rajagopal
4b98f5a1ae msm: vidc: optimize buffer tag allocation
- Possiblilty of performance hit due to memory
  alloc/free at frame level.
- Reuse same buffer_tag instead of reallocating.

Change-Id: Ifb8efc43907feea4d6da5e8a0bf0aeaa47c8e1d7
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-20 10:08:52 +05:30
Mihir Ganu
1dd6b69b53 msm: vidc: Set ETB extradata address to NULL during EOS
Firmware needs to access extradata buffer to find the size of extradata.
In secure sessions, assigning input buffer address to extradata address
causes fault since firmware does not have access to input adderss.
Extradata address and size in ETB must be set to zero for EOS cases
so that firmware skips accessing the extradata buffer.

CRs-Fixed: 2444064
Change-Id: Ia916d2f5f0500c85426fee3274f88fcf36103068
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-08-19 13:53:42 -07:00
qctecmdr
c8be54f0a9 Merge "msm: vidc: Add support to disable CVP usage" 2019-08-16 19:09:52 -07:00
qctecmdr
c2a859472e Merge "msm: vidc: Force venus to max if operating rate is INT_MAX" 2019-08-16 18:16:42 -07:00
Chinmay Sawarkar
8f3af55bc5 msm: vidc: Force venus to max if operating rate is INT_MAX
If client sets operating rate as INT_MAX, vote the highest
Venus clock and BW. This will allow operating the video session
at highest possible performance. DCVS & Batching is disabled.

CRs-Fixed: 2502809
Change-Id: I33e952f501a3ba6c1c8588ee319e10a586941d05
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-16 17:53:07 -07:00
Akshata Sahukar
408a8050fb msm: vidc: Add support to disable CVP usage
Add support to disable overall CVP usage.

Change-Id: I82e7a3e6533008b29f0beafba61fa7b6906aab53
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-16 15:55:45 -07:00
Akshay Chandrashekhar Kalghatgi
b1e18454d0 msm: vidc: Check NAL stream format for secure session
In case of secure encoding, NAL length based NAL header not supported.
Only startcode based NAL header is supported.

Change-Id: I119ffa47a003006e5b0d3bf7fbb5eb547de00830
2019-08-16 11:17:45 -07:00
qctecmdr
305725a1a9 Merge "msm: vidc: optimize buffer alloc in bitrate check" 2019-08-16 00:02:33 -07:00
qctecmdr
f69cf0392b Merge "Revert "msm: vidc: Fix work mode for rate control CQ"" 2019-08-15 23:16:18 -07:00
qctecmdr
992618a0c1 Merge "msm: vidc: make venus_hfi_device as a static variable" 2019-08-15 22:07:32 -07:00
Qiwei Liu
d27e0f6115 msm: vidc: optimize buffer alloc in bitrate check
Avoid alloc/free buffer at frame level in window based
bitrate check, re-use existing nodes to reduce
CPU workload, especially for HFR video.

Change-Id: I8bbbbef5229af7e608d7da1dfa4f75aab3903649
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-15 21:55:34 +08:00
qctecmdr
953fe222c3 Merge "msm: vidc: update current value while updating the v4l controls" 2019-08-14 12:57:59 -07:00
Qiwei Liu
1ec1845dab msm: vidc: refine bus bw voting
- Avoid redundant memory alloc/free at frame level.
- Only calculate bus bw for current session.
- Skip bus bw voting if change is less than 50MBps.

Change-Id: I944670c6ac0bf663cb43f47a06b8e828ccdb28cc
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-13 05:13:27 -07:00
Akshata Sahukar
1b9472cc6f msm: vidc: Add support for V4L2_FLAG_CVPMETADATA_SKIP flag
Introduced CVP skip flag as part of qbuf to indicate buffer is
skipped CVP processing. This is required in order to re-use CVP metadata
from previous frame when it is not an error case. Video firmware will look
at this flag and reuse CVP metadata from earlier frame to encode current frame.

Change-Id: Icf89daa2d5f19790a04f0467a15165870b283ee4
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-13 00:19:59 -07:00
qctecmdr
e13d370e88 Merge "msm: vidc: Update DCVS thresholds" 2019-08-12 21:06:42 -07:00
qctecmdr
3ee419949e Merge "msm: vidc: add support for input_tag, input_tag2 and sub-frame info" 2019-08-12 19:21:13 -07:00
qctecmdr
a81cba00ec Merge "msm: vidc: do not allow qbuf during flush" 2019-08-12 17:32:50 -07:00
qctecmdr
2fe86880cd Merge "msm: vidc: Set VBR as default rate control mode" 2019-08-12 16:49:51 -07:00
Chinmay Sawarkar
9c6de09cc9 msm: vidc: Update DCVS thresholds
DCVS Min Threshold should be FW Min count. Switch to Load_Norm
only when buffers are equally distributed between FW and Client.
This reduces clock transitions and increases residency in
Load_Low and Load_High.

CRs-Fixed: 2502809
Change-Id: I4896fd8fdffb44b546c6df3321e0155ee4a18dcb
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-12 15:58:22 -07:00
Vikash Garodia
2b881c253b msm: vidc: update current value while updating the v4l controls
A v4l control has current and new value. Current value indicates the
permanent value and any change in the control should be reflected to
current value. V4l client should ensure that while updating the
new value, current value is updated as well. If current value is
updated by v4l framework, its good, otherwise, the v4l driver should
update it.

Change-Id: Id0730465487dc4175516f4ef460758bee0b76308
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-08-12 21:54:19 +05:30
Govindaraj Rajagopal
4a3506cb7d msm: vidc: make venus_hfi_device as a static variable
1. Mostly venus_hfi_device ptr is derived from hal_session
   (session->device). During session close hal_session is
   freed in forward path and at the same time RBR arrives
   at feed_back path leads to race condition.
2. If forward threads acquires device->lock first then
   reverse thread may have stale device ptr(which is already
   freed), accessing that ptr leads to device crash
3. To avoid refrencing device from hal_session, made
   venus_hfi_device as a static variable within hfi_common

Change-Id: Ic5db6d4f6da6da08e16f4f00a06a3c4fec4f9c6e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 20:19:35 +05:30
Govindaraj Rajagopal
09a93f806b msm: vidc: add support for input_tag, input_tag2 and sub-frame info
1. Client needs input etb to output fbd association. Introducing
   input_tag and input_tag2 fields for this. Client will send
   input_tag via etb reserved fields and client will get back
   those as part of fbd reserved fields.
2. Convey sub-frame information to client from firmware.

CRs-Fixed: 2494945

Change-Id: Ic64131c7f8f3e3035cd6ff3997fe483171d71fc4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 17:06:26 +05:30
Govindaraj Rajagopal
d4e94261b5 msm: vidc: do not allow qbuf during flush
1. Don't allow qbuf (etb & ftb), if flush is issued to
   (encoder & decoder) input port.
2. Don't allow qbuf (etb & ftb), if flush is issued to encoder
   output port
3. Don't qbuf (ftb), if flush is issued to decoder output port
4. Allow qbuf (etb), if flush is issued to decoder output port
   to handle decoder reconfig.

Change-Id: I08a6a10612cc1a14ad164c55c5c8e54550c84845
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-09 16:57:19 +05:30
Mihir Ganu
226261607b msm: vidc: Set VBR as default rate control mode
Set VBR as default rate control instead of RC_OFF.

Change-Id: Ie89f0109a9fe38a6c18b4713e8e8e905beb40b70
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2019-08-08 14:50:01 -07:00
qctecmdr
0f6ff6216f Merge "msm: vidc: fix kw issues" 2019-08-08 10:31:19 -07:00
qctecmdr
1a997fa744 Merge "msm: vidc: recalculate buffer counts based on frame rate" 2019-08-08 09:47:46 -07:00
qctecmdr
2283a494c7 Merge "msm: vidc: Update cvp extradata control settings" 2019-08-08 09:01:29 -07:00
qctecmdr
75f5271221 Merge "msm: venc: add dynamic flip" 2019-08-08 08:17:59 -07:00
Shi Zhongbo
6854e171a5 msm: vidc: fix kw issues
Fix two kw issues on uninitialized pointer
and possible NULL dereference.

Change-Id: Ic87335d435ee84bef1c264d99e0d857d2932cbdc
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-08 14:21:59 +08:00
qctecmdr
cd68fa556e Merge "msm: vidc: increase decode input buffer count" 2019-08-07 21:40:53 -07:00
qctecmdr
b1b780431d Merge "msm: vidc: Do not vote bw on ftb" 2019-08-07 21:40:53 -07:00
qctecmdr
400d1130c6 Merge "msm: vidc: avoid repeatedly set the same freq" 2019-08-07 21:40:53 -07:00
qctecmdr
d10a4f3a23 Merge "msm: vidc: add check to ensure buffer size is 4K aligned" 2019-08-07 21:40:53 -07:00
Maheshwar Ajja
34d3f0fe99 msm: vidc: recalculate buffer counts based on frame rate
Encoder buffer requirement changes based on frame rate or
operating rate (HFR/HSR usecase) and hence recalculate
buffer counts when client set frame rate or operating rate.

Change-Id: I7b421524f319a4fde8b153dcd5c3bde123c5ccf9
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-08-07 14:03:20 -07:00
Akshata Sahukar
b273402361 msm: vidc: Update cvp extradata control settings
If kernel to kernel CVP is enabled, initially driver disables
CVP extradata to firmware and then later, re-enables it.
Introduced a new flag to usage of CVP kernel to kernel metadata
to save the usage. As part of start streaming, driver will send
out CVP extradata enabled once based on overall usage.

Also, disabled kernel to kernel CVP usage for superframe.

Change-Id: I5590bd2274e27243da99f207d61fb00fc6fc82e0
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-08-06 17:40:30 -07:00
Darshana Patil
efed87ec8d msm: vidc: increase decode input buffer count
Increase input buffers count for first four elgible
sessions to avoid high memory usage. Also made changes
to extra buffer calculations.

Change-Id: Id50791f6800390ad27abc6f361e54dcc7b61a8c8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-06 15:06:47 -07:00
Shi Zhongbo
f72fe0767d msm: venc: add dynamic flip
Add to support dynamic flip command.

Change-Id: Ide3aba6185241214eb955861bf251efd51662f03
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-08-06 10:22:29 +08:00
Darshana Patil
af0e01c383 msm: vidc: make realtime as default
By default, a session is realtime. Client can
overwrite as non-realtime.Fixed realtime value
for decoder.Deprecated VIDC_REALTIME flag usage.

Change-Id: I5a1d1c9bdab18d3dfb73f3b21a23054de07d77a1
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-05 11:45:40 -07:00
Govindaraj Rajagopal
d1161f93dc msm: vidc: increase msm_vidc_hw_rsp_timeout to 1500
Increase msm_vidc_hw_rsp_timeout to 1500, if kerenl or firmware
log_mask is set.

Change-Id: Id12e05e78ac4b004e4ccef7ff48be4f8eca1242a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-05 11:27:07 +05:30
Chinmay Sawarkar
02f5b95ce6 msm: vidc: Do not vote bw on ftb
Parameter that affect BW change during ETB and EBD.
During FTB BW calculation and voting is redundant.

Change-Id: I418d422f614670c2543a19709b36b3f39fd0d0e1
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-05 12:06:15 +08:00
Qiwei Liu
37de0e68d4 msm: vidc: avoid repeatedly set the same freq
If requested clk_freq is not changed, don't call
clk driver to the same value repeatedly.

Change-Id: I7ff1d7faedb10b06c0371f66b4a6cf6592d165fe
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-08-02 22:34:15 +08:00
qctecmdr
b098e7cf4e Merge "msm: vidc: handle dynamic framerate or operating rate changes" 2019-07-31 23:28:48 -07:00
Govindaraj Rajagopal
a6e8541864 msm: vidc: add check to ensure buffer size is 4K aligned
Input and output buffer size must be 4K aligned for both
encoder and decoder session. So reject the session during
msm_vidc_qbuf, if alloc_len is not 4K aligned.

Change-Id: If555f26f1658ce50e12a8533cb9d59134da0aa81
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-08-01 11:05:13 +05:30
Darshana Patil
e047e8e387 msm: venc: remove volatile flag from LTR control
Remove volatile flag associated with LTR control.

Change-Id: I86c7fdb8b50adecf84d97145fad406f0e23002df
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-31 15:10:20 -07:00
qctecmdr
8ce34de1fe Merge "msm: venc: fix ltrmode for unsupported codec/RC type" 2019-07-30 23:59:11 -07:00
Darshana Patil
bd8775b802 msm: vidc: remove volatile flag for certain controls
Reverting the volatile flag added to GOP size, bframe
and max hier layer controls.

Change-Id: I3f74bc59e7a73882ff1ce95832b8f248a8ddb80e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-30 18:45:10 -07:00
Darshana Patil
353089d3be msm: venc: fix ltrmode for unsupported codec/RC type
Do a get control before accessing the control value
to make sure right structure is accessed.

Change-Id: Iabf2ca85c342fe46d2236232794bbe9b9981fb18
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-30 17:07:24 -07:00
qctecmdr
8fd369bab9 Merge "msm: vidc: Add window based bitrate check in decoder" 2019-07-29 22:28:26 -07:00
qctecmdr
e8df88c30b Merge "msm: venc: Set LTR info only when LTR is enabled" 2019-07-29 21:26:34 -07:00
Qiwei Liu
15f3510a38 msm: vidc: Add window based bitrate check in decoder
In decoder, window based bitrate check will help
identify usecases where, input bitrate exceeds hw
capabilities.

CRs-Fixed: 2497423
Change-Id: Ic68bd66584ed84382ba03777d39775d08278a8a0
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-29 18:38:22 -07:00
Amit Shekhar
6d95875992 Revert "msm: vidc: Fix work mode for rate control CQ"
Set default double stage work-mode for HEIC sessions.

This reverts commit 10eb14941d.

Change-Id: I347e3af101ef236ba18687a5672f3bca6b49d257
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-29 16:12:39 -07:00
Darshana Patil
a7967f7038 msm: venc: Set LTR info only when LTR is enabled
Set LTR use mask and mark index information to
firmware only when LTR count is non zero.

Change-Id: Icdcd0e8e29841e0cf4d2222ad3c2331aed2e3968
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-29 14:55:47 -07:00
Darshana Patil
1af4075b33 msm: vidc: adding support of driver editable control values using volatile flags in v4l2 control
Due to various feature constraint and best effort encode/decode, driver needs to update client
updated or default control value.Later these driver updated values are used in programming video
firmware. Hence, we need various controls as volatile

Change-Id: Ied22665addda921b0ef4827fb7a2b1fd47be5bbb
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-29 14:45:52 -07:00
qctecmdr
5a31d042fe Merge "msm: vidc: send dmabuf pointer instead of fd" 2019-07-27 14:33:08 -07:00
qctecmdr
048032c021 Merge "msm: vidc: Check image encode capabilities" 2019-07-25 17:21:42 -07:00
Amit Shekhar
61344c1970 msm: vidc: Check image encode capabilities
For heic/hevc image session, check respective capabilities to
allow or reject.

Change-Id: I4e565e6614a7863f75ecd4719480b850e1af43ae
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-25 15:10:35 -07:00
Shi Zhongbo
bc901062aa msm: venc: add blur constraints
Add blur constraints to reject external
blur when rotation/flip/scalar enabled.

Change-Id: Ia3fd1240a7788b89736889751f8a905e06e30f12
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-07-25 17:59:15 +08:00
Chinmay Sawarkar
b00fc8327b msm: vidc: Fix default_bus_vote
Update all struct values in default_bus_vote.
Calculate bw only when function available.

CRs-Fixed: 2494775
Change-Id: I70a137494c4469f928efe3ddf1f0297e2281c689
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-22 14:56:39 -07:00
Maheshwar Ajja
f9c4430e8b msm: vidc: handle dynamic framerate or operating rate changes
Update CVP driver clocks, buses and preprocess frame skip logic
if framerate or operating rate changed dynamically.

Change-Id: Iebed437a1d7e0e136ebf703db76528cbd102363c
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-19 16:50:44 -07:00
qctecmdr
5c854678be Merge "msm: vidc: fix some BW and freq calculation issues" 2019-07-19 08:43:36 -07:00
qctecmdr
ff9b687e95 Merge "msm: venc: add all intra encoding supports" 2019-07-18 21:48:31 -07:00
Shi Zhongbo
c074c474fb msm: venc: add all intra encoding supports
1. Add all intra encoding capability;
2. Disable LTR, HP, Slice mode and IR settings;
3. Use WorkMode2, HQ and Pipeline 4 by force;
4. Ignore dynamic switch between IPPP and all intra;
5. Reject sessions if static/dynamic frame rate
   larger than 240;
6. Reject any non HEVC or AVC sessions;
7. Reject any HEVC Main10 profile sessions;
8. Reset all intra flag to false when stream off;

Change-Id: I9f405a7712c84bc6f8319025a7fb2a0a7f9064df
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-07-19 10:05:06 +08:00
Maheshwar Ajja
ba78735a86 msm: vidc: send dmabuf pointer instead of fd
Send dmabuf pointer in reserved fields instead of fd
to CVP driver for internal CVP usage buffers as fd is
not available for these buffers.

Change-Id: Ic25a445253b4ae05748d47b7caf0b88e909aad7e
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-18 11:54:05 -07:00
Qiwei Liu
8daa8ee72f msm: vidc: fix some BW and freq calculation issues
- Modify max UBWC_CR from 3 to 5, as this value can
exceed 4 in real usecases.
- Decoder dpb read/write has already added cbcr by
dpb_factor, no need to add again.
- Decoder dpb_read BW saving factor for LLC should
be 1.3 for H264 and 1.14 for HEVC.
- VSP base cycle should be 0 for Iris/Iris2.
- Encoder ref_read_cbcr should multiply by
ref_cbcr_read_bw_factor.
- Encoder ref_write should multiply by
recon_write_bw_factor when tile enabled.
- Add fw_vpp_cycles when calculating vpp_cycles.
- Add multi-pipe factor for vpp_cycles.
- Add B-frame factor for encoder vpp_cycles.

Change-Id: I9e40203c5c89d8abdc77787a752ca240e11791f6
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2019-07-18 15:35:02 +08:00
Priyanka Gujjula
9abcce52a6 msm: vidc: remove key frame flag usage from ebd
Remove HAL_BUFFERFLAG_SYNCFRAME flag usage support
from hfi_msg_session_empty_buffer_done_packet and
its corresponding usage in handle_ebd.

Change-Id: I2dafd35a462a443e6efa165cbf46d4b78833c765
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-18 12:01:22 +05:30
Akshata Sahukar
4c65367a07 msm: vidc: Enable LTR use contraint by default
Encoder shall encode subsequent frames in encoding order subject to the 
following constraints:
- It shall not use short-term reference frames in display/input
  order older than the current frame with the LTR command applied
  for future encoding in encoding order.
- It shall not use LTR frames not described by the most recent USELTRFRAME.
- It may use LTR frames updated after the current frame in encoding order.

Change-Id: I167bb0e211c46f892fedb88f8054bc98543ebe8a
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-17 13:13:10 -07:00
qctecmdr
8e381af8e9 Merge "msm: vidc: Initialize 10bit bw variable" 2019-07-17 01:09:43 -07:00
qctecmdr
34c7c333cd Merge "msm: vidc: Update minimum GOP size calculation" 2019-07-16 19:24:51 -07:00
qctecmdr
03172d2c37 Merge "msm: vidc: Remove mese bw vote for video encoder" 2019-07-16 16:17:26 -07:00
qctecmdr
653e7ca445 Merge "msm: vidc: Optimize bw calculations" 2019-07-16 16:17:25 -07:00
Chinmay Sawarkar
1fc298872a msm: vidc: Initialize 10bit bw variable
In certain scenarios, y_bw_no_ubwc_10bpp and y_bw_10bpp_p010
will be used with unitialized and incorrect values.

CRs-Fixed: 2487664
Change-Id: I292ed33b60c3994886bb3756babc8ab706ceab8b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-16 15:53:38 -07:00
qctecmdr
9a80003090 Merge "msm: vidc: queue batched buffers upon timeout" 2019-07-16 15:26:34 -07:00
Akshata Sahukar
9e0c71bb6e msm: vidc: Update minimum GOP size calculation
Use max layers allowed in a session to calculate min GOP size
instead of variable number of layers enabled during each frame
encode to avoid GOP size not being multiple of sub-GOP size issue.

Change-Id: I3bb6e5320385acea9cb892c04b586ac3ca8c753f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-16 11:27:54 -07:00
qctecmdr
ce34a06ee0 Merge "msm: vidc: Ensure size of the data available before typecasting" 2019-07-16 04:00:30 -07:00
qctecmdr
760ff0acd6 Merge "msm: vidc: Fix criteria for hybrid hierp enablement" 2019-07-16 02:27:02 -07:00
Govindaraj Rajagopal
38b1e119c8 msm: vidc: queue batched buffers upon timeout
Client expects all the buffers to be returned in certain scenarios
but driver does not return due to decode batching feature. Add
delayed_work functionality to queue batched buffers to video hardware
upon timeout, so that all the buffers will be returned to client.

Change-Id: I926de1da93d941ff2a64bfec1bbd351de2f3a601
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-07-16 10:23:09 +05:30
Chinmay Sawarkar
c5b079d201 msm: vidc: Optimize bw calculations
Calculate DDR and LLCC bw simulteneously to avoid
redundant calculations. This reduces number of calculations
required by 50% and hence reduces cpu load.

CRs-Fixed: 2487664
Change-Id: I6e1768cd63d9b6651fbaf4a8ed8d5706929d7743
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-15 14:30:18 -07:00
Chinmay Sawarkar
fcc05b6aac msm: vidc: Remove mese bw vote for video encoder
MESE BW vote is not applicable for Kona. We can reduce overall BW
requirement by removing this vote.

CRs-Fixed: 2487664
Change-Id: I7cd6e3937e8884a2e4790a49713bd33aaab9c4bf
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-07-15 14:09:29 -07:00
Priyanka Gujjula
3be0ff3910 msm: vidc: Ensure size of the data available before typecasting
Ensure the available data size with in the packet before type
casting from a smaller data type to larger data type in order
to avoid information leak or packet out of boundary access.

Change-Id: I8614a8b3f930c87af8aa49f77ea9d768a73ea203
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-15 16:57:05 +05:30
qctecmdr
ac0ba4c8f7 Merge "msm: vidc: Fix scaling capability for encoders" 2019-07-12 19:30:34 -07:00
Amit Shekhar
c97d00e59f msm: vidc: Fix criteria for hybrid hierp enablement
If client doesn't request hybrid hierp or sets zero as max
enhancement layer count, then, hybrid hierp is not enabled.

Change-Id: I4284fd5c25d4dc812dac3e134ab5dfc53833bfbf
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-12 15:43:19 -07:00
qctecmdr
01ee3c3978 Merge "msm: vidc: Fix validate_pkt_size macro definition" 2019-07-11 22:57:24 -07:00
qctecmdr
a35b41478f Merge "msm: vidc: fix downscale resolution calculation" 2019-07-11 21:46:10 -07:00
qctecmdr
71350c044f Merge "msm: vidc: Fix work mode for rate control CQ" 2019-07-11 18:17:43 -07:00
Akshata Sahukar
99aa37e4ae msm: vidc: fix downscale resolution calculation
Compare unmodified width and height instead of modified values to
resolve downscale resolution calculation issue.

Change-Id: I06e753e416c356ca0e97a6ad53dc12fe04c5cfa3
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-07-11 17:32:03 -07:00
qctecmdr
c1c807954d Merge "msm: vidc: add cvp session priority" 2019-07-11 12:45:52 -07:00
Amit Shekhar
10eb14941d msm: vidc: Fix work mode for rate control CQ
Set single stage work mode for HEIC sessions. Currently, with two
stages, encoded tiles are missing at random.

Change-Id: Iadb59102447e1873e99ae1fd03a1d7b6ce3cba1a
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2019-07-11 12:43:21 -07:00
Vikash Garodia
b77f91e4fb msm: vidc: Fix scaling capability for encoders
Scaling capability are defined in Q16 format. Existing
capability indicates that the capability is 16 times i.e
output dimension can be scaled to 1/16th of input dimension.
As per specification, the achievable ratio is 8.

Change-Id: Ib9e005a055e604d3173dd8cd376d3b6666f2c12c
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-07-11 18:03:51 +05:30
Priyanka Gujjula
7b837fbb71 msm: vidc: Fix validate_pkt_size macro definition
Convert validate_pkt_size macro to an inline function
as this macro definition always returns true.

Change-Id: I9e7eadfe82c041721565c880eca3a46e4e3e98d9
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-11 16:51:08 +05:30
Darshana Patil
7db4d9a424 msm: vidc: define common macro for DB disable slice boundary
Defined a common macro for disable slice boundary
deblocking mode.

Change-Id: Ie163b1268a91f278e8ed6821c88ebff32e80d9cd
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-08 13:23:17 -07:00
qctecmdr
d89f059e3a Merge "msm: vidc: Avoid information leak while accessing the packet" 2019-07-08 02:57:07 -07:00
qctecmdr
11c1adfed0 Merge "msm-vidc: update decoder scaling capability" 2019-07-06 20:44:26 -07:00
Darshana Patil
154af16cfc msm: venc: enable encoder deblocking by default
Enable encoder deblocking by default.

Change-Id: I27af7bb60ed3baac061d481ba6181eb7c2e10a7c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-07-05 16:33:36 -07:00
qctecmdr
31f1acd9e2 Merge "msm: vidc: Add check to avoid NULL ptr dereference" 2019-07-04 12:47:46 -07:00
qctecmdr
550bffc032 Merge "msm: vidc: Add trace for every buffer transaction" 2019-07-04 10:34:47 -07:00
qctecmdr
a07a236782 Merge "msm-vidc: restrict interlace clip resolution" 2019-07-04 08:41:43 -07:00
Maheshwar Ajja
86aaa65234 msm: vidc: add cvp session priority
Set CVP session priority and colorformat.

Change-Id: Ifba0734fa0d38ec47c2aa947bee815ae7c377589
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-07-03 15:23:15 -07:00
Priyanka Gujjula
9ce9c42bbb msm: vidc: Avoid information leak while accessing the packet
Use trusted packet size on the received packet and check for
the size of the data received against the expected size before
accessing the packet.

Change-Id: I1bd6008249a0bf4edeec711ec8d23cf7b8dac1f1
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2019-07-03 21:17:07 +05:30
Govindaraj Rajagopal
a57153a3f9 msm: vidc: Add check to avoid NULL ptr dereference
v4l2_ctrl_get_name may return NULL that leads to NULL
ptr dereference. So added necessay check to avoid ptr
dereferencing if it is NULL.

Change-Id: If1a4ee8fe22e240b278f31888637d22b81b334e1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-07-03 18:26:37 +05:30
Dikshita Agarwal
9734cff1ca msm-vidc: update decoder scaling capability
Update scaling capability for decoder to reject the 
usecase where o/p resolution is less than i/p resolution.

Change-Id: I7cf85db78d51f8dd43da8d4312c92ea982054cb1
2019-07-03 12:09:05 +05:30
Darshana Patil
a705e592b9 msm: vidc: update encoder scratch1 size
Updated encoder scratch1 buffer size macro to
match HFICCB changes. This fixes mismatch in
driver and HFI macro scratch1 buffer sizes.

Change-Id: Ie61058f243dc1895e0af00b78118bbe9dbc54a98
2019-06-28 11:39:07 -07:00