Commit Graph

347 Commits

Author SHA1 Message Date
Akshata Sahukar
ce09f77e44 video: driver: free children and firmware list memory
To avoid memory leakage, clean children and firmware lists
at session close, error cases, and at the end of each usage.

Change-Id: I1eadbf81da207bd987c50428c0c7cf4967a8885f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-30 18:42:34 -07:00
qctecmdr
401b0010e7 Merge "video: driver: tune image_encode_session settings" 2021-04-30 12:22:31 -07:00
qctecmdr
4aeaa73378 Merge "video: driver: Add support to blur property" 2021-04-30 12:22:31 -07:00
Govindaraj Rajagopal
35b7d34429 video: driver: tune image_encode_session settings
[1] Increase min_output buffer_count from 1 to 4.
[2] Enable FRAME_RC_ENABLE cap for image session.
    default - RC_CQ mode.

Change-Id: Iad3166fe37733e9d9ccde1dca29af8c7b825cc98
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-30 22:13:45 +05:30
qctecmdr
94ea0d5c5c Merge "video: driver: Check failures during session close" 2021-04-29 23:05:04 -07:00
Mihir Ganu
18e731edaa video: driver: Check failures during session close
Check if cmd queue write failed and return the error code
during session close.

Change-Id: Iaa4579cdb8ad5f622623c957a781ab0a9104153d
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-04-29 20:50:18 -07:00
Govindaraj Rajagopal
429e6efffd video: driver: fix system_error handling
Do not process next packet, if system_error is received.
As part of system_error handling core>respose_pkt will
be freed. So parsing beyond system_error packet might
lead to use-after-free issues. So added change to avoid
processing next set of pkts, if system_error is received.

Change-Id: Ibb767a5664e38cb720cba6416b6080f0aea4d919
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-29 12:47:21 +05:30
Akshata Sahukar
1c5f23e13b video: driver: Add support to blur property
[1] Add support to adjust and set blur type and blur
    resolution.
[2] Modify flip to not allow dynamic flip enablement
    when external blur is enabled.

Change-Id: I730f452c143ba8c8e15402d1c1ec3a0617bd583c
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-28 16:29:12 -07:00
Darshana Patil
550a5599b9 video: driver: fix decode conceal colour
fix decode conceal colour

Change-Id: I2db138d68459a1e2c929acab31ff41c3b316e3b6
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-04-27 21:39:50 -07:00
qctecmdr
b85c9199af Merge "video: driver: refine power settings" 2021-04-27 20:34:02 -07:00
qctecmdr
e1a2a69904 Merge "video: driver: reduce output buffer count for thumbnail usecase" 2021-04-27 20:34:02 -07:00
qctecmdr
6432f03393 Merge "Revert "video: driver: reset last_buffer_dequeued flag for streamoff case"" 2021-04-27 20:34:02 -07:00
qctecmdr
eea79fdade Merge "video: driver: handle core init failure cases" 2021-04-27 20:34:02 -07:00
qctecmdr
e7bfa08f49 Merge "video: driver: Modify default values for VBV Delay and Peak Bitrate" 2021-04-27 20:34:02 -07:00
Akshata Sahukar
450a9e0e20 video: driver: Modify default values for VBV Delay and Peak Bitrate
Modify cap values for below properties:
[1] VBV Dealy: default as 300, min as 100, and max as 300
[2] Peak bitrate: default as avg bitrate set by client.

Change-Id: Ic9533e8a40e789128e5baa975bf1a0355e373e08
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-27 10:14:12 -07:00
Govindaraj Rajagopal
e0637a30b8 video: driver: refine power settings
Added change to address below 2 issues.

[1] buffer_counter is not getting incremented for batching usecase,
it always runs with max clk and bus votes. So moved buffer_counter
increment logic to msm_vidc_queue_buffer, so that it will be used
for all usecases.

[2] iris2 clock calculations were using core->capabilities but all
needed infos were present in inst->capabilities. So junk values from
core->capabilities was used in clock calculations and values always
shooting to highest corner.

Change-Id: I0927899244b5de2bd46d238100fdaecd78c6fe28
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-27 18:58:51 +05:30
Govindaraj Rajagopal
803defe0e7 Revert "video: driver: reset last_buffer_dequeued flag for streamoff case"
This reverts commit 816f15fbcf.

Change-Id: I686627e75ba9dc79b857159e85f142d3fc211745
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-27 12:05:23 +05:30
Govindaraj Rajagopal
5a374e3ed4 video: driver: reduce output buffer count for thumbnail usecase
Update output buffer min & extracount, if thumbnail mode is set
and also tune extracount at input psc sequence.

