Commit Graph

42 Commits

Author SHA1 Message Date
Ashish Patil
dde3e01a63 video: driver: enabling new power calculation changes
Change-Id: I9ea52a2f766921f8012a951f5e07a2d18d5d7e55
Signed-off-by: Ashish Patil <quic_ashpat@quicinc.com>
2023-03-08 11:52:02 -08:00
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
Akshata Sahukar
9a5fea8ef3 video: driver: Add support to enable enc ring buffer
Add support to enable ring buffer for enc intermediate
bin buffer to improve encoding performance.

Change-Id: Ifbf50cb48278c62c09a20bc7626a3b6288813830
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-07 17:14:30 -08:00
Akshata Sahukar
fb2e2c5715 video: driver: Align hfi files to pick ring buffer changes
Align hfi property and memory file to pick interface changes
for encoder ring buffer support

Change-Id: Icde4cdffe5275d416c51c36e562bb832027b0fa1
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-07 17:13:09 -08:00
Akshata Sahukar
2b974f7ad0 video: driver: Align hfi files to pick synx fence changes
Align hfi property and registers file with to pick synx fence
related interface changes

Change-Id: I19e5cce4d67f2f1eeacf917f9e688d2bb20f6585
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
2023-03-03 16:59:49 -08:00
Vedang Nagar
17bc01b78f video: driver: Move clk/qcom.h to external reseource file
Move qcom.h header file from resources.h to resources_ext file.

Change-Id: I81735461f093fe724a51d66538be1cc562fc0e24
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-02-26 22:26:16 +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
qctecmdr
8df204443f Merge "video: driver: remove config dependencies" 2023-02-23 08:10:06 -08:00
Maheshwar Ajja
e044c01ccc video-driver: resolve retry assert xo reset issue
In assert xo reset failure case, count increment and
usleep are skipped resulting in indefinite while loop.
Correct the conditions to avoid looping indefinitely.

Change-Id: I38fae272f0c7c676e1454e1fb0a8bfee860ea2f0
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2023-02-21 13:26:14 -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
Vedang Nagar
8765409333 video: driver: Fix unbalanced irq warning in interrupt handling
In case of watchdog interrupt, power off sequence will
get called which will make intr_status to 0 due to which
enable_irq gets called from isr_handler irrespective of
watchdog interrupt. Now during power up sequence again
when the enable_irq gets called, it will through
"Unbalanced enable for irq" error.
Added a fix for the same.

Call trace ->
enable_irq+0x9c/0xf8
__power_on_ar50lt+0x2d4/0x320 [msm_video]
__load_fw+0x92c/0x1368 [msm_video]
venus_hfi_core_init+0x64/0x468 [msm_video]
msm_vidc_core_init+0x158/0x4bc [msm_video]
msm_vidc_open+0x90/0x804 [msm_video]

Change-Id: Ic675d7540ef029e530a8cd5b87fb97f72e72057f
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
2023-02-14 12:38:20 +05:30
Manikanta Kanamarlapudi
06d84f081f msm: vidc: update dpb buffer size only for film grain content
update buffer size only for film grain content.

Change-Id: Ia9230d36ef0c917723fdb1eea82adfb8df3b3413
Signed-off-by: Manikanta Kanamarlapudi <quic_kmanikan@quicinc.com>
2023-02-09 06:42:34 -08:00
qctecmdr
54c8d7570d Merge "video: driver: add power domain and opp table support for video" 2023-01-28 00:56:41 -08:00
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
qctecmdr
576e231f23 Merge "video: driver: Update non_comv_h265e buffer size" 2023-01-18 13:36:09 -08:00
qctecmdr
9f3da9e6d4 Merge "video: driver: introduce macros from hfi_registers.h" 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
Chinmay Sawarkar
7ea481092e video: driver: Update non_comv_h265e buffer size
HFI_BUFFER_NON_COMV_H265E updated to incorporate
multi-tile single slice change.

Change-Id: Ia1f48cc1680a411b107c1ee95377d493cb682739
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2023-01-13 16:25:44 -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
cfe3869048 video: driver: introduce macros from hfi_registers.h
Introduce macros defined in hfi_registers.h interface file
and cleanup unused macros.

Change-Id: Icf05f2ca2fb69556a1c8d076c87af687fd98ed87
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
2023-01-12 11:28:44 -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
qctecmdr
9b51939152 Merge "video: driver: set force mem and pheripheral on flags" 2022-12-22 11:18:57 -08:00
qctecmdr
2d442bba69 Merge "video: iris33: ensure AON spare register to become zero" 2022-12-22 11:18:56 -08:00
Maheshwar Ajja
4716d7bc72 video: driver: set force mem and pheripheral on flags
Set mvs0c clock flags (force mem and pheripheral on).

Change-Id: I52380a30a4c74d9658f989377b5c77209cd8a33e
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-12-19 14:58:23 -08:00
Govindaraj Rajagopal
c4982fbf1a video: driver: refine core state machine
introduced core error state and added changes
to refine core state machine.

Change-Id: Ib3b94fd3798e902b7a6cfc5de45820558c89806e
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-12-15 07:59:45 +05:30
Maheshwar Ajja
520a2893df video: iris33: ensure AON spare register to become zero
Poll for AON spare register BIT(0) to become zero before
asserting XO reset from video driver to ensure CVP/EVA driver
is not asserting XO reset around the same time. Asserting
XO reset by both driver at the same time may result in
unpredictable behavior.

