提交線圖

468 次程式碼提交

作者 SHA1 備註 日期
Govindaraj Rajagopal
3e4248dfb0 video: driver: optimize buffer pool implementation
- Maintain free & busy pool to track buffers separately
- track double-free cases during msm_memory_free()
- track memory leak, by checking busy pool buffer count.
  it is expected to be zero at the end of a session.
- maintain common api's to init, alloc, free, destroy
  for all below buffer types.
    - struct msm_vidc_buffer
    - struct msm_vidc_alloc
    - struct msm_vidc_map
    - struct msm_vidc_timestamp.

Change-Id: Ib8655047c3883ea6601344661058d7a629ffd5bd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-17 17:22:06 +05:30
qctecmdr
b113af07cb Merge "video: driver: Add enc vbr min quality restrictions" 2021-06-16 13:43:22 -07:00
Qiwei Liu
7ada486d28 video: driver: refine log level checking
Refine log level checking, to avoid some logs are
always printed if multiple level specified.

Change-Id: I151a5b8cce8d234d6d22450c43cf50d3b0065286
Signed-off-by: Qiwei Liu <qiweil@codeaurora.org>
2021-06-16 21:21:31 +08:00
Akshata Sahukar
36a4971392 video: driver: Add enc vbr min quality restrictions
Do not support vbr min quality with below configs:
- HEVC 10bit
- Bitstream fps > 60
- ROI enabled/support
- HP encoding
- External Blur
- Resolution beyond 1080P.

Change-Id: I5e4a420abdd0c6fee4342c3c097684ef69bb0597
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-15 18:23:36 -07:00
Dikshita Agarwal
b08d4769f8 video: drive: add support to dump FW region
Add support to dump video FW region during FW crash
using devcoredump helpers.

Change-Id: I64c47160f04644223f4e831c35f7a059d38f7d83
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-14 11:45:21 -07:00
qctecmdr
71bb59790c Merge "video: driver: Add encoder complexity to decide power mode" 2021-06-11 01:21:50 -07:00
qctecmdr
5c6749e3e0 Merge "video: driver: allow adaptive/external blur along with rotation/flip" 2021-06-10 23:38:05 -07:00
Akshata Sahukar
973d1f0b38 video: driver: allow adaptive/external blur along with rotation/flip
[1] Allow adaptive/external blur along with rotation/flip.
[2] Update HFI_BUFFER_VPSS_ENC macro to align with CL: 30984523.

Change-Id: Ibca9f273da4a8204f586e952aeb9b2e78b5ff941
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-06-10 11:58:05 -07:00
Vikash Garodia
72699f7278 video: driver: Add encoder complexity to decide power mode
Client can choose to run an encode session to acheive maximum
performance rather than maximum quality.
Add the handling to configure video core accordingly for the
configured video session.
Such configuration is only applicable for non-realtime session.

Change-Id: Ife290b377c844e5b1d3be93b2509c787f8e05c59
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-10 05:43:00 -07:00
Govindaraj Rajagopal
0c062d5a2a video: driver: utilize mod_delayed_work functionality
mod_delayed_work() is a replacement for cancel_delayed_work()
+ queue_delayed_work(). It will update only timer value,
instead of completely cancelling and queueing a new delayed
work.

Change-Id: Id07d54e025c5a2e82f29160ae6d249d44f00bb15
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-10 18:00:46 +05:30
qctecmdr
281ce51f5f Merge "video: driver: amend power on and power off sequences" 2021-06-09 19:54:34 -07:00
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
Govindaraj Rajagopal
2c0d2faefa video: driver: limit vp9 max spec to 4K@60
Added change to limit VP9 decode max spec is upto 4K@60.

Change-Id: I5939a8cf6cd227d2cced5adb3628b36493b7b1fc
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-09 21:07:54 +05:30
qctecmdr
16a8c42091 Merge "video: driver: encoder default level as HFI_LEVEL_NONE" 2021-06-08 23:29:45 -07:00
qctecmdr
21da327efe Merge "video: driver: do core_deinit for power_collapse failure" 2021-06-08 23:29:45 -07:00
Darshana Patil
87452bbf17 video: driver: encoder default level as HFI_LEVEL_NONE
set encoder default level as HFI_LEVEL_NONE

Change-Id: Ibe566a50c9c09a337fdf75f80bd3c37c7a5d0d4e
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-08 17:21:08 -07:00
Darshana Patil
5ace31f6b8 video: driver: modify rgba scanlines alignment to 32
modify scanlines alignment for linear rgba color
format to 32.

Change-Id: Ide64322bc872bfda64d8f48474ef2d37a4f314b7
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-08 11:02:12 -07:00
Govindaraj Rajagopal
e5a2546752 video: driver: do core_deinit for power_collapse failure
if skip_pc_count reaches VIDC_MAX_PC_SKIP_COUNT, that means
something wrong with hardware. So call core_deinit to reset
the hardware, so that atleast next session willbe proper.

