커밋 그래프

168 커밋

작성자 SHA1 메시지 날짜
qctecmdr
5d059c2954 Merge "iris: rename msm_vidc_suspend_locked to msm_vidc_suspend" 2023-06-15 16:11:59 -07:00
qctecmdr
2c5cd81fe8 Merge "video: driver: cleanup driver remove sequence" 2023-06-15 09:01:57 -07:00
Darshana Patil
dd06676471 video: driver: adjust opb buffers min count
Incase of split mode(either for linear color format
or AV1 film grain usecases), dpb and opb(output)
buffers are allocated in same context bank. In high
memory consumption usecases like 8k, it can lead to
OOM issues. To avoid this, for split mode, when both
dpb and opb buffers are used, honor fw min count for
dpb buffers, whereas for opb buffers choose an optimal
min count to ensure performance.

Change-Id: I287aff862d2fe36a690c1393d64f8095578baf34
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-06-14 12:54:10 -07:00
Dikshita Agarwal
84b23e5835 iris: rename msm_vidc_suspend_locked to msm_vidc_suspend
To follow the same nomenclature as the other function names
in driver, rename msm_vidc_suspend_locked to msm_vidc_suspend.

Change-Id: Iacdd6604c25f6efc61c5b6add939669f5bd26355
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2023-06-13 18:59:40 +05:30
Govindaraj Rajagopal
29d10ac07b video: driver: cleanup driver remove sequence
Remove deinit sequence calls and register devm
managed callbacks, so that kernel can invoke
then, when dev scope ends and cleansup all
associated resources.

Change-Id: I729fd21fe32d9f39240d0b743f910409d93a00c5
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-06-13 13:17:23 +05:30
Ankush Mitra
7d25fa161b video: driver: changing "foo* bar" to "foo *bar"
This change will resolve this
checker err from all directory.

Change-Id: I7b7b3af554c97fef9d81210fdf8984d2a53facbc
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-05-31 19:47:02 +05:30
Deepa Guthyappa Madivalara
2ba0f6e1e7 video: driver: operating rate changes for latency improvements
1. allow any client set operating rate (less than 2^15)
2. remove operating rate dependency for admission control
3. allow turbo for low latency case as well

Change-Id: I4b0f29c3756a592a9baedec8996653e5cb5292d5
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-05-15 16:54:49 -07:00
Akshata Sahukar
982e626d00 video: driver: Add support to 1kx1k tile for HEIC encoding
- Introduce new control to set HEIC encoder tile size from HAL
- Support 1k x 1k tile encoding along with existing 512 x 512
  tiling

Change-Id: Iaeffe421f8311d818695c3ae9af7cabcc8892043
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-04-28 10:07:48 -07:00
Govindaraj Rajagopal
c4f5dc6069 video: driver: fix queuing too many output buffers to firmware
Client is setting NV12 fmt as OP format before initial reconfig
So during input port stream_on, subscribe_input_property is
failing due to ubwc check(NV12 fmt), so DPB_LIST cap is getting
disabled, but later client is setting NV12C during reconfig.

So msm_vdec_release_nonref_buffers() during qbuf is bypassed and
release cmd is never sent to fw for pending ro buffers. Infact
entire RO handling at driver side is disabled.

Looks like due to some reason client was not requeueing same
buffers at same slot, So eventually number of pending RO buffers
increasing over the time. Once count shoots more than 256 fw
assertion happens and i.e leading to system error.

Remove UBWC check while subscribing input port properties, so
DPB_LIST willbe subscribed always and avoids above mentioned
issues.

Change-Id: I57ea0ea637ae3a57fcad430b212dcdb10f8e6d0f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-04-18 16:32:10 +05:30
Ankush Mitra
e450d8eaa3 video: driver: remove capability pointer
Remove capability pointer and allocate
memory with max cap size.

Change-Id: I7f53e3b35439f91b72f057695b6e63f71bfecc0a
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-04-05 11:58:48 +05:30
qctecmdr
547e7c4988 Merge "video: driver: add try_fmt allow checks inside state handler" 2023-03-31 13:59:09 -07:00
Govindaraj Rajagopal
c3f3af1e0e video: driver: enable memory tracking in stats handler
track internal memory usage periodically and print
memory usage stats using stats handler.

Change-Id: Idd16647dbe4aab3fc617a8f7fc0d3c81f459bb5d
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-03-24 20:03:10 +05:30
Megha Byahatti
c750ba048b video: driver: add try_fmt allow checks inside state handler
Remove msm_vidc_allow_s_fmt function and use state specific
MSM_VIDC_TRY_FMT checks inside state_handler