Change-Id: I71a0bd0175ef7701c9a855abbf3c2e741d937dfb
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-12-14 11:09:32 -08:00
qctecmdr
36346afa9d Merge "video: driver: remove extra mvs0c clock reset" 2022-12-07 14:54:07 -08:00
qctecmdr
fdb319f335 Merge "video: driver: Move adjust/set control functions to common/platform.c" 2022-12-07 14:54:07 -08:00
Deepa Guthyappa Madivalara
832e9aefa8 video: driver: remove extra mvs0c clock reset
Remove addtional mvs0c clock reset which is not
required from power off sequence

Change-Id: I2077cb0ceee6451cd2d2af067ac8a7be3335dd16
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-12-06 11:44:31 -08:00
Govindaraj Rajagopal
9b0140cf03 video: driver: add core sub_state support
Introduce core->sub_state similar to inst->sub_state.

[1] pm_suspended - moved to this substate in case of PM suspend
[2] handoff - moved to this state after successful
    handoff_regulator call.
[3] fw_power_control - moved to this state in case of IFPC.
[4] power_enable - will track core power_on/power_off status.
[5] page_fault - used to rate_limit fault logs.
[6] cpu_wd - indicates hw fired wd interrupt.
[7] video_unresponsive - moved to this state if sync cmd fails.

Change-Id: Iceb65cf404fd93aff7846860b0276307e4eab570
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-11-23 10:53:11 +05:30
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
Maheshwar Ajja
d934279ad4 video: driver: add resets in power off sequence
Add assert and deassert axi and mvs0c resets to
avoid video hardware unresponsive issues due to
multiple power collapse sequence execution.

Change-Id: I25ec99eab6b50111161ec9486ea1155bee63f7fc
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-11-11 18:59:14 -08:00
qctecmdr
b1bf3f1148 Merge "Video Driver: fix frame freeze for HEVC 10bit all intra decoding" 2022-11-11 13:15:32 -08:00
Deepa Guthyappa Madivalara
9db29e4eda video: driver: add assert and deassert reset functions
- Add assert and deassert reset control functions to
  update power off sequence in pineapple chipset
- Rename clock names to match with clock macros

Change-Id: Ic6dc0daac8110597bfcb02cceba94d2b97548723
Signed-off-by: Maheshwar Ajja <quic_majja@quicinc.com>
2022-11-07 18:31:55 -08:00
Ankush Mitra
b35fde25c4 Video Driver: fix frame freeze for HEVC 10bit all intra decoding
1. Allow turbo for HEVC 10bit all intra decoding;
2. Add 25 percent extra to VSP cycle for HEVC
   10bit all intra decoding;

Change-Id: I794b2a896f7e9444c8979abdb15b8e673a5270ee
Signed-off-by: Zhongbo Shi <quic_zhongbos@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 09:01:17 -08:00
Ankush Mitra
dc39a04e6e video: driver: follow vcodec power collapse seq for PC failure case
if PC fails for 10 times then video driver is treating that situation
as fatal and doing force core_deinit(), in this case firmware will not
follow vcodec power_collapse sequence and if there any pending
transaction from any session it will cause smmu_fault during next
firmware_boot sequence. Added change to perform vcodec power_collapse
from power_off_iris3_hardware() incase of core_deinit due to PC failure.

Change-Id: I45e32985d87b5cc882c4f96f77d1cabc796e6ba0
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Signed-off-by: Ankush Mitra <quic_ankumitr@quicinc.com>
2022-11-07 07:59:33 -08:00
qctecmdr
3fd4e7f225 Merge "video: driver: fix VCODEC_VIDEO_CC_BASE address" 2022-10-21 10:31:53 -07:00
Deepa Guthyappa Madivalara
fc19b28231 video: driver: fix VCODEC_VIDEO_CC_BASE address
Fix VCODEC_VIDEO_CC_BASE from 0x00F00000 to 0x000F0000

Change-Id: Icda45653be646647ee563322651333cf6c9c4582
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-10-20 11:42:38 -07:00
Govindaraj Rajagopal
3560442234 video: driver: add resource ops macro support
Added call_res_op() macro and used at all possible
places to avoid invalid pointer dereference issue.

Also added changes to cleanup unused functions.

Change-Id: Id77711ad9eaf7b407208567b0fde1f2693588641
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-20 12:18:25 +05:30
Govindaraj Rajagopal
ca9cc59d28 video: driver: add additional platform_data support
Add additional platform_data support for waipio,
pineapple, kalama, anorak targets.

Change-Id: I2def953c88eb4ba41de270bf208da112d4e547bf
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
2022-10-18 00:13:22 +05:30
Chinmay Sawarkar
b0f6be067e video: driver: Update lanai power sequence
1. Update core power down sequence.
2. Update hw power up sequence.

Change-Id: I428869ac92154b23cdbe3f51c7b299fe8a6cc71b
Signed-off-by: Chinmay Sawarkar <quic_chinmays@quicinc.com>
2022-10-14 15:23:32 -07:00
Deepa Guthyappa Madivalara
3d9c6f17f9 video: driver: Add support for lanai/iris3.3 platform
Add the required config and platform files to enable
lanai platform with iris3.3 VPU.

Change-Id: I441d631b9876705342e34097feff3e5d355d6b71
Signed-off-by: Deepa Guthyappa Madivalara <quic_dmadival@quicinc.com>
2022-09-28 14:36:08 -07:00