Commit Graph

668 Commits

Author SHA1 Message Date
Vikash Garodia
f171a0918b msm: vidc: Update perf mode spec for shima
As per the recommended configuration, the max spec
for running an encode session in high quality is
1080p@30. Updating the same.

Change-Id: I649790bbf8a3c2264bfe6c36769717df2d2f2a55
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-07-16 00:14:31 +05:30
Govindaraj Rajagopal
9f8094a79d msm: vidc: use clock-rates from static table instead from dtsi
Currently video has multiple nodes in dtsi to support/limit
sw capabilities via sku-index. Mostly restriction comes in
terms of allowed-clock-rate. So created static entries in
platform.c to configure clocks based on plaform fuse value.
So that single vidc dtsi node is sufficient and there will
not be a probe defer/failure during bootup.

For ex. Shima supports 3 sku's.
AB - max 364.8 MHz - sku_version(1) - picked from dtsi(default sku)
AA - max 201.6 MHz - sku_version(2) - clock_data_v2
AC - max 444 MHz   - sku_version(0) - clock_data_v0(no fuse)

Single vidc node - "aa00000.qcom,vidc"

Change-Id: I870f1e3a24c0cbfdd92c537d3e40c4cf5400326d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-07-08 20:09:15 +05:30
Manikanta Kanamarlapudi
8fa3a6f8a4 msm: vidc: Update min resolution capability
Update min resolution support from 128x128
to 96x96 for decoder.

CRs-Fixed: 2724675
Change-Id: I230d3c5fbdc1d476a634160de30b20e207a5f315
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-07-04 10:16:42 +05:30
Govindaraj Rajagopal
7b3b1524c4 msm: vidc: fix deadlock between queue and flush buffer handling
qbuf ioctl acquired bufq[port].lock in one thread and flush
call acquired registeredbufs.lock in another thread. So
thread-1 is waiting for registeredbufs.lock & thread-2 is
waiting for bufq[port].lock i.e leading to deadlock. So
added change to avoid above mentioned deadlock.

Change-Id: Ie21984fdb562ca7a09f801f036f3a78429ceab94
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-30 09:46:54 +05:30
Priyanka Gujjula
bc901f21ba msm: vidc: Align per pipe usage with DMA alignment
Currently, total buffer size across pipes is
aligned with 256. It should be per pipe usage
aligned with 256.

Change-Id: I389f2a0539bb04b9d038fe44122da70690c43466
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-06-25 16:42:54 +05:30
qctecmdr
8da86217fe Merge "msm: vidc: configure work mode for 720p" 2020-06-24 22:18:39 -07:00
qctecmdr
0867d447c9 Merge "msm: vidc: Ignore thumbnail session load" 2020-06-23 10:23:45 -07:00
qctecmdr
a8e346cb9b Merge "msm: vidc: increase h265 decoder max slice count" 2020-06-18 21:53:34 -07:00
qctecmdr
240140e711 Merge "msm: vidc: Delay force firmware unload by 1sec" 2020-06-18 21:53:34 -07:00
qctecmdr
2265fed004 Merge "msm: vidc: Fix KW error" 2020-06-18 03:39:31 -07:00
Rakshitha Shakamuri
53de1be852 msm: vidc: Fix KW error
Fixing KW error with ID: 72859, 72860, 72861, 72862, 111827.

Change-Id: Ia37cb77b27689c2064e0c4d5138d4f9d95c84455
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-06-17 15:26:23 -07:00
Akshata Sahukar
8dc245dc59 msm: vidc: Delay force firmware unload by 1sec
Video instances might still be alive at the time firmware unload
handler is called. As a result, firmware unload request is not propagated
to firmware. Add place holder to increase default delay for this request
to 1sec to wait until all instances are closed and successfully unload
firmware.

Change-Id: Id1e7455d40c1808690148046f9a839f1b79574ae
2020-06-17 10:30:41 -07:00
Qiwei Liu
d0d60bbc2a msm: vidc: increase h265 decoder max slice count
For 8K video, bse-vpp delay is 6, and one frame may
have maximum 600 slices according to h265 spec, so
need to increase max slice count to 3600 to allocate
large working buffer size for worst case.

Change-Id: Iab035b4cbe8c0121bf1e63d4f3e18c9436a16f5d
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-06-17 15:20:06 +08:00
qctecmdr
55e747f481 Merge "msm: vidc: update hbb bit based on ddr type for shima" 2020-06-15 12:52:35 -07:00
qctecmdr
13b88d4af2 Merge "msm: vidc: Bail_out missing platform_data cases during probe" 2020-06-15 12:52:35 -07:00
Govindaraj Rajagopal
96620e5dff msm: vidc: update hbb bit based on ddr type for shima
Update highest_bank_bit for shima based on ddr type.
LPDDR5 - 15, LPDDR4 - 14.

Change-Id: I04d404da18fe9acea4564e4cefe89e3293f5ae13
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-15 11:34:41 +05:30
Govindaraj Rajagopal
588b71a376 msm: vidc: update workroute settings for shima
use num_vpp_pipes from platform_data to configure
workroute.

Change-Id: I5fea0d381402f9877fdb5d0df179bc0857016c56
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-15 11:34:06 +05:30
Govindaraj Rajagopal
aa1e0df29b msm: vidc: add fuse support for shima
shima supports 3 target variants.

