Commit Graph

35 次程式碼提交

作者 SHA1 備註 提交日期
qctecmdr
b0513bcda8 Merge "video: driver: check for drain last flag for decoder only" 2022-07-01 23:37:56 -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
Govindaraj Rajagopal
06643c1de9 video: driver: fix use-after-free issues with __read_queue() api
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>
2022-06-29 09:17:02 +05:30
Vikash Garodia
e3da5c43e2 driver: video: Add critical priority and reserve duration
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>
2022-05-02 11:17:18 +05:30
Dikshita Agarwal
8f0e12cc93 video: driver: add support for cyclic intra refresh
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>
2022-04-01 11:08:19 +05:30
Darshana Patil
7c4952934b video: driver: packetize dynamic controls with buffer
packetize dynamic controls set via request api along
with corresponding input buffer under the same hfi header
and queue to FW.

Change-Id: I8bf82f7ccb1ab16c42ce02189a208f5f7cb8dc70
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-03 15:08:02 -08:00
Govindaraj Rajagopal
60c04ed08d video: driver: enable session stability testing
Enable session stability test support.

Clients can trigger session stability through debugfs as follows:
echo <trigger_val> > /d/msm_vidc/core/trigger_stability
u64 trigger_val provides:
    <payload><sub_client_id><stability_type>
    stability_type : 0-3 bits(one of the HFI_STABILITY_TYPE_*)
    sub_client_id  : 4-7 bits(1 - CCE, 2 - VSP, 3 - VPP, 4 - CPUSS)
    reserved       : 8-31 bits(Not used)
    payload        : 32-63 bits(depends on stability_type)

For e.x, to VCODEC_HUNG on CCE hardware module for 5 consequtive frames.
adb shell "echo 0x500000011 > /d/msm_vidc/core/trigger_stability".

Change-Id: I604f0430e3ab905504c4f0b7c84b157a5d464958
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
aeabb39378 video: driver: Change format specifier and API clean-up
-Removed unwanted functions
-Removed unwanted part of code from function definitions
-Added proper format specifier according to the data type.

Change-Id: I700202f1cf588506b329d202ce3e2729c027dcae
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Govindaraj Rajagopal
6e916441fc video: driver: Removed unused macro and variable
- Removed unused macro
- Removed unsed constant variable.

Change-Id: I43ff39d498637fb0aa721660fae0ca3dd7073e88
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-01-13 17:29:22 +05:30
Vikash Garodia
f3ff48e82f video: driver: reset video_cc_mvs0_clk_src clock_rate
Reset video_cc_mvs0_clk_src value to resolve MMRM high video
clock projection issue.

Change-Id: I0c549d7537a82792e9de708c96c265f0dce5908d
Signed-off-by: Vikash Garodia <quic_vgarodia@quicinc.com>
2021-12-09 17:17:52 +05:30
Govindaraj Rajagopal
3d9556402b video: driver: improve error handling on read_register
Currently video driver ignoring error value returned by
__read_register() api. So added changes to improve error
handling.

Change-Id: Ia3968f0f900915b46b96c5e790af9be02389e841
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-18 08:38:32 +05:30
Govindaraj Rajagopal
10a6e51ef2 video: driver: use readl_relaxed_poll_timeout instead of register_read
Upstream recommends to use readl_relaxed_poll_timeout instead of reading
register in a loop with sleep. So replaced with readl_relaxed_poll_timeout
in all possible places.

Change-Id: Ide1758314128751a6876678d4265bb77c52de25f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-08-13 14:04:51 +05:30
Priyanka Gujjula
d9696271a0 video: driver: Migrate to threaded irq
Migrate to threaded IRQ from workqueue based
IRQ handling.

Change-Id: I5cf2ecaa6d9b8d67698bbaf41e8d5ff77249ab1c
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-07-20 01:32:51 +05:30
Govindaraj Rajagopal
55795168af video: driver: force flush debug queue packets in error scenario
During power_collapse & core_deinit sequence, always flush debug
queue irrespective of firmware logmask, to get more info about
failure.

Change-Id: I4ef328d27a77eb0807df6dc33fe0b2b92bf1feda
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-25 18:54:41 +05:30
Maheshwar Ajja
c2b39b9056 video: driver: amend power on and power off sequences
Amend power on and off sequences for iris2 video hardware.

Change-Id: Icada0b95ba5990a6911803ee9fa650a296c357db
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-06-09 16:42:48 -07:00
Chinmay Sawarkar
83f9b26441 video: driver: Set secure mode in encoder
Enable HFI_PROP_SECURE when secure session is enabled
in encoder. Same behaviour as Decoder.

Change-Id: I5edfe3d735fda8edea9e491ae17546945b4431a1
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-06-07 13:45:43 -07:00
Govindaraj Rajagopal
53578c8ec2 video: driver: fix core lock acquire and release sequence
[1] Added return type to strict_check() api and bail out if
    strict_check fails.
[2] Fix all the failures with #1.
[3] Added WARN_ON() for strict_check failure.
[4] Ensured &core->lock is acquired before calling below api's.
    - __write_register
    - __write_register_masked
    - __iface_cmdq_write_relaxed
    - __suspend
    - __resume
    - venus_hfi_core_init
    - venus_hfi_core_deinit.