Change-Id: I77b28198257d127454ee3e9b2a307e1931547e8f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-27 11:43:39 +05:30
Akshata Sahukar
90658c5592 video: driver: Add support to print decode/encode stats
Add support to calculate and print encode and decode
time, and average time consumption per fbd sample.

Change-Id: I5e867833d1d88285bfebc8c9b9a593e3ed975ed5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-26 16:26:38 -07:00
Mihir Ganu
cf3fd457b3 video: driver: Enable flip and rotation
Enable encoder flip and rotation preprocessing features.

Change-Id: Icb0448c2d09fbe9504e3f58701cd2653dc4559b0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-23 16:44:42 -07:00
qctecmdr
f594a33c13 Merge "video: driver: Add support for enc downscaling" 2021-04-21 18:31:17 -07:00
Maheshwar Ajja
03c7742be5 video: driver: handle core init failure cases
Core init failure is handled properly in order to avoid
undefined or unexpected errors while doing core deinitialized.

Change-Id: I89e234e6d9286b993547080551ba54ee7e643e59
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-04-21 17:48:11 -07:00
qctecmdr
17347ff881 Merge "video: driver: increase max buffer count" 2021-04-19 20:01:44 -07:00
Maheshwar Ajja
30d2ef55b4 video: driver: increase max buffer count
Increase max buffer count to release the buffers,

Change-Id: I34774a8e99c7a5c78f79e8ca101e6135a22e7f30
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-04-19 19:20:49 -07:00
Maheshwar Ajja
09356ed279 video: driver: amend delayed unmap feature
Due to delayed unmap feature on decoder output buffers,
refcount will become one when no one uses the buffer
in driver. In release done functonality, remove the
buffer from maps list only if refcount equal to one.
If refcount is more than one indicates the buffer is
being used, so do not remove from maps list. There are
chances that same decoder output buffer might be queued
by the client in which case we are not supposed to
unmap it from maps list in release done.

Change-Id: I69250c3efa89d77055e89770fd441af1fb50b755
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-04-19 19:05:36 -07:00
Maheshwar Ajja
da6943c26a Revert "video: driver: refine refcount handling for release buffer"
This reverts commit bdd7a33bfb.
2021-04-19 19:03:23 -07:00
Maheshwar Ajja
ebf199bf2f Revert "video: driver: update device_addr for comparison"
This reverts commit a4905e8bfd.
2021-04-19 19:03:06 -07:00
Maheshwar Ajja
abe44a0089 Revert "video: driver: handle release during batching"
This reverts commit 0f066190b1.
2021-04-19 19:02:41 -07:00
qctecmdr
6b20be1d9b Merge "video: driver: Fix bin buffer allocation in secure usecase" 2021-04-19 15:52:57 -07:00
Darshana Patil
0f066190b1 video: driver: handle release during batching
Before output buffer is queued to FW,
checking if it is pending release and refcount
accordingly. The check needs to be added just
before queueing to FW to handle batch usecase
as well.

Change-Id: I2d394b5642ed8fa916e86ebc59ea414300415fab
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-04-16 22:27:02 -07:00
Chinmay Sawarkar
3964d13a63 video: driver: Fix bin buffer allocation in secure usecase
In Secure session, BIN buffer should be allocated from Secure Bitstream
region. Allocated buffer must be hypassigned using the DMA buffer
Lend call.

Change-Id: If5303e78975aab55ac7475ca3ac9f6272585a44b
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-04-16 21:57:20 -07:00
Akshata Sahukar
7611922612 video: driver: Add support for enc downscaling
Add support to encode bitstream with downscaled resolution.

Change-Id: I04ab289758e1d1566924ec4b017e6d081c8f01aa
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-16 13:43:39 -07:00
qctecmdr
0b0c83bd88 Merge "video: driver: update device_addr for comparison" 2021-04-16 11:55:22 -07:00
qctecmdr
0f7226072a Merge "video: driver: add ROI metadata support" 2021-04-16 11:55:22 -07:00
Govindaraj Rajagopal
a4905e8bfd video: driver: update device_addr for comparison
Compare buffer with release list only after updating
buffer device_addr field.