[1] fuse IRIS_MULTIPIPE_DISABLE - max 4K@30
[2] fuse IRIS_4K60_FMAX_LIMIT_EFUSE - max 4K@60
[3] no fuse blown - max 4K@120 decode

Change-Id: I2a42fd80f067202b4b9ac62a0c6d548fcb2705c8
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-15 11:32:59 +05:30
Govindaraj Rajagopal
d9dcb1e6a3 msm: vidc: add shima platform configs
Add configurations specific to shima platform as per
H/W and spec.
Eg: Codec data, performance configs, fuse etc.

Change-Id: I4918af58dcafba3aaafa5eeaaaec256f8cbdca37
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-15 11:26:13 +05:30
Mihir Ganu
dfe241edf2 msm: vidc: Increase reset delay to 400us
Increase the delay between reset assert and deassert to a minimum of
400us, as required for Lahaina power sequence.

Change-Id: I8fb77b0746a7cc68ad3925b2e22b402cd0ff8070
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-06-12 13:30:10 -07:00
qctecmdr
7c0902f1a1 Merge "msm: vidc: Add platform capabilities for holi" 2020-06-11 00:34:34 -07:00
Priyanka Gujjula
e98028956e msm: vidc: Ignore thumbnail session load
Thumbnail sessions are considered to be non realtime
sessions. Hence ignore the thumbnail sessions load on
device while calculating the load and mark thumbnail
sessions as perf session.

Change-Id: Ifa89c2f670fa631b6805a5d796a04e07e294ca4c
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-06-10 19:59:30 +05:30
qctecmdr
c3021e92a6 Merge "msm: vidc: Configure video context bank for best fit" 2020-06-09 17:16:44 -07:00
Manikanta Kanamarlapudi
5640d13718 msm: vidc: Update min resolution capability
Update min resolution support from 128x128
to 96x96 for decoder

Change-Id: Ib6b09af6c00323b67a1f50887d80e59148e6cfd8
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-06-09 03:40:02 -07:00
Govindaraj Rajagopal
b62727af64 msm: vidc: Bail_out missing platform_data cases during probe
During msm_vidc_probe, core->platform_data will be NULL, if
there is no match with compatible string in the of_dt table.
In msm_decide_dt_node sku-index check will be by passed due
to default value(0) i.e leading to NULL ptr dereference
exception in msm_vidc_init_core_clk_ops. So added check to
avoid subsequent calls, if core->platform_data is NULL.

Change-Id: I335a2836b2e34e79dcb8743816205d23f798617d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-06-09 13:03:55 +05:30
qctecmdr
1583bee5f8 Merge "msm: vdec: configure latency mode for decode session" 2020-06-07 13:23:29 -07:00
Vikash Garodia
0db29bbac3 msm: vidc: Configure video context bank for best fit
With best fit configuration, the probability of getting
a mapping for video buffer increases even when the system
is fragmented.

Change-Id: I8689447ce1341fd1189b543eb9fb6a2e03edcc94
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-06-05 02:22:35 -07:00
Manikanta Kanamarlapudi
77ffbca8eb msm: vidc: Add platform capabilities for holi
Add platform capabilities for holi target.

CRs-Fixed: 2684474
Change-Id: I15560796a4297632d58556f2027494d26e0855c5
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-06-05 00:17:32 -07:00
Vikash Garodia
5de4c1dce4 msm: vidc: configure work mode for 720p
For 720p or lower, video hardware can run only in
a specific work mode. Fix the condition, so that
the work mode is configured as desired by firmware

CRs-Fixed: 2699234
Change-Id: I8f9ad5030e7a83075a9d2d1bfe2fc39774f4aa56
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-06-04 00:32:30 -07:00
Qiwei Liu
930011097f msm: vidc: support encoder auto dynamic fps
Encoder calculate fps based on timestamp,
if fps changes and stable for 2 frames,
set to firmware to facilitate rate control.
Use closest rounding instead of floor rounding
when calculate fps.

Change-Id: Id2420729a309378107ff6f7830515fae31512ddd
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-06-02 04:32:26 -07:00
Vikash Garodia
e55786492d msm: vdec: configure latency mode for decode session
Static - Enable latency hint which indicates that the
decode session may go into low latency mode during the
session. With this configuration, video driver disables
DCVS and decode batching.
Dynamic - Enable or disable low latency control during
the session. Based on it, video driver would decide the
work mode and set the same.

Change-Id: If6e85b7adb1bbe4b4bec9e4a8671db64f240cfe8
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-06-01 00:55:49 -07:00
Chinmay Sawarkar
6ec572de63 msm: vidc: Ignore vpp delay in thumbnail usecase
VPP delay is not applicable to Thumbnail usecase. Hence buffer
counts should not include VPP delay, in thumbnail usecase.