Change-Id: I7f0a3ca6c2aec2758220c90bff9260367f10820b
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-20 14:34:11 +05:30
Mihir Ganu
113c10c489 video: driver: Enable Subsystem Restart (SSR) testing
Enable Subsystem Restart test support.
Clients can trigger SSR through debugfs as follows:

echo <trigger_val> > /d/msm_vidc/core/trigger_ssr

u64 trigger_val provides:
  /* <test_addr><sub_client_id><ssr_type>
   * ssr_type: 0-3 bits
   * sub_client_id: 4-7 bits
   * reserved: 8-31 bits
   * test_addr: 32-63 bits */

Change-Id: If23fce3084de00461f1e5cc57884e10d15ad66a9
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-03-29 10:21:27 -07:00
Govindaraj Rajagopal
1524ddc445 video: driver: remove smmu_fault_work_handler
Remove separate fault_work_handler and print all needed
debug info as part of smmu_fault_handler callback itself,
to avoid race between fault handler invocation and core
deinit sequence.

Change-Id: Ib47e3d457a5a3e33497c71d5920382cb43baed79
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-26 16:37:52 +05:30
Govindaraj Rajagopal
a7bdc410ef video: driver: add support to print noc error log registers
Added support to print noc error log registers at below places.

- smmu_fault_handler path
- handle_system_error path.

Change-Id: I9e195bd82a2058f533df8713368e61f57b537b87
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-25 16:10:49 +05:30
Darshana Patil
481a6117d8 video: driver: update license year
update license year to 2020-2021

Change-Id: I5a67bf49c386e86337bc7449ded08d186fc9a280
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-03-01 18:07:35 -08:00
Govindaraj Rajagopal
f02bbaf836 video: driver: enable encoder superframe batching support
Added HFR/HSR superframe handling support for encoder.

Change-Id: I28ced3f223cd78d00b1a654a79bcac3b02f378dc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-22 11:52:43 +05:30
Rohit Kulkarni
2155605082 video: driver: update fw load-unload functions
Update the fw load and fw unload functions to
make them non-static to allow calls from other
files.

Change-Id: I387a884a1274354e78defdf00245bd0108dd61fc
Signed-off-by: Rohit Kulkarni <rkulkarn@codeaurora.org>
2021-02-09 17:30:37 -08:00
Chinmay Sawarkar
899cd05a06 video: driver: Enable video subcache
Enable video subcaches.

Change-Id: I193c5dd6bb02f87c4576f5b9dbbeee31116e1858
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-05 15:31:22 -08:00
Maheshwar Ajja
58cd1120ee video: driver: add support for instance states
Add support for all the required instance states and
move the states accordingly.

Change-Id: Iac1046ab8c7a0116df6ed3069d566c7a1b65e61c
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-12-30 12:09:01 -08:00
Darshana Patil
cff8298acc video: driver: new workhandler for inst events
create a new work handler and post and handle
events like psc.
introduce reuse concept for internal buffers.

Change-Id: Ibeaabae1b5923681756e959389df00b287206fb6
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-12-23 19:06:39 -08:00
Maheshwar Ajja
7509e9f16b video: driver: add power changes
Add or amend below functionalities
- scale clocks
- scale buses
- buffer counts
- buffer sizes

Change-Id: I3cddbb7112cd85a84cf86256134059f52b66a3af
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-12-21 15:31:54 -08:00
Maheshwar Ajja
bae72cb900 video: driver: add scale clocks and buses functions
Add clocks and buses scaling functionality.

Change-Id: Ifa61043a938bc5c1990f6baf1777a3f2270fc77d
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-12-16 15:59:54 -08:00
Akshata Sahukar
2bbf35063f video: driver: fixes for streamoff/streamon
Changes to fix streamon/streamoff functionality.

Change-Id: Ibefa04c5812e0f5a42c578e72eea7650e37c18b0
Signed-off-by: Akshata Sahukar <asahukar@quicinc.com>
2020-11-02 11:54:01 -08:00
Maheshwar Ajja
78857beace video: driver: add buffer handling support
- Add queue buffer support
- Add dequeue buffer support
- Use multiple plane buffers instead of single plane.

Change-Id: I911784a1fa4b8a4b5d3fd35049379ea35d4d52b0
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-11-02 10:35:16 -08:00
Darshana Patil
c9dec2599e driver: vidc: add support for open, close, set codec
add support for session open, close and set codec.

Change-Id: Ic2f7a953a0d90215fab0a0d141957c3eb1a8cc78
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-09-30 14:10:01 -07:00
Maheshwar Ajja
b5c03abc93 video: driver: add decoder controls
Add decoder controls and subscribe parameters

Change-Id: Ib4157b7f1dc8ce3c0b49f6bf7f6586883bf3b547
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-09-30 14:08:41 -07:00
Darshana Patil
9a854613cd msm: vidc: response handling
add response handling for commands, properties,
system and session errors.

Change-Id: I87a8cba136979d425d978dfe55317a3deb081c53
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2020-09-30 14:08:32 -07:00
Maheshwar Ajja
6f3faa8d04 video: driver: add decoder input streamon support
Add decoder input streamon functionality which
include internal buffers support as well.

Change-Id: Ifb5afa51a29270705863c273d1ae08310666895d
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-09-30 14:07:13 -07:00
Maheshwar Ajja
6f107f7e35 techpack: video: add video driver
Add initial video driver files.

Change-Id: Icd48bbf31e435cf36f149d6c3267cf3a4d7913b3
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2020-09-24 23:56:26 -07:00