Change-Id: I405b9cfb89e4daadafcc05eb99e66e2b0aad328e
Signed-off-by: Megha Byahatti <quic_mbyahatt@quicinc.com>
2023-03-24 10:46:31 +05:30
Darshana Patil
fc6a238b09 video: driver: enable dynamic metadata
- enable Eva stats, hdr10/10+ as dynamic metadata.
- Make eva stats dependent on bitrate mode.
  Also remove preprocess and layer count as
  child of Eva stats.
- Make Hdr10/10+ dependent on profile.
- Adjust transcoding stats metadata based on
  bitrate mode, fps and resolution.

Change-Id: I7b110962e29db50cb321d69a0fb301950436da6f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-21 11:53:10 -07:00
Govindaraj Rajagopal
db80783d41 video: driver: handle uninitialized variables in open
In msm_vidc_open() create_singlethread_workqueue() is failing,
so msm_vidc_close() is called and i.e attempting to de-initialize
some uninitialized structures and resulting into stability issues.

So handle msm_vidc_open() failure with in same api, instead of
calling msm_vidc_close() and re-organize deinit sequence.

Change-Id: I843cf07eaf18f4ea764842fd1c87b78d115580d3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-03-03 16:47:01 +05:30
qctecmdr
95eccc81e8 Merge "video: driver: add stop cmd allow checks inside state handler" 2023-02-23 18:24:11 -08:00
Govindaraj Rajagopal
ab6770c11f video: driver: add stop cmd allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_stop function.

Change-Id: I83d81aa0f840412a4c61f15673a6246f0f84be7f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 21:05:18 +05:30
Govindaraj Rajagopal
a6e521d629 video: driver: add start cmd allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_start function.

Change-Id: I04182ee3b63fa9044acf4f40adc47ea97eaa7538
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:52:07 +05:30
Govindaraj Rajagopal
4afdecc4fd video: driver: add streamon allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_streamon function.

Change-Id: I67948831612ebb33cdd12a2e9f8561b6095e9433
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:03:52 +05:30
Govindaraj Rajagopal
3ba2cb9ed1 video: driver: add reqbuf allow checks inside state handler
use state specific checks inside state_handler instead of
relying global msm_vidc_allow_reqbufs function.

Change-Id: Iaf7f23e4e2ef9b714e3d4c2900c2753d74150fd1
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-22 20:01:03 +05:30
Ankush Mitra
e96ab4ac79 video: driver: set PM_SUSPEND in power collapsed state
Set substate PM_SUSPEND even if
video core was already power collapsed.

Change-Id: I15740d8e44fe89c6b34c0412dca1064539cdac35
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-02-17 19:57:04 +05:30
Govindaraj Rajagopal
c175e36454 video: driver: state handling code movement
state handling changes were spread across multiple files.
So re-arrange all state related handling changes into
msm_vidc_state.h/.c file.

Change-Id: I3826daa678d1e2b5ce7e74380d465e70b1b824c6
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-30 10:57:22 +05:30
Govindaraj Rajagopal
7c365bdb94 video: driver: restructure video state machine
Re-structure video driver statemachine to use
event handler. Added event handler support for
event states.

Added change to handle event depending on the
underlying state implementation.

Change-Id: Ib55c12c6cadc4d780797a5aee75d5ea61e95c94f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-27 16:31:23 +05:30
qctecmdr
db62f9374a Merge "video: driver: Modify buffer_stats logic" 2023-01-18 13:36:08 -08:00
Darshana Patil
ea34534af0 video: driver: update copyright markings to 2023
update copyright markings to 2023 in all files.

Change-Id: I6842d56c4a8fff6a7a93d0c1d4bc049041297b02
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-13 14:58:17 -08:00
Govindaraj Rajagopal
e15f3afabd video: driver: add clock residency calculation support
Add logic to derive clock residency values for each
frequency levels.

Change-Id: Iadad29d2733cb083fce627999a31dd96475b73c1
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-30 23:42:16 +05:30
qctecmdr
4f297753f7 Merge "video: driver: implement memory_ops for upstream" 2022-12-27 10:58:45 -08:00
Dikshita Agarwal
d7e518a85c video: driver: implement memory_ops for upstream
- Implement upstream specific memory_alloc/map and
  memory_unmap/free API based on standard dma_alloc_attr()
  and dma_free_attr() APIs which allocates and map dma buffer.
- Combine alloc and map, unmap and free.

Change-Id: Ie85914beb72c3976febdc9e6a11c9199f2ea4192
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-12-15 11:23:20 +05:30
Govindaraj Rajagopal
c4982fbf1a video: driver: refine core state machine
introduced core error state and added changes
to refine core state machine.