Change-Id: Iba7d3efec48c08c160eb602d946643d620d2a36f
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-05-29 16:09:38 -07:00
qctecmdr
2005f62619 Merge "msm: vidc: add active session check for clk and bus vote calculation" 2020-05-29 12:16:34 -07:00
qctecmdr
dbea17c4cb Merge "msm: vidc: Change default width & height" 2020-05-29 12:16:34 -07:00
qctecmdr
4447b8f0ba Merge "msm: venc: uncomment bitrate boost HFI calling" 2020-05-29 12:16:34 -07:00
qctecmdr
25fb9b2451 Merge "msm: vidc: restore native recorder interface" 2020-05-29 12:16:34 -07:00
qctecmdr
36d864b37f Merge "msm: vidc: modify driver output min buffer count" 2020-05-29 12:16:33 -07:00
qctecmdr
bee11d8578 Merge "msm: vidc: Adjust the load for concurrent sessions" 2020-05-29 08:35:49 -07:00
Shi Zhongbo
8fc8209df6 msm: venc: uncomment bitrate boost HFI calling
Uncomment HFI calling part for bitrate boost
setting.

Change-Id: I289b1866089fff883d624bb505b37cca4061a626
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-05-27 14:34:22 +08:00
Darshana Patil
bdd837dd06 msm: vidc: modify driver output min buffer count
Modify output driver min count to 4 for HEVC/H264.

Change-Id: I8efa986b693804392a6178b369ef43c7edf9e0d4
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-05-26 18:14:54 -07:00
qctecmdr
c0688d995a Merge "msm: vidc: fix dpb buffer count validation" 2020-05-26 13:25:59 -07:00
qctecmdr
6b5fa66b10 Merge "msm: vidc: update dpb buffer requirements" 2020-05-26 12:26:45 -07:00
qctecmdr
1208e22ffb Merge "msm: vidc: restrict non_secure iova usage" 2020-05-26 11:24:23 -07:00
Qiwei Liu
03507c27f6 msm: vidc: restore native recorder interface
Restore native recorder interface to keep driver
interface aligned with kona.

Change-Id: I8588bd6d85b024556c78d269c7e8d5c0b1518209
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-05-27 01:28:44 +08:00
qctecmdr
500619a0d8 Merge "msm: vidc: keep memory_size_limit check for new session" 2020-05-26 10:21:53 -07:00
qctecmdr
e8968dd197 Merge "msm_vidc: venc: update HEIF output buffer count" 2020-05-25 23:04:07 -07:00
Shi Zhongbo
5ffcf2bdc2 msm_vidc: venc: update HEIF output buffer count
1. Update buffer count after setting bitrate mode
2. Update HEIF output buffer count to 12

Change-Id: Ibbe80bc219b51db7d9c10cb001932d8e55a6f086
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-05-25 09:38:17 +08:00
Shi Zhongbo
0429942772 msm: venc: update min input buffer count for HEIC
After grid flag enabled for HEIC, update min
input buffer count to 2.

Change-Id: Ia279b571af8c15e029a1cc77e3cbd3f6e51448f7
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-05-24 18:07:53 -07:00
Manikanta Kanamarlapudi
c13ea9ecdb msm: vidc: Adjust the load for concurrent sessions
Adjust the load by max image spec for concurrent
video and image sessions.

Change-Id: I433b3a4fb4436589b930a842a02033ac665a826c
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-05-23 09:22:27 -07:00
Qiwei Liu
70c6739172 msm: vidc: fix input port enum_fmt
Assign enum_fmt_out to support input port enum_fmt.
Fix encoder enum_fmt compressd flag.

Change-Id: I822ee81586fe50bfe1fbfd8a808307051e639a79
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-05-22 20:47:56 +08:00
Govindaraj Rajagopal
8eaf9d9bc8 msm: vidc: add active session check for clk and bus vote calculation
After couple of buffer transaction, sometimes session will be idle,
So do not consider inactive sessions for clk scaling and bus vote
calculation.

Change-Id: Ib4cc7606da6c828ce1d9108528a2cbbad4e5f6e4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-22 12:58:17 +05:30
Govindaraj Rajagopal
5b0dfe97c8 msm: vidc: fix dpb buffer count validation
Shouldn't use count_min to validate dpb buffer count, as it
has already been modified when received seq change event.
Use dpb buffer_count_actual instead.

Change-Id: Iad4117e4d0045859312d726caae1c8801ba1b897
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-22 12:57:33 +05:30
Govindaraj Rajagopal
343e1966ff msm: vidc: update dpb buffer requirements
buffer counts(min_cnt, min_host, actual_cnt) is updated in
hal_buffer_requirements only for internal buffers. Currently
for dpb, we are updating only actual_cnt, due to that
msm_vidc_verify_buffer_counts check is failing. So updated
all 3 variables (min_cnt, min_host, actual) for dpb.

Change-Id: Ib6e476fae57407a2b5fb55b1b73986dfca410ae6
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-22 12:54:03 +05:30
Govindaraj Rajagopal
809cf3a2e5 msm: vidc: restrict non_secure iova usage
check total non_secure memory usage, reject the new
non-secure session, if total non-secure memory usage
exceeds the non-secure region size.

Change-Id: I2b0aaae061e5b022237a4c49c66e92461fb40fca
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-22 12:50:05 +05:30
Govindaraj Rajagopal
9f4d365098 msm: vidc: keep memory_size_limit check for new session
do not allow to open new session, if total video consumed
memory is beyond allowed memory_size_max_limit for video.

