Commit Graph

64 Commits

Author SHA1 Message Date
Akshata Sahukar
907ea75504 video: driver: Add support to enable output tx sw fence by default
As part of default enablement of output tx type sw fence,
add this support in driver to disable fence based on
below conditions for INPUT_PSC propertities:
- If session is interlace type
- If OUTPUT_ORDER is 0 and HFI_PROP_MAX_NUM_REORDER_FRAMES > 0

Change-Id: If861129ba96329c0277a9c9698f67baf25e5d82e
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-06-15 16:11:58 -07:00
qctecmdr
2c5cd81fe8 Merge "video: driver: cleanup driver remove sequence" 2023-06-15 09:01:57 -07:00
Govindaraj Rajagopal
29d10ac07b video: driver: cleanup driver remove sequence
Remove deinit sequence calls and register devm
managed callbacks, so that kernel can invoke
then, when dev scope ends and cleansup all
associated resources.

Change-Id: I729fd21fe32d9f39240d0b743f910409d93a00c5
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-06-13 13:17:23 +05:30
Gaviraju Doddabettahalli Bettegowda
4bab4056f6 video: driver: Encode with multi slice mode
Bitrate is not a mandatory parameter for setting multi-slice encode configuration.
If the client not setting bitrate then default value can be used to
calculate slice count incase of byte mode multi slice encode,
and it's not needed for macro-block mode multi slice encode.

Currently, multi slice encode is enabled only when client set bitrate
explicitly otherwise it's configuring single slice encode mode.

So added change to remove the bitrate dependancy for configuring multi slice encode.

Change-Id: Ia9c541d693107b9eb57e530c6e44cad70216f1dc
Signed-off-by: Gaviraju Doddabettahalli Bettegowda <quic_gdoddabe@quicinc.com>
2023-06-11 22:05:20 -07:00
Vedang Nagar
e2663ce820 video: driver: Remove inst check in video driver
Remove inst check from all the functions in video driver.
Inst check is present in most of the functions in video
driver which is not required.
Keep check only at root level functions and remove
from rest all of the functions.

Change-Id: Ib310cd3df5e8612a9fc3a5aa654dff4203a12906
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-05-25 21:04:49 +05:30
Vedang Nagar
3018f2c1d3 video: driver: Update session priority setting
Modify session priority controls -
  ___________________________________________________________
 |  Description    |    HAL Value     |Driver value|FW Value|
 |_________________|__________________|____________|________|
 |Critical Priority| Vendor Extension | Via control|   0    |
 |      RT         |        0         |      0     |   1    |
 |      NRT        |     -1 to -4     |     1-4    |  2-5   |
 |_________________|__________________|____________|________|

Change-Id: I7b28109bde3968f38c2e3cc42cf4cf5dd195cc10
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-05-23 20:58:04 +05:30
Akshata Sahukar
982e626d00 video: driver: Add support to 1kx1k tile for HEIC encoding
- Introduce new control to set HEIC encoder tile size from HAL
- Support 1k x 1k tile encoding along with existing 512 x 512
  tiling

Change-Id: Iaeffe421f8311d818695c3ae9af7cabcc8892043
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-04-28 10:07:48 -07:00
Ashish Patil
c7216017e1 video: driver: moving private controls to common platform folder
Move private controls from each platform source files to
common header file

Change-Id: I22d8aa7f81919d950eed6b1f4ccd020c803a7ce9
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-04-27 12:59:14 -07:00
Ankush Mitra
0a26c4b8ce video: driver: separate i/o subscribe prop codec wise
Separate i/o subscribe prop codec wise.

Change-Id: Ib4ba9d6d491f26bad9798c0d4d9be62b272d6421
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-04-20 17:56:09 +05:30
Akshata Sahukar
c46cdcb67f video: driver: Use HEIC as private codec type
Remove HEIC codec definition from UAPI and use it as private
codec type

Change-Id: I4023b638f56e9db11c74ae8894f8451ada05c6e8
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-04-07 10:50:54 -07:00
qctecmdr
005d5f44ef Merge "video: driver: remove core capability pointer" 2023-04-07 09:22:36 -07:00
Ashish Patil
cb18a42fa6 video: driver: added support for av1 uniform tile handling for power calculations
If the av1 tile rows and columns are greater than recommended decoder
av1 settings,vote for higher frequency.