Change-Id: I320fcc2917825a2ff79889b8183e2842257f3569
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-08 14:46:52 +05:30
qctecmdr
8818dd8215 Merge "video: driver: Set secure mode in encoder" 2021-06-07 22:18:03 -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
qctecmdr
c67713f34e Merge "video: driver: Update session admission and work modes" 2021-06-05 11:13:10 -07:00
Linux Build Service Account
420c0336e4 Merge "video: driver: print more info on debug logs" into video-kernel-waipio.lnx.1.0 2021-06-04 18:19:00 -07:00
Mihir Ganu
3a7632ca4d video: driver: Update session admission and work modes
- To determine if session is admissible, check only the
  decoder input width/height and encoder crop width/height.
- Update session MBPF Calculations.
- Amend work mode setting to consider decoder input width,
  height and GOP size.

Change-Id: If4053c222de2a55ad5b85a8ab96c12c47b145aa3
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-06-04 17:08:23 -07:00
qctecmdr
78ef4bc839 Merge "msm: vidc: Fix priority level determination" 2021-06-04 15:08:00 -07:00
Vikash Garodia
e923948da6 msm: vidc: Fix priority level determination
Priority level was not determined at few sequences.
Determine the priority level and set to firmware, if
there is a change in driver and firmware priority.

Change-Id: I97861fd4ce8cfb7cf828a8da9a5ce8ba900280ef
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-06-04 21:04:58 +05:30
Govindaraj Rajagopal
1f46168b9f video: driver: print more info on debug logs
Currently driver prints hex values for codec type, pixel
format and port number. So added change to print strings
instead of hex values.

Removed unnecessary logs to avoid overlogging timeout
issues.

Change-Id: Ia44401990797dc20eae0a35631e9ed6a0b094c20
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-04 19:26:34 +05:30
qctecmdr
f87aa7d05d Merge "video: driver: encoder fix for frame qp and level" 2021-06-04 01:58:55 -07:00
Darshana Patil
5b276d076e video: driver: encoder fix for frame qp and level
- misc fix for setting frame qp, min qp, max qp.
- seperate LEVEL database entry for encoder and
  decoder as max level supported by encoder is 6_0,
  but decoder supports upto 6_2.

Change-Id: Ia0a0a717e73e55a8b6933421e3eb55c3831524b2
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-03 13:57:49 -07:00
Govindaraj Rajagopal
7cf3193b10 video: driver: check for session_error at ioctl entry point
Currently session_error check is scattered at multiple places,
So check for session error at ioctl entry point itself(for set
type controls only).

Cleanup &inst->response_works.list as part of session close to
avoid leaks and remove unused variables from inst struct.

Change-Id: I349ec845cc71814b33a94ac07c7628304ddae564
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-03 15:08:31 +05:30
qctecmdr
1f8bf0bd92 Merge "video: driver: modify priority level enum" 2021-06-02 15:31:22 -07:00
qctecmdr
4ab25dd749 Merge "video: driver: update metadata buffer size" 2021-06-02 15:31:22 -07:00
qctecmdr
07514525c7 Merge "video: driver: fix race between driver fd close and ioctl calls" 2021-06-02 14:03:01 -07:00
Darshana Patil
8d33375a96 video: driver: modify priority level enum
modify priority level enum values to set
correct values to fw.

Change-Id: Ifd33b17db58b06d281ad930f7629d9a4575d0956
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-02 12:57:06 -07:00
qctecmdr
e61914fe82 Merge "video: driver: queue pending buffers at streamon" 2021-06-02 12:25:50 -07:00
qctecmdr
be42c3ec08 Merge "video: driver: add error handling at event_queue_deinit sequence" 2021-06-02 12:25:49 -07:00
qctecmdr
04805a2b55 Merge "video: driver: add error handling for lend failure" 2021-06-02 12:25:49 -07:00
Govindaraj Rajagopal
58207fc7d8 video: driver: add error handling at event_queue_deinit sequence
If msm_vidc_open() sequence fails before calling event_queue_init()
then it calls msm_vidc_close as part of cleanup.

So event_queue_deinit will attempt to call v4l2_fh_del without
completing v4l2_fh_init & v4l2_fh_add. So i.e leading to NULL ptr
dereferrence issue at v4l2_fh_del api.

Added change to avoid calling event_queue_deinit() sequence, if
event_queue_init is not completed.

Change-Id: Ia2732c39be819247379d955d40dddccaba7c00eb
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 17:55:36 +05:30
Govindaraj Rajagopal
d0267842f1 video: driver: add error handling for lend failure
Added error handling for mem_buf_lend failure.