Change-Id: I6bfade01f99bae24691254744adf7ce38de51fdd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-22 12:13:49 +05:30
qctecmdr
21b711e085 Merge "msm:vidc: Modify input buffer size calculation" 2020-05-21 21:11:52 -07:00
qctecmdr
ca0e7dd803 Merge "msm: vidc: remove usage of core 1" 2020-05-21 18:46:47 -07:00
Manikanta Kanamarlapudi
ec7ac2c5f2 msm:vidc: Modify input buffer size calculation
calculate buffer size as per the max resolution
for the targets that does not support 4k and also
ensure the size is equal to YUV size by overriding
the div factor to 1.

Change-Id: Ia63676d30d1ee1e697518780a03a48010380555d
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-05-21 11:20:55 -07:00
Govindaraj Rajagopal
07430ccb14 msm: vidc: add support for enc_chroma_qp_offset
[1] add support for HFI_PROPERTY_PARAM_HEVC_PPS_CB_CR_OFFSET
[2] send (cb_qp_offset << 16 | cr_qp_offset) to firmware
[3] default:0 and overridden: -12
[4] firmware will subtract 12 from driver sent value.
      0 maps to 12 to fw and bitstream has 0
    -12 maps to  0 to fw and bitstream has -12

Change-Id: I286c7088640349691930c95e9b176e4e748c669a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-05-21 08:03:30 +05:30
qctecmdr
b80bcd6127 Merge "msm: vidc: add RGBA UBWC colorformat support" 2020-05-20 16:13:28 -07:00
qctecmdr
2ea1272898 Merge "msm: vidc: Skip AON register programming for IRIS2 1pipe" 2020-05-19 19:14:57 -07:00
qctecmdr
a214a5b9ca Merge "msm: vidc: Remove support for noc error info registers on IRIS2 1pipe" 2020-05-19 18:01:28 -07:00
qctecmdr
d7718d9d7b Merge "msm: vidc: Enable work mode 2 for image sessions" 2020-05-19 13:45:54 -07:00
Dikshita Agarwal
690e327f30 msm: vidc: remove usage of core 1
Remove usage of core 1 since there is no support of IRIS1.

Change-Id: I5588b452455b592b8156ea4f46cb8e3171e14947
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2020-05-19 15:02:47 +05:30
Priyanka Gujjula
201523fbce msm: vidc: Skip AON register programming for IRIS2 1pipe
AON register programming is used to set NOC to low
power mode during IRIS2 power off sequence. However
AON register memory map is not applicable and hence
skipping AON register programming for lagoon.

Change-Id: Ib63248d118ed9fecfa5fa87925e8f69625dc1ba8
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-05-19 11:50:25 +05:30
Priyanka Gujjula
6d5c90a321 msm: vidc: Remove support for noc error info registers on IRIS2 1pipe
a. NOC error info registers are different for IRIS2_1 pipe HW
   to IRIS2 HW. FW can retrieve the same info without NOC error
   info registers. Hence removing the support to print NOC
   error info registers for lagoon.
b. Since IRIS2 has noc error recovery enabled and same FW is
   used for IRIS2 and IRIS2_1 pipe, only printing NOC error
   info registers is disabled with out disabling noc error
   recovery.

Change-Id: I936629e4f53faa5e25b2a64fb92378a26499ed57
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-05-19 11:48:41 +05:30
qctecmdr
eff8274f54 Merge "msm: vidc: Update HFI enc_scratch1_size for lahaina" 2020-05-18 17:25:14 -07:00
qctecmdr
97f11a69f3 Merge "msm: vidc: Add IRIS2 1pipe support" 2020-05-18 17:25:14 -07:00
qctecmdr
4a6a89f80d Merge "msm: vidc: Add log to indicate image session" 2020-05-18 17:25:14 -07:00
Chinmay Sawarkar
71bfe61fda msm: vidc: Initialize ubwc_stats_lock
Initialize ubwc_stats_lock before use and destroy it before
video instance is destroyed.

Change-Id: I4ecc02109d9d1c3f8b7cfe28c49b5467866b4d3e
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-05-17 14:37:12 -07:00
Shi Zhongbo
c291a1bcb5 msm: venc: add bitrate boost mode
Add to enable bitrate boost mode when rate
control mode is VBR and CAC is enabled.
The default boost margin is 25. This value
can be config from 0 - 100 by the client.

Change-Id: I4c3d0ae557052d3e615aee4c74b52ce0596fcfcc
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-05-14 10:15:18 +08:00
Priyanka Gujjula
196a38b647 msm: vidc: Update HFI enc_scratch1_size for lahaina
Update colrcbuf_size calculations with frame width/height
in MB's instead of frame width/heigt in LCU's.

Change-Id: Ia84609e90c3bd6fb626cf759090e9ddcd1f86435
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-05-10 21:37:15 -07:00
qctecmdr
0cc830f0c4 Merge "msm: vidc: Add support to Adaptive Blur" 2020-05-09 12:17:12 -07:00
Manikanta Kanamarlapudi
bc16bc24aa msm: vidc: Change default width & height
Change default width & height for 1080p to
QVGA. Having 1080p as default, creates issue in
concurrent sessions for low end targets where
max capability is 1080p.