Change-Id: Iea9f542e0b925a9ecb063c11b1827f31164f5a7b
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-04-06 14:17:21 -07:00
Ankush Mitra
6bdbae50f2 video: driver: remove core capability pointer
Remove core capability pointer.

Change-Id: I42f4c5cb7f8a0791b8c5f84d5f0d953be3bf80d6
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-04-06 10:56:57 +05:30
Ankush Mitra
e450d8eaa3 video: driver: remove capability pointer
Remove capability pointer and allocate
memory with max cap size.

Change-Id: I7f53e3b35439f91b72f057695b6e63f71bfecc0a
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-04-05 11:58:48 +05:30
Akshata Sahukar
203f619b7f video: driver: Add support to handle synx fence related hfi props/info
Add support to handle synx v2 fence related hfi properties and
infos mentioned below:
- HFI_PROP_FENCE_CLIENT_DATA
- HFI_PROP_FENCE_TYPE
- HFI_PROP_FENCE_DIRECTION
- HFI_PROP_FENCE_ERROR_DATA_CORRUPT
- HFI_INFO_FENCE_SIGNAL_ERROR

Change-Id: Ifac0230dbeb0da80c104860c0e115167e82e85c6
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-28 18:11:45 -07:00
Darshana Patil
fc6a238b09 video: driver: enable dynamic metadata
- enable Eva stats, hdr10/10+ as dynamic metadata.
- Make eva stats dependent on bitrate mode.
  Also remove preprocess and layer count as
  child of Eva stats.
- Make Hdr10/10+ dependent on profile.
- Adjust transcoding stats metadata based on
  bitrate mode, fps and resolution.

Change-Id: I7b110962e29db50cb321d69a0fb301950436da6f
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-21 11:53:10 -07:00
Akshata Sahukar
33d0b20141 video: driver: Add support for Synx V2 fences
Add Synx V2 fences support to improve latency
in video decode usecases.

Change-Id: If21f8b65895364a804f8e03580b09c44b377c199
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-17 13:59:37 -07:00
qctecmdr
59a8ab6758 Merge "video: driver: replace V4l2 macros with availble upstream macros" 2023-03-16 10:56:49 -07:00
Akshata Sahukar
f00fe9f305 video: driver: fix LTR adjustment
LTR is not correctly getting adjusted due to incorrect
goto statement leading to failure in premerge with
test_AVC_NV12C_3LTR_4Layers_Adjutment_Encode testcase.
Fix this.

Change-Id: Ieda4f33d6679f645c2eb349e8ddf1015a3814711
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-14 12:13:29 -07:00
Deepa Guthyappa Madivalara
1cf504b165 video: driver: replace V4l2 macros with availble upstream macros
Replace prior macros from downstream driver as these are now
defined in upstream V4l2 include files

Change-Id: I7d1677cd7ef95c05219e043e0c78d29299036bed
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-03-13 16:18:38 -07:00
Ankush Mitra
964752c27c video: driver: Remove hard parent dependency
Remove hard parent dependency
adjust it accordingly.

Change-Id: I8d5de2ba4199570f366745b980b451099467ebaa
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2023-03-09 12:05:19 +05:30
Ashish Patil
dd0e6d5f70 video: driver: update power calculations
Update power calculation to avoid low framerate or
frame drop issues

Change-Id: Ice306a44d4ea8242d965c0e5d03edffc0f5e0f8b
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-03-08 11:15:05 -08:00
Darshana Patil
552670ad6b video: driver: encoder delay start: CSC
Introduce a control for client to enable or disable
csc. Disable csc for 10-bit encoding based on color format.

Change-Id: Ia49324332ce9b05b6f1a1283fa758638a8cc3ab8
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-03-07 15:12:53 -08:00
Zhongbo Shi
133bfb56ea video: driver: move DPB_LIST to input port
1. Move DPB_LIST subscription on input
port instead of output port.

