Commit Graph

46 Commits

Author SHA1 Message Date
Shi Zhongbo
cf15569f3d msm: vdec: update clock data frame rate
Update clock data frame rate to client's set value
for mbps calculation so as to reject sessions out of
mbps capability.

Change-Id: I62559172b71fb4d2e911c16be7f07110e53f23a1
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2020-12-17 22:24:10 -08:00
Govindaraj Rajagopal
2c0ee3a2b6 msm: vidc: tune input buffer size based on buffer_size_limit
Codec2 HAL sets V4L2_CID_MPEG_VIDC_VIDEO_BUFFER_SIZE_LIMIT for all
session and it is very low value. So decoder input buffer size is
always limited by buffer_size_limit. Memory budget estimation is
going for toss in msm_comm_check_memory_supported. So video driver
started allowing all sessions during concurrency run without any
restriction. Added change to use correct buffer size during
memory estimation.

Change-Id: Ic7c5e51a91615fdba8965b3a359c2d3a37c9a14b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-10-20 13:57:32 +05:30
Chandrakant I Viraktamath
70a2ee6e3c msm: vidc: Add control to handle timestamp reorder
Add control to enable/disable timestamp reordering
in driver.

Change-Id: I50c3f60bb8af053881073b40c6df0c74f3f0aafb
Signed-off-by: Chandrakant I Viraktamath <civirakt@codeaurora.org>
2020-09-21 19:24:02 +05:30
Govindaraj Rajagopal
b03e989d89 msm: vidc: cleanup unsupported profile and levels for VP9
VP9 decoder spec is reduced. So cleaning up unsupported
profiles & levels for VP9.
Supported Profile - 0 & 2
Max supported level - 5.1

Change-Id: I5b131f5bbd3c50aea2949f62ab6b16d51728ba7d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2020-09-17 11:39:32 +05:30
qctecmdr
3bf4f90efb Merge "msm: vidc: Restrict dynamic low latency for h264 and hevc" 2020-08-19 03:01:35 -07:00
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
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
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
qctecmdr
98bdda2be1 Merge "msm: vidc: Cleanup VP8 on lahaina" 2020-05-08 00:22:18 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
Chinmay Sawarkar
9c6de09cc9 msm: vidc: Update DCVS thresholds
DCVS Min Threshold should be FW Min count. Switch to Load_Norm
only when buffers are equally distributed between FW and Client.
This reduces clock transitions and increases residency in
Load_Low and Load_High.

CRs-Fixed: 2502809
Change-Id: I4896fd8fdffb44b546c6df3321e0155ee4a18dcb
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-08-12 15:58:22 -07:00
qctecmdr
cd68fa556e Merge "msm: vidc: increase decode input buffer count" 2019-08-07 21:40:53 -07:00
Darshana Patil
efed87ec8d msm: vidc: increase decode input buffer count
Increase input buffers count for first four elgible
sessions to avoid high memory usage. Also made changes
to extra buffer calculations.

Change-Id: Id50791f6800390ad27abc6f361e54dcc7b61a8c8
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-06 15:06:47 -07:00
Darshana Patil
af0e01c383 msm: vidc: make realtime as default
By default, a session is realtime. Client can
overwrite as non-realtime.Fixed realtime value
for decoder.Deprecated VIDC_REALTIME flag usage.

Change-Id: I5a1d1c9bdab18d3dfb73f3b21a23054de07d77a1
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2019-08-05 11:45:40 -07:00
Maheshwar Ajja
5e31da536d msm: vidc: add superframe encode support
In HFR (High Frame Rate) encoding usecases client
sends superframe (single input multiple frames).
So add support for encoding superframes.

Change-Id: I6f726d0ccf5b4b831e517efd3587d822da7eaae5
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-06-19 16:09:52 -07:00
Maheshwar Ajja
82b121236b msm: vidc: amend buffer counts calculation
- Consider thumbnail mode while calculating buffer counts
- decide batching in reconfiguration event so that driver
  returns proper min buffer count when client query for it

Change-Id: I4d5373e78d43592caf0cef59f2f8801d20014efd
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-06-13 17:17:10 -07:00
Maheshwar Ajja
1dcfc5752d msm: vidc: decide batching while configuration
driver returns min buffer count to client which includes
extra buffers count which is required for batching even
though batching may be disabled in start_streaming() later.
So decide batching in set format (configuration) to avoid
adding extra buffers count to reduce memory usage in
non-batching cases.