CRs-Fixed: 2602438
Change-Id: I0ca9d8633af1882abd5dbfd113c7dd55cd399f0a
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-05-08 12:16:04 -07:00
Priyanka Gujjula
7d5566a34a msm: vidc: Add IRIS2 1pipe support
Add vpu_ver as IRIS2_1 for lagoon and its
corresponding checks such as no CVP, ROI type,
buffer size calculators based on vpu version.

Change-Id: Ie26c015413c551ca430bb70822a4a65d61d56e11
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-05-09 00:17:34 +05:30
Vikash Garodia
6a73486000 msm: vidc: Add log to indicate image session
During multiple error scenario, video driver prints
the properties of ongoing video instances. Add a log
to indicate if the session is of type image.

Change-Id: Ie23522bd31c9f5188c204c4a1eeae59a627d1976
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-05-08 04:42:11 -07:00
qctecmdr
98bdda2be1 Merge "msm: vidc: Cleanup VP8 on lahaina" 2020-05-08 00:22:18 -07:00
qctecmdr
97637f4b3c Merge "msm: vidc: update extradata size for input buffer packet" 2020-05-08 00:22:18 -07:00
Vikash Garodia
23e16e4dcd msm: vidc: update extradata size for input buffer packet
As per the interface agreement, rg_data would communicate
the size of extradata. Update the same while creating the
packet.

Change-Id: Id61bce9486a11db5263c336b3284e81953a9a070
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2020-05-07 13:09:50 -07:00
Manikanta Kanamarlapudi
7aac68f40e msm: vidc: Enable work mode 2 for image sessions
Enable work mode 2 for image sessions where rc type
is Constant Quality(CQ).

Change-Id: I55b6abe8a0e28b3afc55c83456c02be19cf1e7cb
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-05-07 10:50:43 -07:00
Akshata Sahukar
71e99d72e2 msm: vidc: Add support to Adaptive Blur
Updated BRS control to accept 0,1,2,3 values instead of boolean.
0 -> disable
1 -> 8-bit
2 -> 10-bit
3 -> both
Also, Internal blur is treated as adaptive in firmware with new
restrictions. Adding internal blur conditions accordingly.

Change-Id: I0aa525bc333acaeeddb5b68cf947030c25466154
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2020-05-06 18:23:48 -07:00
Karthikeyan Periasamy
b4510a377b msm: vidc: add RGBA UBWC colorformat support
Video hardware supports RGBA888 compressed colorformat.
So, adding RGBA support in driver.

CRs-Fixed: 2610032

Change-Id: I5f69961c2df365058406fb8a1e5cb62e283385d0
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2020-05-06 14:30:27 -07:00
Akshata Sahukar
db9f5f903c msm: vidc: Introduce ETB flag for Enc Superframe handling
Driver will internally produce subframe flag for all ETB of
a Superframe to firmware (except last ETB). Firmware will
propagate subframe flag to FBD. Driver client will receive
multiple FBDs with subframe flag for single Superframe ETB
(except last FBD). This subframe flag indicates that more
FBD expected for same input.

Change-Id: I627123ee2500dd7846363d8b819c3fa56234a494
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2020-05-06 12:39:17 -07:00
Rakshitha Shakamuri
c599ea068f msm: vidc: Cleanup VP8 on lahaina
Remove all VP8 profiling on lahaina for both encoder and decoder.

Change-Id: I575ffdced1dbe3db0b55243acb88de4fc8971f86
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-05-05 17:31:22 -07:00
qctecmdr
bfdd3e8866 Merge "msm: vidc: Enable msm_vidc_events tracing" 2020-05-05 09:54:41 -07:00
qctecmdr
303075dcf4 Merge "msm: vidc: delayed start of dec vpp processing in work mode 2" 2020-05-01 14:11:48 -07:00
Mihir Ganu
e12a799745 msm: vidc: Add frame rate control entry
Add entry for decoder frame rate control.

Change-Id: I1ccc750dbed69d302d88ca7c0f209a2e10a0578e
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-05-01 10:45:18 -07:00
Mihir Ganu
39bfdaa636 msm: vidc: Enable msm_vidc_events tracing
Enable tracing by adding trace function definitions
and remove stubbed trace functions.

Change-Id: I49902273b78265dabb43ef4a8ef1b8f2fe0529cc
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-05-01 09:07:47 -07:00
qctecmdr
5d2ebfcdfb Merge "msm: vidc: Fix NULL pointer error when DEBUG_FS is disabled" 2020-04-30 22:22:03 -07:00
Prakruthi Deepak Heragu
9903d41e30 msm: vidc: Fix NULL pointer error when DEBUG_FS is disabled
Add extra check to avoid NULL pointer derefernce when DEBUG_FS is
disabled.

Change-Id: Id89e5422c5afce0428dd77280788d50af0a22fec
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
2020-04-30 15:59:31 -07:00
Chinmay Sawarkar
7fe6ac1624 msm: vidc: delayed start of dec vpp processing in work mode 2
Introduced new property to configure start up delay for vpp processing.
This feature is enabled for AVC/HEVC 8k resolution case. Due to the delay
in vpp processing, ubwc stats structure is moved from ebd to fbd.
Ubwc stats changed from per buffer stat to worst case stat from current
dpb list. Introduced debugfs control "vpp_delay" to control delay of vpp
processing, range 0 to 31.
Updated min buffer count requirement due to vpp delay as well.

