Commit Graph

623 Commits

Author SHA1 Message Date
Govindaraj Rajagopal
253c43239c msm: vidc: update iris2 clock calculation
As per vperf sheet, VSP FW Overhead factor(1.05) needs
to be applied to both entropy mode CABAC & CAVLC.

Change-Id: I93dc00137e0633ac2a79862c58970ba43b515ad6
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-09-10 18:25:24 +05:30
Vikash Garodia
10cba22262 msm: vdec: Do not consider 10bit size for specific video hardware
Certain video hardware does not have support for hdr. Avoid adding
size for the same for such video hardware.

CRs-Fixed: 2772982
Change-Id: Iceb64dab0d346fb483976dac16fed4888a2f0277
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-09-09 17:21:59 +05:30
Shi Zhongbo
ec74a635f5 msm: venc: add bitrate boost QP range interface
Add bitrate boost QP range interface to
support additional configs for boost QP range.
Boost QP range should only be effective
when bitrate boost is enabled. And, common vendor
extension QP range overwrites boost QP range.

Change-Id: I9b6601cd7e9bbf4326f67b9e0f40788e915040b0
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-09-07 16:45:06 +08:00
qctecmdr
5ce35308a9 Merge "msm: vidc: shima: Update max profile level caps" 2020-09-04 09:56:45 -07:00
Priyanka Gujjula
541b40c072 msm: vidc: Optimize enc scratch and scratch_2 buffer sizes
Optimize scratch and scratch_2 internal buffer size
calculators for encoder.

Change-Id: Idfaf7df13a427788cbb983a17fc2137be154bce8
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-09-04 20:33:44 +05:30
Priyanka Gujjula
08b43c99a2 msm: vidc: shima: Update max profile level caps
Update level values for ENC and DEC based on
shima caps.

Change-Id: I967b4ef65a59b711815e09e03547b895cc572e39
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-09-03 20:40:16 +05:30
Govindaraj Rajagopal
fcad90b130 msm: vidc: reverse sort allowed_clock_tbl for shima
Clock_table entries are kept as ascending order. So always
highest clk corner is picked from clock_table during clock
calculation. So enable reverse sort for clk table entries
to pick the right corner.

Change-Id: I5adc61368aa15ae69c11a0539dcb05437bf686b4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-09-03 18:29:14 +05:30
qctecmdr
f2c416e44e Merge "msm-vidc: update bw calculation for ar50LT" 2020-09-01 02:28:46 -07:00
qctecmdr
f22ff30abf Merge "msm: vidc: Update cycle count requirement of B frames." 2020-08-30 12:54:25 -07:00
Priyanka Gujjula
372b7136f5 msm: vidc: Add support for 128x32 alignment of NV12
Introduce new internal driver color format
V4L2_PIX_FMT_NV12_128 and uapi color format
COLOR_FMT_NV12_128 to map with NV12 128x32
alignment. Also, clean up intermediate HAL
color formats.

Change-Id: Ia28d0f422f2777bda865c2fc6c7499cce9dabb54
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-08-29 00:42:28 +05:30
Chinmay Sawarkar
0bca035ef7 msm: vidc: Update cycle count requirement of B frames.
Decoder base cycle requirement of B frames has increased to 80.
Also, updated cycle count requirement for Encoder HIER B usecase.

Change-Id: Iec1bee89be6bb6c18235c2903080025c312bef2d
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-08-26 11:30:01 -07:00
Dikshita Agarwal
b28387c5c4 msm-vidc: update bw calculation for ar50LT
Update bw calculation formulas for ar50LT.

Change-Id: Ife2342304947f4108f908f7a5c56de24ad088b23
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2020-08-24 13:31:17 +05:30
Priyanka Gujjula
2686a86b94 msm: vidc: Include uapi header files from techpack
Currently uapi header files are included from core
kernel include path since core kernel makefile also
includes them. Hence making changes to include path
in techpack makefile such that uapi header files are
included from techpack project.