Change-Id: Ib3b94fd3798e902b7a6cfc5de45820558c89806e
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-15 07:59:45 +05:30
Govindaraj Rajagopal
3fd67c1274 video: driver: add error state support for core
Introduced MSM_VIDC_CORE_ERROR state in core. It supports
CPU_WATCHDOG and VIDEO_UNRESPONSIVE core substates.

Change-Id: I6aa700c37782d64d64cd132ea13009dda22cc8d1
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-15 07:56:38 +05:30
Vedang Nagar
b3f107df87 video: driver: Modify buffer_stats logic
For super buffer usecase, All the ETB's gets queued with updated
timestamp in hfi_buffer, therefore all the fbd's being recieved
are of different timestamp. And only the last EBD is considered
for dequeued flag and hence for remove_buffer_stat.

Therefore when first FBD arrives which has the matched TS to
the stat's TS will get skipped since last EBD in the batch has
not arrived yet and rest all FBDs are with updated TS, hence
the buffer stat doesn't get's removed from the list.

Modified the logic to add stats during hfi_buffer queue and
add stats for all sub-frames in super buffer usecase.
Modified the logic for Multi-In single-Out usecase as well.

Change-Id: I0643e6f64bdfc3cbfa67baeb1cf9157de92ce569
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2022-12-14 23:10:54 +05:30
Govindaraj Rajagopal
9b0140cf03 video: driver: add core sub_state support
Introduce core->sub_state similar to inst->sub_state.

[1] pm_suspended - moved to this substate in case of PM suspend
[2] handoff - moved to this state after successful
    handoff_regulator call.
[3] fw_power_control - moved to this state in case of IFPC.
[4] power_enable - will track core power_on/power_off status.
[5] page_fault - used to rate_limit fault logs.
[6] cpu_wd - indicates hw fired wd interrupt.
[7] video_unresponsive - moved to this state if sync cmd fails.

Change-Id: Iceb65cf404fd93aff7846860b0276307e4eab570
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-23 10:53:11 +05:30
Ankush Mitra
b35fde25c4 Video Driver: fix frame freeze for HEVC 10bit all intra decoding
1. Allow turbo for HEVC 10bit all intra decoding;
2. Add 25 percent extra to VSP cycle for HEVC
   10bit all intra decoding;

Change-Id: I794b2a896f7e9444c8979abdb15b8e673a5270ee
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 09:01:17 -08:00
Darshana Patil
4250372925 video: driver: add memory ops support
add memory ops support so that different
implementations can exist for memory_alloc,
memory_free, memory_map and memory_unmap,
dma buf attach, detach, map, unmap and
get buffer region in upstream and downstream
drivers.

Change-Id: Ifabc34e7a8b0284579c1bc4a8f477fe558d068f4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-21 16:35:22 -07:00
Darshana Patil
3362c70642 video: driver: remove skip delayed unmap functionality
Change-Id: Ibc3e8d565010aa5ac608aa648c533057c51f4bf4
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-10-20 12:08:03 -07:00
Darshana Patil
1ef323df29 video: driver: buffer flow changes
When client queued a buffer, v4l2 framework
compares the client Dmabuf with the existing
dmabuf in the bufs array at the same index.
If the dmabuf is different then v4l2 framework
would call unmap_dmabuf, detach_dmabuf callbacks
for the old buffer and then calls attach_dmabuf,
map_dmabuf callbacks for the new buffer before
qbuf callback is made to driver. If the dmabuf
is same then qbuf callback will be made directly.

V4l2 framework expects that clients recycles the
same buffers in the same indices so that when
v4l2 framework compares dmabuf it won't unmap
or map buffers.

If client recycle the buffers in different indices
still usecase works but there will be unnecessary
unmap, map overhead will be incurred.

If client does not recycle the buffers at all,
meaning every time client queues new buffers
then special handling is required for decoder
output buffers which are used for reference by
video hardware.If any buffers are used by video
hardware as reference buffers then firmware returns
those buffers with READ_ONLY flag and they are kept
in read_only list and when read_only grows beyond
some limit then driver would ask firmware to release
those READ_ONLY buffers and when firmware responds
driver would delete these READ_ONLY buffers.

Change-Id: I8a0b11c986dd0b9464895498efd8c1831a754198
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-09-26 17:24:30 -07:00
Akshata Sahukar
85d79a7a23 video: driver: remove input meta via request support
remove input meta via request support

Change-Id: If2a504455e1899c4cefb2a9142f7a92db02a45f2
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-20 11:07:39 -07:00
Akshata Sahukar
f37cc5fe6c video: driver: Introduce CAP_FLAG_META flag for metadata caps
Introduce CAP_FLAG_META flag to differentiate metadata caps
from non metadata caps.