Change-Id: Ib2a07e4b5d7a9cbf3661258790276843ad714d37
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-04-28 15:24:55 -07:00
Mihir Ganu
a707b90ff2 msm: vidc: Remove PM QoS functionality
Remove deprecated PM QoS functionality from vidc driver.

Change-Id: I922fdb2f2037a8fc820ebf4f2aa6d35a16c6b589
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-04-28 12:30:41 -07:00
qctecmdr
002753eef4 Merge "msm: vidc: Fix bitrate setting for CQ rc-mode sessions" 2020-04-14 11:43:46 -07:00
Mihir Ganu
dc4de60631 msm: vidc: Return ENOMEM for VP9 decode overload case
Return ENOMEM instead of ENOTSUPP when VP9 decode overload
occurs so that userspace can handle this error case correctly.
ENOTSUPP is not available in userspace.

Change-Id: I5260812bb00fde7eed02a29943a67af038e3c001
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-04-09 11:58:44 -07:00
qctecmdr
582eefa819 Merge "msm: vidc: enable timestamp reorder" 2020-04-05 15:48:12 -07:00
Chinmay Sawarkar
4f163fad00 msm: vidc: Update fbd packet size check
FBD packets may contain UBWC CR data information, for certain
targets. Packet size checks should take this into account.

Change-Id: I3ed5705fd6d5b78921aadb2f91c75a071a1f16b2
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-04-03 15:32:59 -07:00
Darshana Patil
86cdac94b7 msm: vidc: enable timestamp reorder
Enable timestamp reordering by using the
calculated timestamps maintained in a
sorted order and associate with output
buffers. This would resolve the issue
if the parser sends incorect timestamps.

Change-Id: I870fd8ed25e05b8e86c677e79182e9c7785656a8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-04-01 15:14:38 -07:00
Amit Shekhar
328a5418c5 msm: vidc: Remove b-frame enablement decision logic
B-frame enablement decision logic has been moved to HAL interface.
Hence, removing from kernel space.

Change-Id: I24943f7facf172f5b9f30fbc67692fd866d490cd
CRs-Fixed: 2615700
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-03-26 14:24:25 -07:00
Chinmay Sawarkar
580131ac8b msm: vidc: Update internal buffer size calculations
Internal buffer size formulae updated to handle non-backward
compatible changes in the Firmware.

Change-Id: I324da7b698f216bd1bc1c3349cae51cdc4ec631a
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-03-25 15:42:29 -07:00
Amit Shekhar
0701e2bcef msm: vidc: Fix bitrate setting for CQ rc-mode sessions
Currently, both bitrate and frame-quality can be set for a CQ rc-mode
session. Adding additional check in driver to set only one of these.

Change-Id: I1ea7b08cf8c7fe90e35aa57f570703e8cdf854e9
CRs-Fixed: 2615700
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-03-25 14:30:55 -07:00
Mihir Ganu
8594905e54 msm: vidc: Set encoder persist buffer to FW
Set the allocated encoder persist buffer to firmware.

Change-Id: I83fdf2dace76848e4a5ad4d8f3a85c9605b56cd0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-03-24 12:21:18 -07:00
qctecmdr
548c8ad2f1 Merge "msm: vidc: Use correct parameter types in callbacks" 2020-03-23 16:40:16 -07:00
qctecmdr
7eaa56d70c Merge "msm: vidc: add check for prefetch memory sufficiency" 2020-03-23 16:40:16 -07:00
Maheshwar Ajja
24de1903d9 msm: vidc: mark few standard controls as custom controls
Video driver extending few standard controls value and
hence mark those controls as custom controls.

Change-Id: I373ed21482bb577c4fc5c28fd011098963608f53
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-03-20 20:34:36 -07:00
Mihir Ganu
69f3ae926c msm: vidc: Use correct parameter types in callbacks
Use correct types in callback functions to avoid kernel
control flow integrity (kCFI) warnings.

Change-Id: Ia84a3d10ebb83407b4ac2c6140daec35e0698bd5
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-03-20 20:32:58 -07:00
Akshay Chandrashekhar Kalghatgi
972cddc45f msm: vidc: add check for prefetch memory sufficiency
Check if the non-pix and pix prefetched memory is sufficient

Change-Id: I71561959a3ed1e9acdb654650144f35656230345
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-03-17 11:31:51 -07:00
Mihir Ganu
20ebbed266 msm: vidc: Perform cache operations on all planes
Perform cache operations on all planes including buffer extradata
planes, since userspace may set cache flag on all planes.

Change-Id: I9cc6060ec7fb2626b4885c7df7592abae99fb955
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-03-13 16:53:05 -07:00
qctecmdr
1af989dbb8 Merge "msm: vidc: Add support to prefetch & drain memory" 2020-03-13 02:50:00 -07:00
Akshay Chandrashekhar Kalghatgi
5dbb3c9263 msm: vidc: Add support to prefetch & drain memory
Secure memory allocations take a long time. Use memory prefetch and
drain operations to reduce allocation times.

Change-Id: Iaa86a97d7a8b1d6eb1683d273ddb27ffe8d891ae
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-03-12 13:16:03 -07:00
Akshay Chandrashekhar Kalghatgi
feb7dabc19 msm: vidc: Get FW name from DT
Get Video FW ELF image name from driver's DT entry.

