Commit Graph

230 Commits

Author SHA1 Message Date
qctecmdr
2167bfcda1 Merge "video: driver: fix an uninitialized variable" 2021-02-24 18:38:12 -08:00
qctecmdr
a5cae9054b Merge "video: driver: return POLLERR when inst in error state" 2021-02-24 18:11:36 -08:00
qctecmdr
ff1ac5427b Merge "video: driver: fix video driver remove" 2021-02-24 17:45:46 -08:00
Swarna Vanka
ddffda415c video: driver: fix an uninitialized variable
Initialized the variable to avoid setting clock
with some random number

CRs-Fixed: 2836558

Change-Id: Id5673210c9e7431aad35b830c9538f8dae4982fc
Signed-off-by: Swarna Vanka <slatha@codeaurora.org>
2021-02-24 17:09:43 -08:00
Chinmay Sawarkar
92a5583706 video: driver: fix video driver remove
While removing driver fw should be unloaded.
Also improved error handling.

Change-Id: Ia9f224da6f176c8a50c153f67fe8a77a92b7b08f
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-24 16:29:41 -08:00
Darshana Patil
d1264c76f0 video: driver: return POLLERR when inst in error state
return POLLERR when inst is in error state.

Change-Id: If207b8e3346322424e95d70a45aa684643e9461d
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-24 15:47:41 -08:00
qctecmdr
e6b6c34490 Merge "video: Added more validations" 2021-02-24 15:25:50 -08:00
Karthikeyan Periasamy
0e491223d5 video: Added more validations
Fixes for KW security issues.
CRs-Fixed: 2836558

Change-Id: I0c8ca6b13c00420a50b8518caea6ad51ed1268bb
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2021-02-24 14:27:10 -08:00
Akshata Sahukar
17addfbc6d video: driver: add support to few properties
Add support to below properties
- HFI_PROP_MULTI_SLICE_BYTES_COUNT
- HFI_PROP_MULTI_SLICE_MB_COUNT
- HFI_PROP_CHROMA_QP_OFFSET
- HFI_PROP_REQUEST_SYNC_FRAME

Change-Id: I4cc62870756d058e7a7b15290f5d6797b3be243c
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-24 12:06:26 -08:00
Darshana Patil
d4b5661567 video: driver: modify msm_media_info.h to fix 10bit
- introduce STRIDE_BYTES and STRIDE_PIX to
  calculate size is bytes and pxls respectively.
- DEPRECATE VENUS_BUFFER_SIZE and introduce
  VIDEO_RAW_BUFFER_SIZE. All buffer sizes are
  calculated by using STRIDE_BYTES.
- For s_fmt, use STRIDE_PIX to calculate size.
- For v4l2 bytesperline, use STRIDE_IN_BYTES to
  calculates size in bytes

Change-Id: I3db4d843d1834b25c6160ebc318572ac67e22806
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-23 20:02:29 -08:00
qctecmdr
9a4c121831 Merge "video: driver: enable encoder superframe batching support" 2021-02-22 23:00:18 -08:00
Chinmay Sawarkar
c684975c19 video: driver: Initialize handoff_done
If not initialized, power control may wrongly be transferred
to firmware, even though regulator handoff is not done.

Change-Id: Ic76a679ff5f848bfb50c95dc3306f05ee62bc82f
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-22 13:17:47 -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
Chinmay Sawarkar
6070bc2523 video: driver: enable interframe power collapse
Hand off regulators to hw to enable interframe power collapse.

Change-Id: I11d3d96f0a6cce23ef374e2065532a13af38d2f4
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2021-02-19 21:31:27 -08:00
Darshana Patil
02346b9728 video: driver: modify internal buffer counts for vp9
modify internal buffer counts for vp9. fix comv and
noncomv buffer count to 0 for vp9 as they are not
supported for this codec.

Change-Id: I5d504128ab587c425d4cd4cfd2059241e8d256aa
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-19 18:02:17 -08:00
qctecmdr
4154ca00cf Merge "video: driver: fix error handling sequence in msm_vidc_open" 2021-02-19 17:45:22 -08:00
qctecmdr
a04866f293 Merge "video: driver: set default_header property at session level" 2021-02-19 17:23:44 -08:00
qctecmdr
d6621561dd Merge "video: driver: modify decoder subscribe psc list" 2021-02-19 17:02:25 -08:00
qctecmdr
29b6bb8e1a Merge "video: driver: reset required buffer attributes" 2021-02-19 16:31:22 -08:00
Darshana Patil
52e7bb2213 video: driver: set default_header property at session level
set default header property once per session for decoder.