Change-Id: I604b8bbb3058473b3e301cbbce112c8c93a0e963
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2020-08-19 22:32:19 +05:30
qctecmdr
3bf4f90efb Merge "msm: vidc: Restrict dynamic low latency for h264 and hevc" 2020-08-19 03:01:35 -07:00
qctecmdr
9354ca4ba5 Merge "msm: vidc: improve heif decoder performance" 2020-08-18 18:38:24 -07:00
Govindaraj Rajagopal
c24265be5c msm: vidc: Update VP9 decoder capabilities for shima
Update VP9 decoder capabilities for shima to be inline
with lahaina.

Change-Id: Ieab73987d92bb093fd06391086935900b5e01768
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-08-18 18:53:35 +05:30
Qiwei Liu
0e570d90fa msm: vidc: improve heif decoder performance
Add V4L2 interface to indicate heif decoder, and use
below configurations to improve performance.
1. Set turbo session
2. Disable DCVS and batch
3. Increase input and output buffer count to 12
4. Modify input buffer size calculation
5. Avoid framerate calc and ts list maintenance
6. Skip setting bse-vpp delay

Change-Id: I9a47a88154238db3ac4285462c6030114546d333
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-08-18 11:34:24 +08:00
Vikash Garodia
b560c7a295 msm: vidc: Restrict dynamic low latency for h264 and hevc
In existing approach, dynamic low latency i.e low latency hint
is restricted via specific low latency components in userspace.
This change adds one more checkpoint to ensure that video
firmware is configured for low latency only for desired codecs.

Change-Id: Iad36c3b84ddc3b94033c4bf5f0afdd3a18600111
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2020-08-18 01:22:20 +05:30
Mihir Ganu
5a5d1b2859 msm: vidc: Update VP9 decoder capabilities
Revise VP9 decoder capabilities and limits to
match the updated Lahaina PRD.

Change-Id: I7a92c88b21e19ab44b43a0c829491f58aa1ce492
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-08-14 11:31:30 -07:00
qctecmdr
583ad02d81 Merge "msm: vidc: set chroma_qp_offset only for client set cases" 2020-08-13 23:49:45 -07:00
qctecmdr
c9ab640209 Merge "msm: vidc: update vsp_cycle entries for shima" 2020-08-12 17:19:15 -07:00
qctecmdr
6a424bb70f Merge "msm: vidc: Deprecate Mpeg2 secure decode support" 2020-08-12 17:19:15 -07:00
Govindaraj Rajagopal
36d91e66e0 msm: vidc: set chroma_qp_offset only for client set cases
Set chroma_qp_offset hfi to firmware only for client set cases.
Supported value: 0 & -12

If hfi not set, firmware proceeds with its own default value.
10-bit: default: 0
8-bit : default: Adaptive chroma_qp

Change-Id: I40262aae87b2a385c6cd7d60faa19b6adfe8b151
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-08-12 18:56:04 +05:30
Govindaraj Rajagopal
be77d74ff1 msm: vidc: update vsp_cycle entries for shima
Updated VSP base cycle entries for Shima to inline
with vperf.

Change-Id: I26e7a521434765b97cc1a508b714652d14adf2aa
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-08-11 20:21:52 +05:30
qctecmdr
c1ad7b0054 Merge "msm: vidc: revise timestamp data type to s64" 2020-08-10 16:04:35 -07:00
Shi Zhongbo
b1a132ad57 msm: vidc: revise timestamp data type to s64
Revise internal timestamp data type from u64
to s64 in case of negative timestamps.

Change-Id: Ib026d504a08ce5ac67d1d962b671c37637761321
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-08-10 13:05:17 -07:00
Mihir Ganu
4be4e326bf msm: vidc: Fix incorrect VP9 scratch buffer calculation
Fix the incorrect VP9 decoder scratch buffer calculation
and match it with firmware definition of scratch buffer size.

