Commit Graph

128 Commits

Author SHA1 Message Date
Dikshita Agarwal
ea38b901b7 video: driver: update msm_media_info to use vidc colorformat
Update all functions in msm_media_info.h to use vidc color formats
instead of v4l2 color formats macros to restrict the usage of private
color format defines in only helper functions.

Change-Id: Ib308c76af7b16ddac93023202191a47b21d68f5c
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-07-27 15:40:05 +05:30
Darshana Patil
fb1ecb69d0 video: driver: release internal buffer as part of start/resume
Change-Id: I45469c0a569fbc282aa1dbd217654e49eb50f54f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-06-30 15:18:08 -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
Akshata Sahukar
93742170e9 video: driver: fix incorrect crop resolution
Store unaligned resolution in driver inst formats
to avoid crop resolution getting updated to aligned
resolution whenever client did g_fmt and s_fmt again
after setting raw input resolution.

Change-Id: Ic2b6cf6e7d418d2bf0c35270199b914648e933d4
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-05-27 16:44:02 -07:00
Deepa Guthyappa Madivalara
fdef18ef50 video driver: remove session priority handling
1. Removes depenceny of priority from frame rate
    and operating rate.
2. Removes changing priority from s_param

Change-Id: Iec51173eab5a3d59b841315549d1420df422d37f
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-04-06 09:22:38 -07:00
Darshana Patil
733a7f8bcd video: driver: fix v4l2-compliance failure for private codecs
v4l2-compliance test does not support private codecs. Hence
added check to not return HEIC codec when enum_fmt is called.

Change-Id: Iff6fbb45b436e39e8b7c181859dbc1519338d003
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-03-29 15:17:55 -07:00
Darshana Patil
accb365696 video: driver: v4l2 compliance fixes for test formats
v4l2 compliance fixes for test formats

fixes:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK

Change-Id: I23c193ab5785bb10d070fa3085678d9669f53a92
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-03-28 11:58:06 -07:00
qctecmdr
5fd0e0a094 Merge "video: driver: update input, output and crop dimensions" 2022-03-26 23:24:19 -07:00
Akshata Sahukar
8ac3cc7120 video: driver: Change v4l2 metadata controls to BITMASK type
Change v4l2 metadata controls to V4L2_CTRL_TYPE_BITMASK type

Change-Id: I7f19b5dbf268351d368d9824cb52569e60116ebb
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-23 14:54:09 -07:00
Maheshwar Ajja
db8a8959e2 video: driver: update input, output and crop dimensions
Update input, output and crop resolution based in client provided
resolution on input port as per the v4l2 compliance test expectation.

Change-Id: I56f197d72cc132f38c00842b28b23b20c508cf23
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-03-23 20:11:42 +05:30
Akshata Sahukar
d85f112d92 video: driver: Enable bitwise operations for metadata controls
Enable bitwise operations for metadata controls with below
mentioned bit definitions:
- ENABLE (BIT 0): Enable metadata.
- TX_INP (BIT 1): Client transfers metadata in input port.
- TX_OUT (BIT 2): Client transfers metadata in output port.
- RX_INP (BIT 3): Client receives metadata in input port.
- RX_OUT (BIT 4): Client receives metadata in output port.

Change-Id: Ie3d720528a383632c7766a5ccb09cead0f6b9428
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-03-18 13:26:00 -07:00
Govindaraj Rajagopal
4f1180f1a6 video: driver: handle static and dynamic properties for decoder
Added change at decoder side to use adjust/set functions for
static(streamon) and dynamic(s_ctrl) cases.

Change-Id: I3d8c32baaf2fa2c3a077cc936a8ff2159ababfe3
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-03-08 19:46:05 +05:30
Govindaraj Rajagopal
0fde3a9aca video: driver: fix static and dynamic property setting sequence
Added changes to reuse caps_list for setting static properties
and also modified dynamic property setting sequence. Removed
redundant implementations.

Change-Id: I5829d3c98b0159916d7794f43e445a6191050182
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-02-18 18:20:39 +05:30
qctecmdr
528845d245 Merge "video: driver: propagate i/p port color info to o/p port" 2022-02-10 22:35:17 -08:00
qctecmdr
8a7f66a9f4 Merge "video: driver: handle invalid format in s_fmt" 2022-02-10 22:35:17 -08:00
Dikshita Agarwal
4d8dedc066 video: driver: handle invalid format in s_fmt
Handle invalid format 0xfffff by invoking try_fmt in
s_fmt. It is expected from driver to return EINVAL for only
unsupported buf type and if color format is unsupported,
driver should fill the fmt structure with valid values.