Change-Id: I6ca0a575f8324e3f6eaf1cd114e9bf96608eff3d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 16:54:47 +05:30
Govindaraj Rajagopal
5996ceb8d2 video: driver: fix race between driver fd close and ioctl calls
Userspace is allowed to close driver fd at anytime, even in middle
of ongoing session. So it will create a problem, if multiple ioctls
were waiting for &inst->lock() and msm_vidc_close() acquired the
&inst->lock and cleaned up all session specific resources including
vb2 queues, v4l2_fh file handles and all buffers and finally frees
inst itself, as part of put_inst(). So once that is done, other
enties waiting on &inst->lock will get chance, but by that time,
everything is freed. So proceeding that cmd will completely lead to
undefined behaviour and target reset will happen.

Added change to avoid above mentioned scenario by Incrementing inst
refcount everytime before proceeding any ioctls and acquired &inst->lock
to avoid concurrent access between ioctls.

Currently &inst->lock was not acquired except for reqbuf, qbuf, dqbuf
ioctls. But it is good to acquire lock at every ioctl types. This will
help avoid corner cases, such as during ipsc, all port setting were
updated to inst structure, So if userspace attempts any ioctl(like
g_ctrl) without lock, it might get intermittent value, which is wrong.

Change-Id: Ic4bdf562f7036f3796019fe45d1cdc392045878a
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 15:24:37 +05:30
Shi Zhongbo
5a9c41e69d video: driver: update metadata buffer size
Update metadata buffer size after port resolution
changes.

Change-Id: Ieb9ce986500b4f06b5b0a324b4cd42ebae5c4d9e
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
2021-06-02 00:21:53 -07:00
Govindaraj Rajagopal
31012cd79e video: driver: queue pending buffers at streamon
qbuf will be deferred on all ports before streamon,
So explicitly queue pending buffers at the time of
streamon.

Change-Id: I673a14f0d43563184aac887f5f23b63ed13d59df
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 11:55:28 +05:30
Govindaraj Rajagopal
a33041f799 video: driver: add scaling checks for encode session
Encoder supports downscale with scaling ratio upto 1/8 of width
and 1/8 of height. So added necessary scaling checks at streamon.

Change-Id: I3a29b43c79cf4e693ba2c0d9f98ec24410d50fbd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-02 11:26:12 +05:30
Darshana Patil
65636fd2ad Revert "video: driver: always caliberate gop size"
This reverts commit b35579ad54.

Change-Id: I5ba0b244f53068ae6f0d3225b278e1ddafc360c5
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-06-01 11:12:02 -07:00
Govindaraj Rajagopal
b2e9fada31 video: driver: restrict image load to 16K x 16K
Add strict check in msm_vidc_check_mbpf_supported() to
reject image session, if total image load exceeds 16K.
Added msm_vidc_print_insts_info() support to print all
running instance info, if new session is rejected due
to mbpf/mbps checks.

Change-Id: I98bab985fcf4f4d20c6f263c48e0c701ec86ab6f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-31 17:11:46 +05:30
Vikash Garodia
c1bf1d2bc9 video: driver: Set proper HFI during low latency for decoder
Decoder supports dynamic low latency. When client configures the
video session in low latency mode, driver would configure the
firmware such that HFI_CMD_SETTINGS_CHANGE is triggerred on
sync frame boundary.

Change-Id: Ie70eaaeb8ad420db926f0d99f77723476deee400
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-28 21:38:05 +05:30
Govindaraj Rajagopal
69e6b8c0ca video: driver: fix race between streamoff and ipsc
During input port streamoff, state is changed from START_INPUT
to OPEN and then sent CMD_STOP to firmware. So reverse thread
acquired the lock and trying to process IPSC. Since IPSC is
not allowed in OPEN state, driver treats that as a fatal issue
and moves inst->state to ERROR state. Added change to avoid
above mentioned issue.

Change-Id: If0e18f01b6ecac3c810c0dab878ae392c48ffc27
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-28 11:24:52 +05:30
Govindaraj Rajagopal
8d81cd480b video: driver: tune clock and bus vote calculation
Use bitstream fps in clock and bus vote calculation, if
bitstream detected fps is higher than client set rate.

Change-Id: I58fa1a8725086c112796b3ce5172a39f322e178e
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-27 14:32:05 +05:30
qctecmdr
23336229ec Merge "video: driver: Update stage & pipe before sending resume" 2021-05-26 22:06:37 -07:00
qctecmdr
6e3277082c Merge "video: driver: allow main and main 10 profiles for heic enc" 2021-05-26 22:06:37 -07:00
qctecmdr
f7485924fd Merge "video: driver: reject unsupported resolution in output streamon" 2021-05-26 22:06:37 -07:00