Change-Id: Ie1c21fd9496fb4deb735938efeff61b90b96362f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-16 22:05:10 +05:30
Govindaraj Rajagopal
bdd7a33bfb video: driver: refine refcount handling for release buffer
If current qbuf entry is already present in release buffer list,
then as part of release done, refcount will get decremented and
for current qbuf, there is 2 possibilities of outputs from fw.
FBD with RO and wo RO. So if firmware gives FBD with RO, we are
currently decrementing refcount from 1 -> 0. So mapping gets
destroyed. But firmware is still holding RO referrence and
leading to smmu fault issues. So added hadling to increment
recount by 1, if current buffer(qbuf) is already present in
release buf list.

Change-Id: Icbe8ce0b1c9b47c4450d17650b63a575e1037ce3
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-16 14:39:18 +05:30
Darshana Patil
2c0cab5146 video: driver: add ROI metadata support
add extra size for input meta buffer
when ROI metadata is enabled.
add dependency of rate control and
color format.

Change-Id: Icefd3f9e319d596f88090cee331417c0b2946180
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-04-15 21:50:00 -07:00
qctecmdr
5f36c047b4 Merge "video: driver: packet size sanity checking" 2021-04-15 16:53:35 -07:00
Akshata Sahukar
9dfd528742 video: driver: packet size sanity checking
- Payload ptr is dereferenced even when response packet does not
  contain any payload. Avoid the same.
- Fw may send HFI_FW_FLAGS_INFORMATION for property packet whenever
  benign error occurred in fw for the sent property. Print the same
  instead of considering the property as invalid port property.

Change-Id: I0c61861c14fefa689d342f991693c33da289c572
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-15 15:01:27 -07:00
qctecmdr
32ee5068d6 Merge "video: driver: Enable META_LTR_MARK_USE for enc o/p port" 2021-04-15 14:26:14 -07:00
qctecmdr
4db216ad30 Merge "video: driver: Allow priority control in streaming state" 2021-04-15 13:26:53 -07:00
Akshata Sahukar
d0fa618b52 video: driver: Enable META_LTR_MARK_USE for enc o/p port
META_LTR_MARK_USE is enc output metadata. Hence, avoid enabling
encoder input metadata for META_LTR_MARK_USE.

Change-Id: I667f2f1a74e73b753447fc2dc9709cb1983c2249
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-15 13:10:43 -07:00
qctecmdr
da0cbb9193 Merge "video: driver: select target and vpu variant based on dtsi" 2021-04-15 12:31:19 -07:00
Manikanta Kanamarlapudi
8c7c63ec2d video: driver: Allow priority control in streaming state
Allow priority control in streaming state

Change-Id: I98a0983026fdb37f6a5b94fb73082032158a7743
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
2021-04-15 10:53:10 -07:00
qctecmdr
18c7822b0d Merge "video: driver: add fix to avoid race condition in session close" 2021-04-15 10:21:19 -07:00
Govindaraj Rajagopal
6f281973aa video: driver: add fix to return all buffers back to client
If client attempts streamoff and msm_vidc_close sequence
concurrently, then all buffers not returned back to client,
i.e leading to warnon at vb2_queue_cancel at vb2 layer.
So added change to send vb2_buffer_done at driver fd close
sequence.

Change-Id: I43d779000501907d12d5ba8e90e007bdf5b8b801
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-15 20:33:16 +05:30
Govindaraj Rajagopal
3d6ff3ea8e video: driver: add fix to avoid race condition in session close
Some clients attempt to invoke streamoff & driver fd close
(msm_vidc_close) sequence concurrently. So there might be chances
some commands willbe posted to command queue even after closing
hfi session(HFI_CMD_CLOSE) completed. So due to invalid session_id
firmware asserts.

Added change to avoid above mentioned issue and also amended minor
logging changes.

Change-Id: I2896567916cf5d18eb5b2a148efccf9bf07af3ea
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-15 20:30:41 +05:30
Govindaraj Rajagopal
b1fbc46396 video: driver: select target and vpu variant based on dtsi
- enable conditional compilation based on defconfig
- compile only needed files based target & vpu variant
- enabled stubs to avoid compilation issues, for all
  target variant and vpu types
- add support for qcv(same lunch combo) for different
  PT & VT chipsets.

Change-Id: Ic446349fd1532885d7a2e94895d807c62f1ab6e4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-04-15 20:14:04 +05:30
qctecmdr
9635a177c9 Merge "video: driver: Use cabac for power calculation" 2021-04-14 14:49:43 -07:00
Akshata Sahukar
5a2b2ee399 video: driver: Add support to adjust slice mode
Add support to adjust slice mode.

Change-Id: Id09e951b3085c55cc5bc6b15a2ce002645923435
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-04-13 17:12:27 -07:00