Partially Fixes: v4l2-compliance:
			TestSetFormat(VIDIOC_S_FMT)

Change-Id: I27e82866e8ad4a13661431f2a38a66ac3ef7dd80
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-02-07 11:20:13 +05:30
Darshana Patil
9978dc376e video: driver: add support to send input meta buffer via request
Client can enable V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE
control and send input metadata buffer via request.

Change-Id: Icccdada8253d1d0291c01e2e539968141f7ddd2c
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-02-04 13:47:34 -08:00
Akshata Sahukar
9df792a982 video: driver: propagate i/p port color info to o/p port
Client may do g_fmt on output port to fetch output port
color info. Hence, update output port color info with
client set input port color info.

Change-Id: Ifa3b16763d7389cd063493e25ce8b266ce1cb8c6
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2022-02-04 10:33:43 -08:00
qctecmdr
1dcad3ea8c Merge "video: driver: fix subscribe event handling" 2022-01-28 14:25:03 -08:00
Dikshita Agarwal
ea681bed4d video: driver: fix subscribe event handling
Invoke correct APIs to handle different types of events.
Fixes: v4l2-compliance:
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT.

Change-Id: I442fae3111d65a9612c73f2d16f9ed8031c77ec0
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-01-28 14:43:37 +05:30
Darshana Patil
acc83ca211 video: driver: request api changes for dynamic controls
- Request api allows to synchronize controls along
  with buffers.
- Client allocates a request fd. This request fd is
  associated with control and set using s_ext_ctrls.
  Such controls are stored by the framework and not
  applied immediately.
- Request fd is also associated with input qbuf and
  queued to driver. Following this actual request is
  queued. Buffers do not enter the queue untill the
  request is queued.
- As part of qbuf, driver call request_setup() which
  inturn sets the control to driver.

Change-Id: I316c4dc2a0091b21059230be5ee5fd6379259456
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2022-01-27 15:02:27 -08:00
Gaviraju Doddabettahalli Bettegowda
91703af2cf video: driver: update stride and scanline for NV21 color format
Added changes to update the proper stride and scanline info to firmware.

Change-Id: Ic8e119a48af8c3203fc21a320255d930f5c8585f
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@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
Akshata Sahukar
e2ec45b2e0 video: driver: reject 7th VP9 decoder session
reject 7th VP9 decoder session.

Change-Id: I2b739be0aff5492bd10d00c3068aa44e0895ee09
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-09-16 16:06:59 -07:00
qctecmdr
cc48023758 Merge "video: driver: implement TRY_FMT for encoder and decoder" 2021-08-10 16:08:17 -07:00
Dikshita Agarwal
a7ce77cfc7 video: driver: implement TRY_FMT for encoder and decoder
Any video device which supports capture multiplanar buf type
should implement VIDIOC_TRY_FMT.

Fixes: v4l2-compliance: testTryFormats (VIDIOC_TRY_FMT).

Change-Id: Id7ec171115c9374c6173fcf74a609382c3acf2d0
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-30 15:27:02 +05:30
qctecmdr
e0daeca024 Merge "video: driver: remove unsupported selection targets for encoder" 2021-07-29 13:50:45 -07:00
qctecmdr
dd6e67eafd Merge "video: driver: update required fields of stream parm struct" 2021-07-28 12:19:03 -07:00
Dikshita Agarwal
40c0938c20 video: driver: remove unsupported selection targets for encoder
- CROP should be supported only for V4L2_SEL_TGT_CROP selection
  target.
- Compose should be supported only for V4L2_SEL_TGT_COMPOSE
  selecion target.

Fixes: v4l2-compliance: testCrop/testCompose (VIDIOC_S_SELECTION)
       on encoder.

Change-Id: Iaada9e0078602ab5ddcdd25d94c9abb29c053811
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-28 13:12:12 +05:30
Dikshita Agarwal
79ac405a32 video: driver: update required fields of stream parm struct
- Set capability for capture and output plane.
- Update denominator and numerator of timeperframe structure
  to default values if set with zero.

Fixes: v4l2-compliance: testParm(VIDIOC_S/G_PARM) for encoder.