Change-Id: I95320f2b1bdf9ba9e8bb6264babc33c162da60e0
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-03-12 12:16:18 -07:00
Darshana Patil
6134119508 msm: vidc: calculate decoder fps based on timestamps
Calculate decoder framerate based on input buffer
timestamps and maintain a sorted order list for
timestamps and framerate in a sliding window of
size 32. Send calculated framerate to client in
every dqbuf output buffer. Use the maximum framerate
available in the list for bandwidth and clockrate
calculations.

Change-Id: I5fa357645cb806bf97ccd30ed68bd784d526e233
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-03-10 13:32:14 -07:00
Govindaraj Rajagopal
455cd2b148 msm: vidc: update input tag implementation
In qbuf (input) store input_tag to etb_data list and send it to
firmware in etb. Firmware will return input_tag in ftb_done,
store it in fbd_data list and return the same when client does
dqbuf (output).

Change-Id: I3589e5a3017cac49000fc64191f9f756bc4011f4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-03-03 12:12:23 -08:00
qctecmdr
666c906d4e Merge "msm: vidc: do not update operating rate during INT_MAX" 2020-03-03 04:57:09 -08:00
Mihir Ganu
494d4b0e21 msm: vidc: Use sid to create instance debugfs directory
Currently, instance pointer value is used to create an instance debugfs
name. Using instance pointer causes multiple instances to have the same
debugfs name when kptr restriction is applied. Use instance sid instead
of pointer value to create a unique debugfs name during concurrencies.
Also, use %pK instead of %p in other places.

Change-Id: I098f641e9a548bcb8bf6d939422607cdc194adb3
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-02-27 16:34:46 -08:00
Rakshitha Shakamuri
f3511e846e msm: vidc: Update the persist buffer size for encoder on Lahaina
Updated the HFI_IRIS2_ENC_PERSIST_SIZE parameter to use double
the existing buffer size instead of calculating on
HFI_VENUS_VPPSG_MAX_REGISTERS.

Change-Id: I434e084db95082906638a4a288ed848f3bab89d3
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-02-26 15:36:18 -08:00
Vikash Garodia
8af58f371e msm: vidc: update capability for quality mode
Usecase like UHD encode is configured by driver in
high quality mode. But video firmware overwrites the
mode to performance mode.
Update the quality configuration to make them inline
with video firmware configuration.

Change-Id: I6f432bbf889c01d0a9b1f91bfb3d2dd2b9351b5b
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-02-25 22:03:44 -08:00
Vikash Garodia
307e961aa9 msm: vidc: do not update operating rate during INT_MAX
INT_MAX is an interface provided to client to configure
video session in TURBO mode. When client configures the
operating rate as INT_MAX, the rate at which the frames
arrive at video driver does not change, so there is no
need to update the operating rate.
If the operating rate is updated, macroblocks/s for the
session goes high. As a result, the session gets rejected
as the clock is not sufficient for high mbs/s.

Change-Id: Iaa48073a486ce6435664a6afb8a4c6ddd7b7f87d
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-02-24 17:28:01 -08:00
Rakshitha Shakamuri
c638b9401e msm: vidc: Increase the persist buffer size for encoder on Lahaina
Updated the HFI_IRIS2_ENC_PERSIST_SIZE parameter to be allocated
by encoder ARP buffer.

Change-Id: I09fa92d1f04348266f1fae71479c9b1c077556ae
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-02-21 10:58:54 -08:00
Rakshitha Shakamuri
1cfa55008e msm: vidc: Align buffer size calculators with num_vpp_pipes
Buffer size calculators are dependent on pipe configuration
of the chipset. Ex: Kona has 4 pipes and lagoon has 1 pipe.
Hence aligning the buffer size calculators based on chipset
specific usage of pipes.

Change-Id: I8bb19efc4a80c7e17d9db3cf7d5f1151191b502e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-02-19 18:32:00 -08:00
qctecmdr
833ea5a8b9 Merge "msm: vidc: Move buffer counts handling outside of driver" 2020-02-14 16:13:09 -08:00
Darshana Patil
8cace81134 msm: vidc: Move buffer counts handling outside of driver
Client should take care of buffer allocations for
advanced use cases like HFR and HEIF. Driver will
handle extra buffers only in bare minimum usecases
like DCVS and decode batching.

Change-Id: Id5ec012ba2620b47578173e8306f1700644f0b8c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-02-14 10:19:07 -08:00
qctecmdr
f974523668 Merge "msm: vidc: send mapped addr and size for ftrace" 2020-02-12 23:00:24 -08:00
qctecmdr
5a9dece100 Merge "msm: vidc: Fix input tag fetching condition" 2020-02-12 22:02:34 -08:00
Govindaraj Rajagopal
5f665189a2 msm: vidc: refine decode batching logic
1. is_batching_allowed api is not considering platform
check(core->resources.decode_batching).
2. increase both input & output buffers count if
current session supports batching.