Change-Id: I5ca9088b8bed09907f2c9f829acec3db23e65a7c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-19 11:46:38 -08:00
Govindaraj Rajagopal
f1e6bbf2ed video: driver: fix error handling sequence in msm_vidc_open
Currently msm_vidc_close is called directly for any failure
in msm_vidc_open(at any level). So i.e leading to free without
alloc & deinit without init problems.

Example:
if msm_vdec_inst_init is failed, msm_vidc_event_queue_deinit
will be called as part of msm_vidc_close and leading to crash
at v4l2_fh_del.

v4l2_fh_del should be called only if v4l2_fh_add is successful.

Change-Id: I5dd063c19327b881f533aa141f77b23ee7fad125
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-19 21:18:30 +05:30
Darshana Patil
0126cc3d4b video: driver: modify decoder subscribe psc list
modify decoder subscribe psc list according
to supported codecs.

Change-Id: Id54ea26bac07491b80877ef88ab7888c08750335
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-18 20:02:22 -08:00
Maheshwar Ajja
0cae147e2a video: driver: reset required buffer attributes
Reset all attributes except read only attribute
in msm_vidc_get_driver_buf() for an existing buffer
to avoid buffer flow problems in driver.

Change-Id: If6170caa9b9315f73b6023ef496aed2ba3e6efba
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-02-18 19:48:13 -08:00
Mihir Ganu
b42f622d58 video: driver: Check capabilities pointer before accessing it
Core capabitlities are not created before opening first instance,
hence add a check before accesing capabilities.

Change-Id: I46b85e685624a2219fcf9e1153f8f470c17dcec0
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-02-18 18:56:27 -08:00
Darshana Patil
a11586233a video: driver: handle resume command response
handle resume command response from fw.

Change-Id: Ib45a7e1f6b6ffab6573699dfc4efb2305ced511c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-18 16:36:36 -08:00
Akshata Sahukar
3ad2fda959 video: driver: add support to set colorspace for enc
- Set enc colorspace info to firmware via
  HFI_PROP_SIGNAL_COLOR_INFO property.
- Fix dec colorspace payload packaging.

Change-Id: Ib7ef2395a4f98f6497bbb200770a8612410eb8f5
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-18 14:08:00 -08:00
Darshana Patil
b8996ba008 video: driver: modify crop offsets property
modify crop offsets property to match the
hfi header file.

Change-Id: Id4cd1e6f68a811e7d3dfbaeb80b20bff98eaf35c
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-17 18:50:24 -08:00
Karthikeyan Periasamy
577430f10f video: VIDC_INFO is deprecated
Used VIDC_HIGH instead.

CRs-Fixed: 2836558
Change-Id: I6a6a92f41aa18a175d8d8a405c95d2d18cdb2c42
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2021-02-17 17:28:37 -08:00
qctecmdr
890505c6fb Merge "video: driver: modify default logging" 2021-02-17 16:12:07 -08:00
Darshana Patil
c1bb737feb video: driver: modify default logging
By default, enable only driver error,
fw error and fatal logs.

Change-Id: Ifdca1e26350b25b04555fd6fc402e8c3b7d28dfe
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-17 15:04:44 -08:00
Darshana Patil
bcb2df4067 video: driver: fixes for nv12 512x512 encoder
fixes for nv12 512x512 custom stride and scanline
support.

Change-Id: Ifc2a64e881587b9bf4538496dfaab70c8726fb85
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-17 15:04:35 -08:00
qctecmdr
34ca840018 Merge "video: driver: avoid drain_last_flag to drc state transition" 2021-02-17 11:41:43 -08:00
qctecmdr
d2a1190b94 Merge "video: driver: resume input port for drain sequnce." 2021-02-17 11:08:45 -08:00
Govindaraj Rajagopal
816f15fbcf video: driver: reset last_buffer_dequeued flag for streamoff case
After drc/drain sequence completion, if client initiates input port
streamoff, then firmware is expected to release all EBD's. But looks
like couple of FBD's also returned by firmware and gets added to
q->done_list.

Due to valid vb2_buffer entry, poll() gets unblocked everytime and
attempts to dequeue but dqbuf request on capture port after last_flag
will be rajected by vb2 with -EPIPE error.

So v2_buffer never gets dequeued and poll always gets unblocked i.e
leading to barrage of dqbuf failure prints.

Added change to clear last_buffer_dequeued flag as part of streamoff.
This is required for both input & output port side.