2. Move decoder port PSC and properties
to platform data.

Change-Id: I5711e0ba915ebe4136f64d1440ae331b787f4d61
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
2023-03-07 15:23:23 +08:00
qctecmdr
936f37d8ba Merge "video: driver: Move adjust/set control_ext API's to common/platform_ext.h/.c" 2023-03-01 16:35:56 -08:00
Megha Byahatti
4a578d26fd video: driver: Move adjust/set control_ext API's to common/platform_ext.h/.c
Remove msm_vidc_control_ext.h/.c

Change-Id: I5636705b38b7c5613baf8761953ae31963e6ffd3
Signed-off-by: Megha Byahatti <quic_mbyahatt@quicinc.com>
2023-02-24 15:37:21 +05:30
Ashish Patil
e28d357256 video: driver: lanai power calculations
New bandwidth and frequency calculation functions
for lanai.

Change-Id: I0ec4a74bc24598628fe94a6ebbe9df5e3cb71a9c
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-02-23 18:29:45 -08:00
Govindaraj Rajagopal
c3c85e9653 video: driver: remove config dependencies
remove all conditional compilation in video driver.
With this change, all files willbe always compiled
and will be available in final kernel object file.

Change-Id: I9843c246e23bd1ee4fb8918e5cfa840e2defd432
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-02-21 14:33:41 +05:30
qctecmdr
31ea48b224 Merge "video: driver: fix blur parent check" 2023-02-20 21:20:47 -08:00
Akshata Sahukar
3d18438cb0 video: driver: fix blur parent check
Blur pixel fmt parent check is specific to HEVC codec.
Fix this to avoid session failure.

Change-Id: I0323627383d56d1382e17f7a4b2cbb11edd6bf46
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-02-18 11:44:11 -08:00
Chinmay Sawarkar
6e414ca7a7 video: driver: kalama power calculations
New bandwidth and frequency calculation functions
for kalama.

Change-Id: Iaca0be832c42e00bb7404f7cfbac5bbf03427144
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-02-16 20:08:14 -08:00
qctecmdr
f0b5f5dd65 Merge "video: driver: disable 5 LTR support" 2023-02-11 12:13:30 -08:00
Akshata Sahukar
654e6bb55d video: driver: Add support to allow 5 LTR count
Add support to allow 5 LTR count as per new
requirement.

Change-Id: Ic839ea61ae8dfe21bd8891f0f0dbaf26506d84ec
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-01-30 13:08:35 -08:00
qctecmdr
0884f5a04a Merge "video: driver: restructure video state machine" 2023-01-28 00:56:41 -08:00
qctecmdr
54c8d7570d Merge "video: driver: add power domain and opp table support for video" 2023-01-28 00:56:41 -08:00
qctecmdr
f71e472d68 Merge "video: driver:remove support for dynamic layers and bitrates" 2023-01-27 11:25:17 -08:00
Govindaraj Rajagopal
7c365bdb94 video: driver: restructure video state machine
Re-structure video driver statemachine to use
event handler. Added event handler support for
event states.

Added change to handle event depending on the
underlying state implementation.

Change-Id: Ib55c12c6cadc4d780797a5aee75d5ea61e95c94f
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-27 16:31:23 +05:30
Darshana Patil
68df0645ec video: driver: add support to send aon region via HFI_MMAP_ADDR
- add support to intialise device region by reading data from
  platform to resources.
- add support for iommu_map and iommu_unmap apis.
- allocate a 4K page and send this address through
  HFI_MMAP_ADDR register.
- map AON region, send virtual address and size as payload.

Change-Id: I5aa26593309a220c5de62836e432c1bd5a63ba1d
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-20 10:49:32 -08:00
Ashish Patil
bf33925fa3 video: driver:remove support for dynamic layers and bitrates
- remove support of dynamic layer change for CBR
 - remove support of layerwise bitrate
 - any dynamic layer change request ignored without error for CBR_*FR cases
 - layerwise bitrate is mapped to cumulative bitrate