Change-Id: Ie901082760d675153d1eb898cbe665cc6ad59bd1
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-08-10 13:04:57 -07:00
Shi Zhongbo
460c45b72a msm: vidc: fix time stamp store after EOS for decoders
1. Add a new EOS flag to denote EOS pending status;
2. Set all existed time stamps with EOS flag as true
   after inserting EOS time stamp;
3. Ignore time stamp sorting to buffers with EOS pending
   flag as true;

Change-Id: I72b041150973e2a28d1039c5f906fdb222a86081
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-08-10 13:04:38 -07:00
qctecmdr
10fbc8019e Merge "msm: vidc: fix less_or_equal resolution check" 2020-08-10 09:10:00 -07:00
Govindaraj Rajagopal
5e7df6ab91 msm: vidc: Deprecate Mpeg2 secure decode support
Remove secure deocde support for Mpeg2 codec.

Change-Id: Ieec132b0c86aa6be3e382c091acdf734d1e1c31e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-08-10 14:03:22 +05:30
Rakshitha Shakamuri
d36983b6f6 Revert "msm: vidc: Update timer API"
This reverts commit a03df1c593.

Change-Id: I65a664bfcb25a534fc71be238dae8560cea3fd6c
Signed-off-by: Rakshitha Shakamuri <rshakamu@codeaurora.org>
2020-08-08 21:58:35 -07:00
qctecmdr
1f1189b278 Merge "msm: vidc: Update timer API" 2020-08-05 12:16:50 -07:00
Govindaraj Rajagopal
cd778f6988 msm: vidc: always read fuse value irrespective of sku-index
[1] Only one vidc node is maintained, so "sku-index" entry is
    removed in dtsi.
[2] In video driver, always read fuse value if efuse_data entry
    is populated

Change-Id: I86b8c38f1e71491678b54a11783292e1281f90d3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-08-04 23:59:55 -07:00
qctecmdr
a742fc9e9a Merge "msm: vidc: Update DCVS thresholds for sufficient seq change" 2020-08-03 17:44:15 -07:00
Chinmay Sawarkar
912bb52fc1 msm: vidc: Update DCVS thresholds for sufficient seq change
1. Sufficient event should use fw min count for DCVS.
2. Input buffer count calculation is independent of Realtime/Non-Realtime.
3. Batching should be disabled if it is non-realtime session.
4. Removed misleading logs and changed buffer count logs to
convey the correct meaning.

Change-Id: Ieba6fc022549f5e767a833410ead5aa7fb52e14b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2020-08-03 11:12:44 -07:00
Shi Zhongbo
21cba5ad49 msm: vidc: fix time stamp store and fetch
Fix to skip time stamp store and fetch for buffers
with codec config flag.

Change-Id: I867db519c45751ef2dadef5a323c7a4ad2741385
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-08-03 16:23:43 +08:00
Mihir Ganu
a03df1c593 msm: vidc: Update timer API
Replace the obsolete do_gettimeofday API with ktime API.

Change-Id: Id105d2c531f8b9aa3315800ab3312bc6a619b792
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-08-02 20:14:27 -07:00
qctecmdr
9fa91852ca Merge "msm: vidc: Copy hfi buf req to hal buf req" 2020-08-01 14:09:39 -07:00
qctecmdr
d2eb76acdc Merge "msm: vidc: check for cvp support" 2020-08-01 14:09:39 -07:00
Qiwei Liu
e05aff730d msm: vidc: fix less_or_equal resolution check
For less_or_equal check, need to meet all the
conditions when return true, not only one condition.

Change-Id: Icf103721596cdcb6a4a90e1def67f3151140db85
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-07-29 11:35:59 +08:00
Manikanta Kanamarlapudi
7ae805aa63 msm: vidc: check for cvp support
check for cvp support before any cvp
related operation.

CRs-Fixed: 2741030
Change-Id: I7a457608321f0aa5b93b6f62d7ceb76c0b00fb93
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-07-28 11:55:57 +05:30
Manikanta Kanamarlapudi
e2a2a4a190 msm: vidc: Copy hfi buf req to hal buf req
copy hfi buf req to hal buf req element by
element. Due to change in structure sizes,
memcpy may lead to memory corruption.

