Added async probe for video driver to reduce bootup latency.
In insmod/probe sequence, registered all video sub-devices with
component_model framework, so that once all sub-device probe
completes master/vidc node bind() callback willbe called. So as
part of bind, video driver will do core_init sequence. Due to
async probe all sub-device probe willbe called asynchronously
from different threads.
During rmmod/remove sequence master/vidc node may not be called
first and instead child node remove might be called, which will
intern calls component_del() api. 1st call to this api will
internally invoke unbind() callback of master. So as part of
unbind() video driver will do core_deinit() sequence.
of_platform_depopulate() will act as sync point on master node.
Which will make sure all residual sub-device removal completion.
So it will guarantee video device/master cleanup happens only
after all sub-devices removal.
Change-Id: Ia40d4b1aa54633ef26fff2c207da78f15e305363
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
8k@30 fps encode has a very low margin for sw/fw at 338MHz.
Hence, increase core clock little bit(5%) to move to the next
corner i.e., 366MHz.
Change-Id: Idebde3c726086ec49d1fb0ca4525953dd3a30ba9
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
180fps is not a standard value, so we need to change
MAXIMUM_OVERRIDE_VP9_FPS to 200.
Change-Id: Ia32fc20598b8a2908ec3057dd0b00b40ea429b42
Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
Subscribe output metadatas in both input and output ports
so that metadatas which are detected in bitstream before
output port is started are not missed.
Example: AV1 HDR metadata which can be part of first ETB
(sequence header OBU + metadata OBU)
Change-Id: I77d75b42dcee79e0258ba96e6ab86d06ead2eaf4
Signed-off-by: Mihir Ganu <quic_mganu@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>
Internal Buffer(CMD_BUF) size calculation is changed from (3 * 4) to 48
in firmware for H264 decoder. Aligning with same calculation in driver.
Change-Id: I974bca7d2e128cee24bf237b6f9ea606f386031d
Update all functions in msm_media_info.h to use vidc color formats
instead of v4l2 color formats macros to restrict the usage of private
color format defines in only helper functions.
Change-Id: Ib308c76af7b16ddac93023202191a47b21d68f5c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Use cap_id instead of ctrl_id while assigning the respective
hfi values for a v4l2 control and vice versa.
Change-Id: I42f3733a28b4b00ca04605dfc1d2ef0a6fb7833d
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Instead of using private v4l2 ids, use cap_id while handling
different caps in s_ctrl and g_ctrl ops.
Change-Id: I4d5dbb151ef5bc2dd348a06663e0beae0756d761
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
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>
- Remove caps related to private controls.
- Update parent, child dependencies for caps if not
standard.
- Keep the caps which doesn't have v4l2 control associated
and are used internally for some features.
- keep non-standard but good to have features by removing
the v4l2 control associated.
Change-Id: I31326c94edf3ef864f30765f44852b11c5eaf6ac
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Split control code into msm_vidc_control.c and
msm_vidc_control_ext.c files.
Change-Id: I95f13d66f33fb75da4ebaa08e24bf31fe5de55b4
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Increase decoder maximum FPS and Operating Rate
to 960.
Change-Id: Ic3634bb0c78bc9dc27e732147bb0cc65d8ccfc4a
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
Adding driver support for anorak(Halliday).
Change-Id: I65239264758a1cc462ef6c458cb0a12f1fcdaf53
Signed-off-by: Sachu George <quic_sachgeor@quicinc.com>
As part of stop done, check if firmware has returned drain
last flag only for decoder.
Change-Id: I9738fe316b4e3081a8ab9c8066ef5f59ac0720f0
Signed-off-by: Darshana Patil <quic_darshana@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>
Incase of synchronous cmd(HFI_CMD_INIT, HFI_CMD_STOP, HFI_CMD_CLOSE)
timeout cases, video driver will attempt to do core_deinit sequence
and will free all interface queues mappings as part of core_deinit.
If at same time ISR handler is fired then reverse thread will attempt
to dequeue packets from message and debug queue. Reverse thread will
not acquire core->lock for performance reasone. Dequeueing packets
without acquiring core->lock might lead to use-after-free issues.
Uploaded change to address above mentioned issue.
Change-Id: I2047b28d69611129c4fdefcfb8a843c895e11dbb
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@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>
As part of firmware stress test with QP range of [0, 5],
FW gets a divide by zero exception with QP 0, and RC
validation happens with QP range of [1, MaxQP].
Modifing Min QP from 0 to 1 for 8 bit and from
-12 to -11 for 10 bit usecases to avoid multiple FW issues.
Change-Id: I29d8fd785cfafbcb1b73984b3f79900307c22c10
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>
delete fence node from the list and then call
fence_put(). This fixes random crashes in fence
testcase
Change-Id: Ib2cdc3a4046a6065bff991fdebe178dddc8847b2
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
Sometimes uninitialized local pointer variables were passed to
msm_vidc_vmem_alloc() call for allocating memory. Uninitialized
variables might garbage value, so msm_vidc_vmem_alloc() is
treating that double alloc request and returning error. So i.e
leading to undefined behaviour.
For e.x, msm_vidc_update_input_cr() call will never add any
entries into &inst->enc_input_crs(due to above mentioned issue),
So i.e leading to populate invalid input compression ratio in
encoder usecase.
Change-Id: I4507b343bee8eec7252cf946ad8d3120efd7bacb
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Calculate AV1 VSP cycles using calculations in Kalama perf model.
For legacy codecs, VSP cycles are still calculated using
legacy MB_CYCLES_VSP.
Change-Id: I2535924d650bffd4da32e187fe9e84a27d03ad37
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
1. do not update input_rate until 30 inputs are
received.
2. Fixes unwated downgrade from RT to NRT in UHD cases
Change-Id: I8d38a64829b44a0e335b69329ac5279a7b8a782d
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
Add mising capabilites in msm_vidc_waipio.c
for the changes done in msm_vidc_kalama.c
Change-Id: Idc75533162c977333efb4caec992ee13408ce422
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
For AV1 bitstreams with film grain, split mode is used for
UBWC colorformats as well. Consider split mode to calculate
bandwidth votes.
Change-Id: I98bf07b8be7f0e829af5e55ed6d0c3659ae099f2
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Optimize HEVC Bin buffer allocation by allocating 25% additional
bitstream buffer size for 10 bit HEVC usecase and avoiding the
extra memory allocation for 8 bit usecases.
Change-Id: Iebbedf43e80fad852807349cbe7f70cf7a632a73
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>