Re: [PATCH 01/18] media: venus: hfi_venus: Set venus_sys_idle_indicator to false on V6

From: Konrad Dybcio
Date: Tue Apr 04 2023 - 13:52:20 EST




On 30.03.2023 12:44, Vikash Garodia wrote:
> On 3/24/2023 2:46 PM, Dikshita Agarwal wrote:
>>
>>
>> On 3/20/2023 8:24 PM, Konrad Dybcio wrote:
>>> On 2.03.2023 07:39, Dikshita Agarwal wrote:
>>>> On 2/28/2023 10:23 PM, Bryan O'Donoghue wrote:
>>>>> On 28/02/2023 15:41, Konrad Dybcio wrote:
>>>>>>> Can you test it and make sure ?
>>>>>> As I mentioned in the cover letter, 8250 still seems to work with this
>>>>>> patchset. I have no idea how one would go about validating the
>>>>>> functionality enabled through this call.
>>>>> We offlined about this.
>>>>>
>>>>> I think it is correct to say you don't have access to a display to test this on sm8250.
>>>>>
>>>>> I do so, I will try this out for you, though I'll wait for your V2 for this series.
>>>>>
>>>>> ---
>>>>> bod
>>>> Hi Konrad,
>>>>
>>>> I understand from your commit text, setting this indicator for AR50L is causing issue with suspend.
>>>>
>>>> Ideally it shouldn't cause any such issue. I checked with FW team and got to know that this property is not supported on AR50LT so if you set it there should be some property not supported error.
>>>>
>>>> In my opinion it would be good to replace these versions checks with VPU version check you have introduced in your other patch and keep this setting for current targets and not set wherever not needed eg AR50LT.
>>> So.. I did *something* and I'm no longer getting a jump to EDL.
>>>
>>> The *something* being knocking off hfi_core_suspend().
>>>
>>> If I send a sys_idle_indicator = true, I get (reformatted for
>>> better legibility):
>>>
>>>
>>> [    0.576543] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> IMAGE_VARIANT_STRING=PROD
>>>
>>> [    0.603818] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> OEM_IMAGE_VERSION_STRING=CRM
>>>
>>> [    0.608633] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_H:HostDr:unkn:--------:-> BUILD_TIME: Mar 15 2021 04:24:58
>>>
>>> [    0.608644] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_L:HostDr:unkn:--------:-> Host cmd 0x10005
>>>
>>> [    0.608655] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> VenusHostDriver_SetSysProperty(1019): HostDriver:  VenusHostDriver_SetSysProperty unsupport property!
>>>
>>> [    0.608667] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> WaitForHWidle(408): VENUS is idle, no HW is running
>>>
>>> [    0.650759] qcom-venus 5a00000.video-codec: VenusFW  :
>>> <VFW_E:HostDr:unkn:--------:-> assert_loop(433):
>>> FW Assertion - Z:/b/venus_proc/venus/drivers/src/VenusHostDriver.c:1020:5ab9a
>>
>> this "unsupported property" error and then the assert from FW is expected on AR50LT if driver sets HFI_PROPERTY_SYS_IDLE_INDICATOR to FW.
>>
>> As I mentioned in my other reply, this property doesn't need to be set by driver now, FW internally always enables it.
>>
>>> Which then crashes Venus for good (perhaps we're missing a
>>> handler for such errors that would hard reset the hw), meaning
>>> trying to access it through ffmpeg will result in it never firing
>>> any IRQs, so no submitted commands ever complete.
>>>
>>> With this information, after uncommenting the hfi_core_suspend
>>> call and changing:
>>>
>>> [1]
>>> --- hfi_venus.c : venus_suspend_3xx() --
>>>
>>> - venus_prepare_power_collapse(hdev, true);
>>> + venus_prepare_power_collapse(hdev, false);
>>>
>>> ----------------------------------------
>>>
>>> I was able to test further. Turning the ARM9 core off messes
>>> with the sys_idle things. Perhaps some power sequencing is
>>> wrong. The diff I just mentioned comes from the fact that
>>> AR50L will never ever ever send a PC_PREP_DONE ack, or at
>>> least downstream never expects it (or any other HFI6XX
>>> target FWIW) to do so.
>>>
>>>
>>> Now, I also realized the adjacent set_power_control doesn't seem to be used at
>>> all on msm-4.19 techpack/video. Testing all the possible combinations, I get
>>> (to make it extra clear, with all the powerdown stuff in place and only diff
>>> [1] in place atop what I already had before):
>>>
>>>
>>> [set_idle_message] [set_power_control] [result]
>>> 0 0 - no crash at boot, venus doesn't work ->
>>>     "Too many packets buffered for output stream 0:1."
>>>
>>> 0 1 - no crash at boot, ffmpeg hangs near vdec session init ->
>>>     jump to EDL shortly after
>>>
>>> 1 0 - hang at boot, even before display subsys initializes ->
>>>     platform totally hangs
>>>
>>> 1 1 - same as (1, 0), probably due to sys_idle_indicator being on ->
>>>     platform totally hangs as well
>>>
>>> Perhaps (0, 0) is "good" and things can be worked up from there?
>>> Can you recheck with the firmware team if this is expected?
>>
>> I will check regarding set_power_control(HFI_PROPERTY_SYS_CODEC_POWER_PLANE_CTRL) with FW team and get back.
>>
> HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (which is versioned as V1 in video driver). This can be dropped.
>
> Since the property is not functionally active, it is upto firmware when they might decide to start error out as unsupported property.
>
> SYS_CODEC_POWER_PLANE_CTRL is supported for AR50/AR50L/IRIS1/2. It is a mandatory HFI to get the required power benefits.
>
> vcodec0 GDSC should be also configured as HW_CTRL while setting POWER_PLANE_CTRL to firmware.
>
Okay that's very good to know. To sum it up, the outcome you would
expect is (more or less):

- static bool venus_sys_idle_indicator = true;

[...]

- if(IS_V4(hdev->core) || IS_V6(hdev->core))
- venus_sys_idle_indicator = true;

+ venus_sys_idle_indicator = IS_V1(hdev->core);


?

Konrad
>> Thanks,
>>
>> Dikshita
>>
>>> Konrad
>>>> Thanks,
>>>>
>>>> Dikshita
>>>>