CRs-Fixed: 2741030
Change-Id: Ie4a3aeba7cac78af99355eb766a5ead755cf654b
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2020-07-28 00:25:43 +05:30
qctecmdr
7fc1d99c4b Merge "msm: vidc: disable DCVS for camera encode batching" 2020-07-26 12:20:17 -07:00
Mihir Ganu
f8eaa17bf0 msm: vidc: Enable 8-bit chroma QP offset support
Enable support for 8-bit chroma QP offset.

Change-Id: I296f7a5669439c21d9727b1b731cfce14cbcd529
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-07-24 16:14:08 -07:00
Priyanka Gujjula
4f287b68ad msm: vidc: disable DCVS for camera encode batching
Disable DCVS for encode usecases if the control
V4L2_CID_MPEG_VIDC_SUPERFRAME is enabled.

Change-Id: I72a4bebbd79c42988867572d69f6833629054cba
2020-07-24 12:48:34 +05:30
Mihir Ganu
fbc3b10e06 msm: vidc: Update power sequence to match Lahaina HPG steps
Update power sequence by removing all resets during power down.

Change-Id: I88610e9c71a91a32332626bf6da88f0f64ed1c65
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
(cherry picked from commit 5cffae52eacaaf6b0698de06c11397339d904f35)
2020-07-21 09:35:17 -07:00
Amit Shekhar
59ca4e2365 msm: vidc: Fix p-frame count
Fix p-frame count during intra-period setting for HEVC session without
layer encoding.

Change-Id: I796cac16fbb0538012f9fc97262e1877285e1803
CRs-Fixed: 2735233
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-07-20 17:14:08 -07:00
Akshata Sahukar
1fd9cfcf2e msm: vidc: Fix to add correct superframe buffer timestamps
Avoid adapting driver framerate to camera qbuf rate in superframe
enabled case to avoid setting incorrect hfr buffer timestamps.

Change-Id: I354e7517b9aeef7f1b01f33089b81bf7122e12e2
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2020-07-20 10:32:32 -07:00
qctecmdr
b14f4c13bc Merge "msm: vidc: Check validity of a timestamp before inserting it to list" 2020-07-17 18:24:53 -07:00
Mihir Ganu
6b73bf247d msm: vidc: Check validity of a timestamp before inserting it to list
In steady state, the first entry in the linked list of timestamps is
always invalid. When adding a new timestamp entry, adding the
timestamp which is a duplicate of first entry leads to duplicate
linked list nodes. To avoid this, check for validity of an entry
before inserting duplicates to the linked list.

Change-Id: I47dd8fb06b9e4eb307605df6b0e2b352a2e263fe
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2020-07-17 11:31:48 -07:00
qctecmdr
fdffed7083 Merge "msm: vidc: fix sub_frame flag when fetch ts" 2020-07-17 11:31:01 -07:00
qctecmdr
5a51ddcaba Merge "msm: vidc: Fix static analysis issues" 2020-07-17 11:31:01 -07:00
Qiwei Liu
b226cd01b3 msm: vidc: fix sub_frame flag when fetch ts
Need to check against v4l2 flag instead of
hfi flag.

Change-Id: Ib15974b1cc2ee23861b47425ebe21d25ff6dc694
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2020-07-16 18:30:43 +08:00
Amit Shekhar
209b06e403 msm: vidc: Fix static analysis issues
Fix uninitialized access issue with a few variables.

Change-Id: Ib79186e0b837ce1d020546c8a3436745c5d50532
CRs-Fixed: 2729628
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-07-15 22:58:11 -07:00
Amit Shekhar
911dc56174 msm: vidc: Add support for Hier-B
Add support for Hier-B.

Change-Id: I2bd6f1b6525224795500d8a260de3d78a78d2163
CRs-Fixed: 2637948
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
2020-07-15 22:55:27 -07:00
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