Change-Id: I147f7aaf928074a23c9dcda2dbf69a744cec382d
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-06-11 10:16:12 -07:00
Chinmay Sawarkar
fe44bca0c0 Revert "msm: vidc: Enable ubwc cr stat by default"
This reverts commit 52ae7a5f1b.
2019-06-10 13:15:54 -07:00
Maheshwar Ajja
994366e082 msm: vidc: use batch enable instead of decode_batching
Use the existing batch enable variable instead of extra
variable decode_batching.

Change-Id: Ic7875caf2b0d2c47d77b0c0c0ce9b5792920cafc
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2019-06-07 21:59:09 -07:00
Chinmay Sawarkar
52ae7a5f1b msm: vidc: Enable ubwc cr stat by default
Decode session needs UBWC CR statistics for BW calculations.
Hence need to enable this exetradata by default.

CRs-Fixed: 2467542
Change-Id: I3955a0b09cf82f97478c31704be6b16f297b011b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-06-07 21:14:59 -07:00
Govindaraj Rajagopal
762f815ddc msm: vidc: remove decoder operating rate setting to firmware
operating rate setting to firmware is not required for decoder.

Change-Id: I271a42822f4a00e95d875400e5ad273697c94ab1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2019-06-07 12:48:52 -07:00
Vikash Garodia
612a31d1ac msm: vidc: update video resolution during reconfig event
Video port resolution can be updated during reconfig event itself.
With this, reconfig height and width was removed. Also relevant
code cleanup was made accordingly.

Change-Id: I4fb38563b4c747eb356f28b7df7e99bd397ff8d1
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-06-06 23:06:24 -07:00
Shi Zhongbo
2f4c502bab msm: vidc: revise debug levels
Clean up debug log levels as:
    1. Revise VIDC_WARN to VIDC_ERR;
    2. Revise VIDC_PROF as VIDC_PERF;
    3. Mark some one-time logs, e.g most of logs
       in initialization and deinitialization as VIDC_HIGH;
    4. Keep VIDC_PKT;
    5. All other logs change to VIDC_LOW;

Change-Id: I8fc30f97dc3424da8418aab00e8af074ec8d4ef9
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2019-05-27 13:37:45 +08:00
Chinmay Sawarkar
31bb5f19a0 msm: vidc: Disable batching for concurrent usecase
Disable decode batching for concurrent decode session.

CRs-Fixed: 2457122
Change-Id: I776e9d057ae0f1a9dc0fd565b061ae48b88435e1
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-05-25 11:54:38 -07:00
Vikash Garodia
967b2f6bcb msm: vidc: Decide DCVS after session configuration
DCVS feature depends on multiple client configurations.
Low latency, thumbnail mode, etc are few among them.
DCVS is now decided before the session starts streaming
i.e after all configuration are inplace.

CRs-Fixed: 2457035
Change-Id: I4a42ae6bafdc852e81794b69d117f5821af4841f
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-05-25 09:47:32 -07:00
Shivendra Kakrania
d783a8038b msm: vidc: Revert of 2735098
Reverting 2735098 "update video dimensions during port reconfiguration".

Change-Id: I2343cf77d23a564c3346d71dae9cd6377ae9d4e2
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
2019-05-24 22:18:31 -07:00
Vikash Garodia
05d88704e8 msm: vidc: update video dimensions during port reconfiguration
During a decode session, video output port can go through
reconfiguration. As a result, update the reconfig dimension
when client calls for g_fmt on output port.

Change-Id: Ib5f5866acbdfe107ba4693b8b94498d42f74b312
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2019-05-24 16:29:03 +05:30
Chinmay Sawarkar
8400f650f8 msm: vidc: New hfi macro for hdr10 histogram extradata
HDR10 histogram extradata is applicable only for decode.
Hence reclassifying the macro value.

CRs-Fixed: 2453471
Change-Id: I0e3784ca4b2646838ab5a002c3263a66a1c60204
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2019-05-17 16:35:15 -07:00
Akshata Sahukar
706c47da77 msm: vidc: Remove Picture Type Decode Driver Support
Remove support for V4L2_CID_MPEG_VIDC_VIDEO_PICTYPE_DEC_MODE.
Cleared related code.

Change-Id: I3b7100dfd08ee68a5033d8f6ec2cfdcfbbfbbe14
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2019-05-14 14:28:26 -07:00
Shivendra Kakrania
4ae4cb1749 techpack: video: Video driver kernel project initial snapshot
This change brings msm vidc driver from base 4.19 kernel project.
It is the first source code snapshot from base kernel project.

Change-Id: I1d600c4e9459b9013f4b607890c52644f6d94f0c
Signed-off-by: Shivendra Kakrania <shiven@codeaurora.org>
2019-05-02 22:31:44 -07:00