Change-Id: I96c70fabd3c2bf94ce989b9e94620c166892b8e6
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-01-19 09:07:22 -08:00
qctecmdr
954b0ff6f5 Merge "video: driver: add support for pineapple V2 devices" 2023-01-18 13:36:08 -08:00
Govindaraj Rajagopal
ab9b1a112b video: driver: add power domain and opp table support for video
Added changes to support generic power domain and opp table.
This is an alternative for downstream regulator framework.

power domain can be enabled using below dtsi entries.

power-domains =
    <&videocc MVS0C_GDSC>,
	<&videocc MVS0_GDSC>,
	<&rpmhpd SM8450_MXC>,
	<&rpmhpd SM8450_MMCX>
power-domain-names =
    "iris-ctl", "vcodec", "mx", "mmcx";

Power domain handles willbe parsed at driver side using below api's.
   - dev_pm_domain_attach_by_name()
   - devm_pm_opp_attach_genpd()

devm_pm_opp_attach_genpd() provides consumer virtual device handles
and i.e linked to core->dev using device_link_add().

MXC, MMCX rails wilbe powered up by scaling desired rate using
dev_pm_opp_set_rate().

Change-Id: I3d73434cb772078f031aec7cadc2d42ab930edd0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2023-01-18 16:44:23 +05:30
Deepa Guthyappa Madivalara
d8f253e2c0 video: driver: add support for pineapple V2 devices
Adding support for pineapple V2 devices

Change-Id: I9088895ff92ca34ee3b46bd99e0d068b478e083d
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2023-01-13 16:40:26 -08:00
Darshana Patil
ea34534af0 video: driver: update copyright markings to 2023
update copyright markings to 2023 in all files.

Change-Id: I6842d56c4a8fff6a7a93d0c1d4bc049041297b02
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-13 14:58:17 -08:00
Darshana Patil
a0082a4c81 video: driver: amend xo reset clock as shared resource
Use devm_reset_control_get_exclusive_released() instead of
devm_reset_control_get() to get the reset control of video_xo_reset
clock as it is shared reset clock between eva and video drivers.
Use reset_control_acquire() before assert and reset_control_release()
after de-assert video_xo_reset clock to avoid eva driver operating on
it in parallel.

Change-Id: I4936ed7a4556bb56d4b28546084fc877080308ef
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-05 09:58:30 -08:00
Ankush Mitra
bd1cd4368b video: driver: Prepare dependency list without parent
This is change 2 of the Prepare dependency list without
parent change.
In this change we remove all parent information from
the CAP database.

Change-Id: Ie0b878050ae2d24e3c1a41cbd579ef0f19d42250
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-12-13 19:10:18 +05:30
qctecmdr
fdb319f335 Merge "video: driver: Move adjust/set control functions to common/platform.c" 2022-12-07 14:54:07 -08:00
Ankush Mitra
1df215f203 video: driver: Move adjust/set control functions to common/platform.c
Move adjust/set control functions to common/platform.c as part of
upstream effort.
This is part 1 of the change.

Change-Id: I8c440740fe785b5b052c4d44963ea34c21419fa4
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-22 23:01:17 +05:30
Dikshita Agarwal
8030903f1e video: driver: add dma mask attribute to context banks
Upstream driver doesn't support context bank address ranges,
so add dma mask attribute to context bank to specify address
range for upstream driver.

Change-Id: I09191b500006d6c7abf364fbfa22377b480a4b4d
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-11-21 10:52:41 +05:30
Dikshita Agarwal
1ac85a3237 video: driver: check for regulator support before initializing
Upstream doesn't support regulators, while downstream kernel does.
So add a condition to check for regulator support before init.

Change-Id: Icab8aec20796546a33ac571963f871d146970002
Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
2022-11-07 16:51:12 +05:30
Ankush Mitra
6b0dcb4a4f video: driver: code re-structure memory ops support
Re-structure the memory_ops code so that
upstream driver use mem_ops defined on
msm_vidc_memory.c and downstream driver
use mem_ops defined on msm_vidc_memory_ext.c.
It helps to modularize the code even further.

Change-Id: Id00b0872d7a902a8540500df5efb5f546a9dbe41
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-10-28 00:06:28 +05:30