Commit Graph

263 Commits

Author SHA1 Message Date
qctecmdr
382a48ec9c Merge "video: driver: increase encoder max host buffer count" 2021-03-01 12:42:30 -08:00
Maheshwar Ajja
2a92b7d6da video: driver: handle same buffer returned from firmware case
Firmware is expected to return the buffer which was earlier
returned with READ_ONLY flag as part of stop command processing.
Amend the condition to avoid returning the same buffer to client
again.

Change-Id: I814098e140bf89b4a4e55dcd5efbff5a9d1cba12
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
2021-03-01 10:50:21 -08:00
Govindaraj Rajagopal
f7dc3c7789 video: driver: increase encoder max host buffer count
Increase encoder max host bufcount 64 -> 256 to support
superframe(encoder batching) usecase.

Change-Id: I8607b8302a10c52ac47a0c67ee7c359c62aa1d02
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-01 11:47:08 +05:30
Govindaraj Rajagopal
f25d5c7078 video: driver: handle race between streamoff and qbuf sequence
Currently stramoff releases inst->lock and waits for response from
firmware i.e race issue. Streamoff released int->lock and that got
acquired by qbuf. So 2 FTB's were queued to firmware after streamoff
request.

Receiving qbuf after streamoff is treated as fatal at firmware side
and it sends session error as response to host. Added change to
avoid such issues.

Change-Id: I6da8ac0d3d30b540784e3c03c423270cb5212af2
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-03-01 09:17:24 +05:30
qctecmdr
7fdf00010a Merge "video: driver: Resolve empty brace compilation issue for VS" 2021-02-26 13:28:47 -08:00
Akshata Sahukar
20d30c5dd2 video: driver: amend colorspace info setting
v4l2 enums for color space info are not one to one
mappings with hevc spec values. Hence, introduce and
use corresponding mapper functions.

Change-Id: I37a79a9b34b66184ece9a284ae98c9fa4efd248f
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-26 12:52:14 -08:00
Akshata Sahukar
a774cd62bb video: driver: Resolve empty brace compilation issue for VS
Empty braces caused compilation issue on VS. Resolved
the same to now compile complete driver code on VS
with no additional change requirements.

Change-Id: Ib63aad3d104362c17c952780f40cd6e381902343
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-26 12:51:10 -08:00
Govindaraj Rajagopal
e743f5dd48 video: driver: use char array for printing vidc logs
Instead of formulating session_id, codec_type, domain at
each log print, used pre-formatted char array to print
the vidc logs.

Change-Id: If7a93ecb25a7b1b98ebca6f39e3990079c00b5dd
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-26 22:10:16 +05:30
qctecmdr
df69c42511 Merge "video: driver: avoid output port stale resolution" 2021-02-25 14:58:26 -08:00
Govindaraj Rajagopal
4055a23255 video: driver: enable smmu_fault_handler support
Added smmu_fault_handler support and printing all buffers,
allocations, mappings list details as part of smmu fault
handling.

Change-Id: Idb5d28357f9fb885adf7ae16f328b4963c56aa8c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-02-25 12:26:46 +05:30
Akshata Sahukar
a406874508 video: driver: avoid output port stale resolution
Whenever cliet sets input port resolution greater
than output port resolution, stale resolution in output port
is set to video fw causing corrupted encoded bitstream.
Fixed the same to avoid encountering this issue.

Change-Id: Icf4569b0e5b101bfea8136936706490693286cce
gned-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-24 19:41:11 -08:00
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
74ca2ac96b Merge "Video : get unifdef explicitly" 2021-02-23 12:22:02 -08:00
Karthikeyan Periasamy
a00765b85c Video : get unifdef explicitly
CRs-Fixed: 2836558
Change-Id: Iab81cd0ed9791e7426719fbc1b43d9ccafc89bb7
Signed-off-by: Karthikeyan Periasamy <kperiasa@codeaurora.org>
2021-02-23 11:57:18 -08:00
Akshata Sahukar
e83bddb6e9 video: driver: allow interlace metadata for avc dec only
Allow interlace metadata for avc decoder

Change-Id: I25ad16d5d904068e633b0304a62bc766a7de16bc
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-23 10:23:45 -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
qctecmdr
79968cadb1 Merge "video: driver: modify internal buffer counts for vp9" 2021-02-19 18:46:46 -08:00
qctecmdr
bcac8d38ba Merge "video: driver: Avoid setting HFI_PROP_LAYER_ENCODING_TYPE" 2021-02-19 18:26:19 -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
Akshata Sahukar
d8e9c5d4db video: driver: Avoid setting HFI_PROP_LAYER_ENCODING_TYPE
Avoid setting HFI_PROP_LAYER_ENCODING_TYPE to firmware

Change-Id: I056baa670a3b6ceee150b1032e5691623c6ddab9
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-02-19 15:00:42 -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