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>
Introduce SUPPORTS_REQUESTS cap to have different caps support
for upstream and downstream driver.
Change-Id: Ib8bae21ba3fa6d65236954e0728fa30e20d7b375
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
Earlier Kernel Version were using struct dma_buf_map
and latest Kernel using struct iosys_map and
MODULE_IMPORT_NS(DMA_BUF) to import dma buf namespace
Change-Id: Ida6535fb2e3426b10264efe01e3a343fd3a1e127
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
Introduce DEVICE_CAPS capability to have different caps support
for upstream and downstream driver.
Change-Id: Ife73ab8c3b6ef9b47ef844883d9fa18e469d9188
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
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>
Split HFI queue functions in separate file. This will
unload venus_hfi and also will make possible to reuse/shared
with other drivers.
Change-Id: I16155e649f216afc6f26db76b565aad28b114cc7
Signed-off-by: Stanimir Varbanov <quic_c_svarba@quicinc.com>
- 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
Support only 4 total layers for hevc non vbr rc type session
as per PRD.
Change-Id: Ifc425de75804552717919e6be71788dd59fb086b
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
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>
Added new capabilty changes to support slice based decoding.
This feature basically enables to decode the given input in terms of
slices and deliver single output to the higher layers when all slices
decoded in a frame.
When HW receives the slices then it will start decoding the slices,
instead of waiting for all the slices belongs to same frame.
So this will help to achieve lower decode latency.
Change-Id: Id107b34baba6d7b4a88238e232e8bf4a0fd6e58e
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Add vui timing info control with default
value as disabled in driver.
Change-Id: Ibaa45303fe389a0120d487fe3b6ff336e721f359
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
Since spin lock for fence is per session based and stored in instance
memory, by the time fence consumer released the fence, driver close
might be called and instance memory might be cleared. So, when fence
consumer released the fence, at the time of fence release callback,
this spin lock might nt be available. This race condition is resulting
into device crash after fence playback session ends. Avoid this by
using per fence based spin lock, which decouples it from instance
memory.
Change-Id: I12d6976c0bac3f0211bb16e24009603b37471ef3
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
Certain codecs/use cases require larger COMV buffer sizes to achieve
performance. Introduce a property to set COMV bufcount and calculate
COMV buffer size based on the bufcount.
Change-Id: Ib0ed8afe77708dc453cbcc121bcd8606db637152
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
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>
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>
- 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>
For HEVC 8 bit usecase, QP values are being capped
from [-11,51] to [1,51]. Modifying the same in
CAP_TO_8BIT_QP macro.
Change-Id: Id17fab4c62770140131f0f8454fc480090732d0b
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
__flush_debug_queue() currently uses core->response_packet
or core->packet for flushing debug queue. So these were
allocated only 4096 bytes, but in read_queue(), boundaries
were checked against VIDC_IFACEQ_VAR_HUGE_PKT_SIZE macro
which is of size 1024 * 12 bytes.
So if FW log packet size is in between 4 KB to 12 KB then
read_queue() allows memcpy() into core->response_packet
or core->packet that will lead to redzone corruption issue
with adjacent alive/valid allocations i.e futher lead to
kernel panic at kfree() sequence(during object validation).
Uploaded change to use same sizes during allocation and
read_queue() validation.
Change-Id: If82766c1479d7589605386f3e314ff2ccd97f6d0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
1. Introduce new v4l2 control to get HAL session id and
print the same in driver to have unqiue session id
between HAL and driver
2. Copy input buffer timestamp into input meta buffer
to track input meta buffer done at HAL side. Required
specially for fence use case.
Change-Id: I146b153fa0baea3b684a482de5da19e736df3736
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
1. Host will use HQ quality mode for all INTRA encoding case
2. Cap bitarate and bit rate boost to max bitrate of current
session config
Change-Id: I8e8d19998ebeff992c290fbd18c072b2b93ffef2
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
1. add DolbyVision metadata cap and V4L2 id;
2. Increase decoder persist buffer size;
3. Increase decoder output meta buffer size;
4. Increase encoder input meta buffer size;
5. Parse buffer overflow flag and set buffer flag
accordingly;
Change-Id: I8fa5e89068dd479033d28f627e585edc3a1c58bb
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
Add support for 'HFI_PROP_SUBFRAME_INPUT'.
Payload '1' indicates that input buffer is
processed. However, FW expects more inputs
to construct a full YUV output buffer.
Overloading 'MSM_VIDC_BUF_FLAG_ERROR' code to
ensure HAL work completion
Change-Id: I05b24a50e587dfd96457af508267843ac3840fbf
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
Subscribe and enable HFI_PROP_TRANSCODING_STAT_INFO property
in order to enable transcoding stat for decoder.
This stat is used further by encoder to improve encoder quality
decision for transcode case.
Ideally we want to avoid CAC-BRS multiple times for same encoded bitstream.
When user does recording (1st encode), So we have CAC enabled bitstream.
Now, if user wants to send it via some app.
So, it will be decode -> (optional GPU) -> (2nd) encode
For 2nd encode -> we would like to not apply same CAC. It needs either tuning.
But we don't have a way from bitstream to know whether it went via CAC.
This feature enables to use the stat info received from decoder to fine tune encoding.
Change-Id: Iaf640878f5554b16aad3314ba4e26f99638c43af
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
Create and use single spin lock per session (per fence context)
rather than creating spin locks per dma fence to possibly
resolve flickering in video playback.
Change-Id: I01286ae375dfedc0da26a1be4ded1bd1e02767ba
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
Complexity parameter defines the encoding tools used
during an encode session. Higher the complexity implies
more quality with advance encoding tools used.
Keeping the default value as moderate or acceptable
range.
Change-Id: I3ee66d3a6612d5d60cd63a0698a4248f48ee8e2d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Critical priority - A video session which is prioritized above
all concurrent sessions. Such sessions have low latencies and
at the same time they cannot be rejected due to overload.
Reserve duration - Duration by which a session reserves the
video hardware for processing frames from that session.
Both the above aspects are implemented with these changes.
Change-Id: I58aef5f239e5ee106201d6819d2228784f0f0ad0
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Add support to enable slice encode delivery for
HEVC and AVC codec. Basically in this mode, each
encoded slice is given as a separate FBD to the client.
Change-Id: Ia30fde9abaf2b38fb486113807fbb7f19110225c
Signed-off-by: Chandrakant I Viraktamath <quic_civirakt@quicinc.com>
Encoder preprocessing feature requires additional cycles
and bw to support this feature if it is enabled.
Change-Id: I46de42dd0cb0d5a7cd9fdf00beeaefd50e40798e
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
- Allow dec sw fence enablement only if decode order is set and
non interlace type session.
- Enable low latency mode if sw fence is enabled.
- Signal fence if FBD length > 0.
Change-Id: Ib59c2de51f621b796e68fe2aba68d9fca3ff4272
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
1. adjust client set non-realtime priroty with NRT_PRIORITY_OFFSET (2)
2. if total mbps is more than max_mbps
a. allow encode session by reducing decoder sessions priority by 1
b. allow decode session by moving it to non-realtime session
in order to not disturb the ongoing sessions
Change-Id: I96fd2ac75c123d681982fb9a2c06ac51d15bd59a
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
For VPSS, FW requests more bandwidth from HW.
In order to support inline processing, FW introduced
request preprcess property.
Enble this property only when following conditions are met:
- CAC-BRS is required
- don't have EVA stats.
- Upto 4k@60 fps, max( frame rate, operating rate) <= 60
Change-Id: I3cf83483d9320e5dfe20617b37a54b9d5fbcffd8
Signed-off-by: Mahesh Kumar Sharma <quic_smahesh@quicinc.com>
Currently driver supports only random intra refresh, extend
it to support cyclic intra refresh too.
Cyclic intra refresh is supported dynamically as well.
- If intra refresh type is set and num of LCU’s to be refreshed
are non-zero before session start, intra refresh will be enabled
throughout the session.
Any further dynamic settings in the number of LCU’s including 0
will be honored accordingly.
- If intra refresh type is set and num of LCU’s to be refreshed are zero
before session start, intra refresh will be disabled.
When client sets it to non-zero value dynamically, driver will set
HFI_PROP_REQUEST_SYNC_FRAME with
HFI_SYNC_FRAME_REQUEST_WITH_PREFIX_SEQ_HDR.
Driver needs to send HFI_PROP_REQUEST_SYNC_FRAME only at time of
CIR Enable, no need to send at time of disable/enable again.
Change-Id: I10a2fb22d131353721ee658213ed807ce0794009
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>