Change-Id: I7a3d2c5fb952e5d829002a04d11fa7b05b2c9297
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-09-06 13:42:20 -07:00
Darshana Patil
c4beadb5d2 video: driver: fixes for upstream/downstream driver compilation
- do not use vidc_v4l2_extensions.h for upstream driver compilation.
- resolve compilation issues in upstream and downstream driver due
  to above change.
- add volatile flag in the database.

Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
Change-Id: I1985cae29a459af2250f7044d85c5cd22cdd68f7
2022-08-22 16:51:31 -07:00
Dikshita Agarwal
90fabfb02b video: driver: remove support for V4L2_EVENT_VIDC_METADATA
remove support for V4L2_EVENT_VIDC_METADATA as it is not
being used.

Change-Id: Ia375d0410d144d2e3b9cd78bc0fde16cfa0d0884
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-08-22 16:50:50 -07:00
qctecmdr
1ee1d9c8e5 Merge "video: driver: define slice delivery as boolean control." 2022-08-03 10:39:31 -07:00
Dikshita Agarwal
f1a32f5a86 video: driver: define slice delivery as boolean control.
Make slice delivery a boolean control instead of menu.

Change-Id: Iedf8e0df882d61e82661c7f557473d3f7b49215a
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-08-02 12:28:44 +05:30
Govindaraj Rajagopal
473e46f0cc video: driver: add buffer statistics logic
Added change to print etb, ebd, ftb, fbd,
(ebd-etb), (fbd - etb), (etb-ftb) wallclock
time in ms.

It will help to debug perf issues.

Change-Id: Ideaecb2d51763711d6628729aa0f9056d05f0d51
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-08-01 17:55:39 -07:00
Darshana Patil
e4360dc18e video: driver: misc fixes for venv project
Change-Id: I4b5495ac4669a1e4519ac855d6b995e9d259f335
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-08-01 17:21:24 -07:00
Dikshita Agarwal
7d1fbd07cf video: driver: redefine private v4l2 macros in common file
Define vidc macros corresponding to private v4l2 macros
defined in v4l2_vidc_extensions.h file in msm_vidc_internal.h
and use the same wherever applicable for successful
compilation of upstream driver.

Change-Id: I2c7b3741d29996beb35b08b9c6dbd88876bb6ca6
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-08-01 17:59:08 +05:30
Dikshita Agarwal
c5c78e3ba2 video: driver: move v4l2 to vidc mappings to target specific file
Move mapping of v4l2 to vidc macros for codec, color format,
color primaries etc to target specific file to restirct the
usage of private v4l2 defines to target specific file.

Change-Id: Ie83968cb944c756e55b6514c496c0b23c5d16413
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-29 12:30:10 +05:30
Dikshita Agarwal
fd5d2c059b video: driver: use CAP_FLAG_DYNAMIC_ALLOWED flag to allow ctrls
Currently ctrl_id is being used to decide whether to allow or not
certain control dynamically i.e. after stream on.
Use CAP_FLAG_DYNAMIC_ALLOWED to do the same instead.

Change-Id: I56bf5e725ae7bd4ece8aa2bde0aa84c42e759c17
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-21 23:37:14 +05:30
Darshana Patil
fb1ecb69d0 video: driver: release internal buffer as part of start/resume
Change-Id: I45469c0a569fbc282aa1dbd217654e49eb50f54f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-30 15:18:08 -07:00
Darshana Patil
10794c2968 video: driver: initial state machine changes
- hierarchical state model which comprises of
  top level states and sub states
- top level states include OPEN, CLOSE, ERROR,
  INPUT_STREAMING, OUTPUT_STREAMING, STREAMING.
- sub states include DRAIN, DRC, DRAIN_LAST_BUFFER,
  DRC_LAST_BUFFER, INPUT_PAUSE, OUTPUT_PAUSE.
- follows deterministic approach for key sequences
  like DRC, DRAIN and last flag handling i.e none
  of these events are ignored or discarded.
- removal of auto start of firmware input port as
  part of ipsc handling.
- introduction of hfi commands for host controlled
  PAUSE and RESUME of firmware ports.
- introduction of information last flag packets
  for DRC and DRAIN when FW has insufficient
  output buffers.

Change-Id: Ie8c8f44af464d06f5a7bb76822f749c9874f869a
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-29 10:47:54 -07:00
qctecmdr
395e8686ec Merge "video: driver: Use max bitrate depending upon session" 2022-06-01 21:40:44 -07:00