Change-Id: Iabe7479b4664a78b637ee981d67c604f7d0d5d56
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-02-12 14:54:27 -08:00
Amit Shekhar
b7ee67c040 msm: vidc: Fix input tag fetching condition
For sub-frame encode sessions, input buffer done is received only after
all sub-frames have been received. In these sub-frame encode cases,
input tags are not fetched for sub-frame outputs for first input and
buffers are dropped in HAL in absence of apt input tags. Limit buffer
counter check from input tag fetch condition for decode sessions only.

Change-Id: I8c584834369be921d8699da49cfa1fec65fb993d
CRs-Fixed: 2547055
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-02-12 13:12:19 -08:00
Govindaraj Rajagopal
ac715becb7 msm: vidc: send mapped addr and size for ftrace
buffer addr and size were not updated in "UNMAP" tracing.
So added entries.

Change-Id: I4ae5715263a3e1d21de88e4ff69baf8d74d75560
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-02-08 17:01:09 -08:00
Govindaraj Rajagopal
d33141e60c msm: vidc: alter log printing sequence
Low power flag is updated after calling msm_print_core_status.
So it is printing "HQ" even for "LP" session. So changed api
calling sequence.

Change-Id: I1f88f3f3e1ca43f11c00359dbfaec5d2ff99ae89
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-02-06 13:23:31 -08:00
Akshay Chandrashekhar Kalghatgi
167523e9ff msm: vidc: Do not unhalt CVP Core Clock
Configure CVP_VPU_WRAPPER_CORE_CLOCK_CONFIG register to unhalt AXI & VPU
core clocks but not unhalt CVP core clock. Add a function to write a
masked value to register.

Change-Id: I8cb80b1823d091ac4eb705fd207afbd35bde86de
Signed-off-by: Akshay Chandrashekhar Kalghatgi <akalghat@codeaurora.org>
2020-02-04 13:31:04 -08:00
qctecmdr
8f0d93768a Merge "msm: vidc: add vidioc_querymenu support" 2020-02-03 15:08:33 -08:00
Maheshwar Ajja
cf94619546 msm: vidc: add vidioc_querymenu support
Add support for vidioc_querymenu for userspace to
query menu type controls.

Change-Id: Idffb7e978e7f6eba9bf2744bcf87bafcd919decf
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-01-31 16:51:57 -08:00
Govindaraj Rajagopal
7faedc509c msm: vidc: reduce max_packets count to 480
Currently max_packets is configured as 1000, but max outstanding
packets will not exceed more than 480(16 clients x 30 pkts/client).

Change-Id: I8c074e08c959473c20450bc7d62486362ba81b47
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-01-26 12:26:23 -08:00
Karthikeyan Periasamy
855ad95f05 msm: vidc: skip scaling check for decoder
Scaling check is not required for decoder as clients may not
set both input and output resolutions for decoder
in which case input and output resolution will be different
and scaling check fails if enabled.

Change-Id: Iccdbad63bd8f975df4f57cad0250557119cf788d
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2020-01-14 16:43:31 -08:00
Vikash Garodia
720369dfcf msm: vidc: ensure the validity of video buffer access
During subsystem failure, the cause for failure is updated
in a specific video buffer by the video firmware. Video
firmware can even update the size of that specific buffer.
To ensure the validity of that buffer access, check if
the access is within the allocated size.

CRs-Fixed: 2585811
Change-Id: I30b8bf2e9ba3699d229f4acc104f46566fcb60fa
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-01-14 10:34:34 -08:00
qctecmdr
a263740664 Merge "msm: vidc: make video driver as module" 2020-01-13 11:10:34 -08:00
Malathi Gottam
e81728b7b6 msm: vidc: determine sku version based on ddr rank
Based on the ddr rank info, sku version is set.

Change-Id: I1823585553bad65462e047a5bebc6d93716c7703
Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-01-03 10:38:19 -08:00
Manikanta Kanamarlapudi
946f83bbd4 msm: vidc: Update clock cycles
Update clock cycles of vsp and vpp
required for per MB in bengal target.

CRs-Fixed: 2558188
Change-Id: Ifa39458123dfe2b687b0865e119e23aaf5613713
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-01-02 22:16:20 -08:00
Govindaraj Rajagopal
05126a1245 msm: vidc: avoid OOB write while accessing memory
Exclude 4 bytes which holds the size of the buffer while calculating
the actual buffer size to avoid OOB write.

Change-Id: I965e78097a3680065aaf7609d35af1a42fc44824
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-01-02 18:06:09 -08:00
Govindaraj Rajagopal
f1e149c74a msm: vidc: remove additional checks in response_handler
possibility of OOB access on device->response_pkt in
__response_handler. for e.x if msg queue contains 1000
messages and all 1000 were read and queue is empty.
So __get_q_size api will return zero and _iface_msgq_read
will go in an infinite loop, even if packet_count
== max_packets.

Change-Id: I3c0fb095feff0ba5d4d6dab65ed9d5111f1b6f05
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-01-02 12:40:52 -08:00
Manikanta Kanamarlapudi
7eb97316b0 msm: vidc: Update bengal Profile Level Capabilities
Update HEVC Enc/Dec, AVC Enc/Dec profile level
capabilities to align with PRD specifications.

CRs-Fixed: 2578525
Change-Id: Iff81bcbffe7034a00cd5df9f3f6e35e9500d5c77
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-01-02 12:37:36 -08:00
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