Change-Id: I9e84e642811100b1e32317228e7d9b3739def1c4
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-17 17:41:53 +05:30
Govindaraj Rajagopal
bef0dd14da video: driver: avoid drain_last_flag to drc state transition
[1] DRC_DRAIN_LAST_FLAG to DRC is not allowed. So remove support
[2] introduced in_range macro
[3] removed process_response_packet function
[4] introduced msm_vidc_process_pending_ipsc function.

Change-Id: I1bc7ed6f0d94052900a4655a2e3da9ea44d60143
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-17 13:57:53 +05:30
Govindaraj Rajagopal
8867ad497a video: driver: resume input port for drain sequnce.
HFI_CMD_RESUME should be sent for following cases:

Decoder(V4L2_DEC_CMD_START)
input port: ipsc & drain
output port: opsc

Encoder(V4L2_ENC_CMD_START)
input port: drain
output port: no usage

Change-Id: I77b29c2da542a3d91f7ba96fb36291303d6af3f9
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-17 13:07:38 +05:30
Govindaraj Rajagopal
8ed48fa824 video: driver: fix minor typo
fixed minor typo.

Change-Id: I76e3d3fb4b0691f324d58e22b148fe26760c7fc1
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-16 23:32:25 +05:30
Govindaraj Rajagopal
0cb0862d1c video: driver: update streamoff failure return code.
Currently streamoff failure error code was overriden with zero.
added change to propagate correct error code.

Change-Id: I9ad92f27ae6de109c9959abf0692e6e32cd52d3d
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-15 19:08:38 +05:30
qctecmdr
888c828645 Merge "msm: vidc: Initialize queues before adding session to core" 2021-02-12 16:12:26 -08:00
Manikanta Kanamarlapudi
59e44ef2fa msm: vidc: Initialize queues before adding session to core
Initialize queues first and then add the session
to the core. This will avoid the access to uninitialized
queues of new instance while voting the clocks/buses of the
other instance.

Change-Id: I92b06dba361eb1539aced90fb58251c04a55b175
2021-02-12 21:52:26 +05:30
Akshata Sahukar
b5ce6c94cc video: driver: dynamic control support
- Set dynamic flag in inst database to allow
  dynamic setting of necessary controls.
- avoid enc qbuf call routed to dec.

Change-Id: I66cfcc6be86bfbfe237191a11d533ab6c9455f32
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-11 17:33:39 -08:00
Darshana Patil
91212e2c02 video: driver: fix destroy internal buffer
break after destroying each internal buffer

Change-Id: I1b3eaf3b655113e0f2f911683c423cdeaeac3ade
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-10 19:40:50 -08:00
qctecmdr
d56e844dd9 Merge "video: driver: print buffer region" 2021-02-10 18:54:50 -08:00
Maheshwar Ajja
ddcadaf055 video: driver: print buffer region
Print buffer region and secutity information.

Change-Id: I9fae1b193b5e416cb291109c25fe025c34f50f34
Signed-off-by: Maheshwar Ajja <majja@quicinc.com>
2021-02-10 18:35:47 -08:00
qctecmdr
2072537a6e Merge "video: driver: amend V4L2_BUF_FLAG_ERROR flag handling" 2021-02-10 18:23:13 -08:00
Akshata Sahukar
f451c19147 video: driver: amend V4L2_BUF_FLAG_ERROR flag handling
amend MSM_VIDC_BUF_FLAG_ERROR driver EBD/FBD buffer flag
handling to properly pass V4L2_BUF_FLAG_ERROR to client.

Change-Id: I9de1af3a2b5026e6d281982048f2e7f172221695
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-10 14:47:58 -08:00
Darshana Patil
40a39d7455 video: driver: queue persist buffer as session buffer
-queue persist buffer as session buffer at the start
 of the session for decoder
-fix hfi buffer packet parsing when payload is none.

Change-Id: I5da2472d00bf85dd328bbdfcbd35074a46522d25
Signed-off-by: Darshana Patil <darshana@codeaurora.org>
2021-02-10 12:39:49 -08:00
qctecmdr
3b845bc495 Merge "video: driver: Set lx arch to fw before fw boot" 2021-02-09 19:59:34 -08:00
qctecmdr
30f1a68d17 Merge "video: driver: correct firmware debug log prints" 2021-02-09 19:41:33 -08:00
qctecmdr
bc9d1b3c23 Merge "video: driver: set firmware debug log cmd in session open" 2021-02-09 19:13:17 -08:00