Calculate video decoder load based on max of crop and
input port resolution as few clients might not set
resolution on input port in which case load is not
proper before streaming started.
Change-Id: Id95d42e4cb3d992f759ce3388a8aeb55fadf16d7
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Treat resolutions above (4K + half 4k) as 8k session instead of
simply treating above 4k resolutions as 8k sessions. Similar update
for 1080p and 720p resolutions as well.Based on above conditions,
support or reject a session.
Change-Id: I7be70b4c2b6e96ced6da2443f85e440c45fb616c
Signed-off-by: Darshana Patil <darshana@quicinc.com>
[1] Disable MMRM if platform feature
does not support.
[2] Query for scaling support from
mmrm driver and enable/disable
based on queried support
accordingly.
Change-Id: I34cf9a9e150b0823828507e3f5d680aae6eb14d4
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
Currently enable_bugon debugfs feature not working for WD timeout
cases. So added change to support that usecase.
Change-Id: I0cb3e6ed34d58c7969c727dea77f4fa695923c25
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Cancel batch work when core is suspended due to
pm suspend.
Change-Id: I5c6e4f0eb0883a9c3cd2711f65e0d74a6cced310
Signed-off-by: Priyanka Gujjula <quic_pgujjula@quicinc.com>
Currently MSM_VIDC_BUF_DPB buffer allocated and queued to firmware
as part of output port streamon. Sometimes firmware raises b2b ipsc
with only change in fw_min_count. So client will not follow port
reconfig sequence and calls directly HFI_CMD_RESUME on output port.
So firmware holds only prev set of DPB buffers, which is not sufficient
and it continues to wait for further DPB buffers and that is leading
to stall and testcase fails. So added change to requeue new set of
DPB buffers, incase of b2b ipsc(with only change in count).
Change-Id: I213c752be4ca9dc16f838ab2990c996c4d78e95f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Currently stage and pipe is configured from output port start/resume
sequence. During VSP processing FW has no clue about stage, so default
it picked 2 stage. Later host sets 1(due to < 720p) stage at output
port. VSP is already started operating on input frames. So this
mismatch in stage settings was leading to vcodec HW hung issues.
Setting STAGE, PIPE settings at input port start/resume to avoid
above mentioned issues.
Change-Id: I7febe46d45c8e30a29b58d725d5298220fdbd8b2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
There are 2 possible race issues with msm_vidc_stats_handler.
[1] msm_vidc_close acquired inst->lock and called cancel_delayed_work,
by that time stats_handler already fired and incremented inst->kref
via get_inst_ref. Close sequence releases the lock and called
put_inst().
So now inst strong ref is held by stats_handler, which will acquire
inst->lock and schedules new stats_work and does put_inst. inst->kref
count reaches zero and it will free inst struct(using close_helper).
So that will lead to use-after-free crash at core kernel side.
[2] msm_vidc_close acquired inst->lock and called cancel_delayed_work,
by that time stats_handler is scheduled. So process_one_work() from
workqueue is ready to call stats_handler api. But before it invokes
stats handler(context switch), msm_vidc_close sequence continued to
run and completed the close sequence and called put_inst. So inst
struct got freed up(because inst->kref count reached to zero). Now if
core kernel(workqueue) attempts to invoke stats_handler by calling
worker->current_func(work), will lead to again use-after-free crash.
Added changes to avoid above mentioned issues.
Change-Id: I55bc33a753f4dbae4a8cdc6373b5465d183da3bc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Possiblity of invalid ptr dereference in release_buffer_done
sequence. So added changes to handle this scenario.
Change-Id: I0f45e07d709d0fd300a172b564031e40eb07ff00
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
Host needs to ensure FW atleast have 2 buffers available always,
one for HW processing and another for fw processing in parallel
to avoid FW starving for buffers.
Change-Id: I244e0170944b0b7ec342aa9b1b141b30af5bf606
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
- send error '-EAGAIN' when there are no inactive sessions,
HAL will retry with low priority.
- send error '-ENOMEM' when there are inactive sessions,
Frameworks will close the inactive sessions
Change-Id: Id28a6f3c5f9d537a2789ef1522505b6ebedccc0b
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
Currently, the below info printing as a error.
"msm_vidc: err : ffffffff: codec: power collapse already scheduled"
When multiple session is running, the above log will print multiple times &
this is not an error, so added change to print above log as info.
Change-Id: Iad961c29212579ee46a4cea47f7762f714c5e7ba
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
/d/msm_vidc/core_clock_voting will modify only clock rate
and not ddr and llc bandwidth.
example usage:
adb shell "echo 444000000 > /d/msm_vidc/core_clock_voting".
introduction of /d/msm_vidc/ddr_bw and /d/msm_vidc/llcc_bw
which will modify ddr and llc bandwidth respectively.
example usage:
adb shell "echo 5000000 > /d/msm_vidc/ddr_bw_kbps".
adb shell "echo 7000000 > /d/msm_vidc/llc_bw_kbps".
Change-Id: If4aca728cae212630928dda69a38310d8268b5e1
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
increase clockrate and bandwidth by 25percent for
960fps decode session and disable dcvs.
Change-Id: I40aef0a9b8f0950b559ee301549869e20e881a40
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
[1] Currently enable/disable clock(video_cc_mvs0_clk_src) not called. So
updating clock reset value to MMRM is getting skipped. So MMRM has high
projection
[2] __scale_clocks() api is not considering scaling factor, while
setting clock rate.
Added change to address above 2 issues.
Change-Id: I4e96556f9b9d659c436e77d03f8d0dd471a50226
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Avoid setting same GOP size to fw dynamically to avoid unnecessary
generation of IDR frame from firmware.
Change-Id: I50c61e9f86ebc9c8a3834fbceb525666b7b194bb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
- Added changes to print frame-number for each ETB, EBD, FTB, FBD.
- framenumber will be helpful to detect logdrop in perf analysis.
Change-Id: I1b6c8fdbeb2f2003e69d02cd5d871535e8e73c42
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
Currently, statistics is printing for every 2 second
And these delay is hardcoded.
So changes added to update the statistics delay from the command-line.
- adb shell "echo 200 > /d/msm_vidc/core/stats_delay_ms"
- adb shell cat /d/msm_vidc/core/stats_delay_ms
Use above command to update & read statistics delay.
Change-Id: I523a870203ee460d1dba8208b798f28253407e73
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <gdoddabe@codeaurora.org>
Video driver clk scaling is through mmrm. So without informing
to mmrm if we disable_clk, then mmrm will hold stale peak_current
values and that will lead to incorrect calculations at mmrm side.
So always request to set lowest clk corner to mmrm before calling
clk_disable_unprepare() api.
Change-Id: I3e54249430ec4e886afb42f5af6863c7e40686c4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
Driver is discarding input port settings change (ipsc) event
before sending stop input to firmware and also in case of
input port is still in streamoff state while processing
pending events. There is a chance that driver may not discard
ipsc event if firmware raised ipsc after sending stop input and
also driver may not discard the pending ipsc if client quickly
streamon the input port before pending events processing scheduled.
So discard pending ipsc in the streamoff input port after stop input
to firmware and wait for stop done is successful.
Change-Id: I518cebe1142235463b1ccd851ac151ad80036f95
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
add checks to limit max number of sessions supported based on
resolution.
max number of 720P sessions: 16
max number of 1080P sessions: 8
max number of 4K sessions: 4
max number of 8K sessions: 2
Change-Id: I2a784a0d28ba050923bdc7f42a21ee9801d01d86
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Allow one 8k + one 4k realtime sessions.
Maximum allow two 8K sessions which includes RT and NRT sessions.
Change-Id: I68acfc4942c5c930bed7d9584cd82f2667010136
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Fill correct opb color format for bus voting.
Change-Id: I219172492563d10582233c54578115ab48b9b1ff
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
Currently allowing 15 concurrent video instances instead of 16.
Fix this to allow 16 instances.
Change-Id: I515625e47e324cd1c7ba5a83c1363705bca64721
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>