Change-Id: Ib9d92f07fc526a11253ac5d1adc1b639eef3632e
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-26 20:34:10 +05:30
Akshata Sahukar
3aaf56bebe video: driver: set RGBA enc session input default color space as BT709 LR
If client fails to configure color aspects to driver, driver does not set
required color space flags to firmware. For RGBA enc session, there is
implicit CSC. Hence, resultant color space should be BT709 LR. But
firmware fails to generate this color space info assuming that color
space info is not required. Hence, fix this by setting BT709 LR as
default color space info for RGBA enc session.

Change-Id: I6f9fa0986dd8657b1d6bcc2c86286aa51813f518
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-12 17:39:33 -07:00
Akshata Sahukar
975c7beb5e video: driver: move state to ERROR instead of just returning -EINVAL
move driver state to ERROR if any session pkt processing failed.

Change-Id: Id9c653eb01a0845d6d25cf16383f34707d76ba96
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-07-08 14:34:52 -07:00
Dikshita Agarwal
9a47e9a449 video: driver: update required fields of format struct
The driver should update field variable of format
structure with a value other than V4L2_FIELD_ANY.
Update it with V4L2_FIELD_NONE.

Fixes: v4l2-compliance: testGetFormats(VIDIOC_G_FMT).

Change-Id: I2338c867b543b2964c0c6a84f76cfad6862a935f
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
2021-07-07 12:01:03 -07:00
Govindaraj Rajagopal
5cf62d3aa0 video: driver: update buffer counts during codec change
At the time of codec change, only properties related to that
particular port gets updated. So other port is still referring
default values from previous codec type, which is not correct.
So added change to properly update buffer count during codec
change.

Change-Id: I320a0916cbf48f06448a959b07e13b74ebb0fd1c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-06-25 19:35:04 +05:30
Priyanka Gujjula
e61b55879b video: driver: Add support for enc auto framerate
1. Calculate framerate based on buffer timestamp
2. If framerate changed and stable for 2 frames,
   update it to firmware and in driver internally.

Change-Id: I7feda86dec8fcfc1dff6defac8c15a97c1b8393e
Signed-off-by: Priyanka Gujjula <pgujjula@codeaurora.org>
2021-06-17 22:54:34 +05:30
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
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
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
4ab25dd749 Merge "video: driver: update metadata buffer size" 2021-06-02 15:31:22 -07:00
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
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
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
Govindaraj Rajagopal
63a42011b2 video: driver: tune dcvs and batching buffer count
[1] add dcvs cushion buffers, only if core supports dcvs
[2] update buffer_count for dcvs & batching for priority
    static control.
[3] add max_fps & max_mbpf checks to disable decode_batching.
[4] add low_latency check in msm_vidc_allow_dcvs api.

Change-Id: Iafb7ad4aa601a0a3753e30475a8709f261719b0c
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
2021-05-26 20:59:13 +05:30
Akshata Sahukar
945883602d video: driver: add support to set csc coefficients
Add support to honor client enablement of csc custom
matrix and set csc coeff to video firmware.

Change-Id: I14d702eb7033541aa439bebe11df7fc4aa49ffdb
Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
2021-05-19 17:17:01 -07:00
qctecmdr
279c643900 Merge "msm: vidc: Add support of timestamps based frame rate" 2021-05-15 14:09:18 -07:00
qctecmdr
76b516e7e6 Merge "video: driver: Add index check in enum format" 2021-05-14 21:48:57 -07:00
Mihir Ganu
3f52f1e392 video: driver: Add index check in enum format
Add index check in enum fmt call and add the missing
break statement in handle_session_property.

Change-Id: Ida294f9ad4b8fa5c86d73b0e5bbd5297d8dbcd1b
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
2021-05-14 14:46:12 -07:00
Vikash Garodia
90d7de5658 video: driver: define hfi setter for configuring pipe
Deprecate custom pipe setting and use the hfi setter
to configure it alongwith other configurations.

Change-Id: Iffbd25df89f43cf77c1fa85ffa97601a31998410
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-14 23:48:15 +05:30
Vikash Garodia
75ecec1bb5 video: driver: Add support dynamic low latency for decoder
Latency property is set to firmware during streamon output port,
if set as part of initial configuration by client.
During runtime, the property is set as and when configured by
client.

1. Make the latency property dynamic for decoder.
2. For encoder, the same gets set to firmware with regular
   v4l2 set properties.
3. For decoder, set the property explicitly during streamon
   output port.

Change-Id: I35990614b95e57f113ddacfc2272cad6ae0dde82
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
2021-05-14 23:47:30 +05:30