All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Alexandre Courbot <acourbot@chromium.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-arm-msm@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: venus: preserve DRC state across seeks
Date: Wed, 2 Dec 2020 12:28:03 +0200	[thread overview]
Message-ID: <89086086-c0d9-62b0-2819-a537fe92782f@linaro.org> (raw)
In-Reply-To: <CAPBb6MXt4uL+VgxQs6ynf5LKae657QXmrjw6XYnL0vg_zuuDsw@mail.gmail.com>

Hi,

On 12/2/20 12:24 PM, Alexandre Courbot wrote:
> On Wed, Dec 2, 2020 at 2:34 PM Alexandre Courbot <acourbot@chromium.org> wrote:
>>
>> DRC events can happen virtually at anytime, including when we are
>> starting a seek. Should this happen, we must make sure to return to the
>> DRC state, otherwise the firmware will expect buffers of the new
>> resolution whereas userspace will still work with the old one.
>>
>> Returning to the DRC state upon resume for seeking makes sure that the
>> client will get the DRC event and will reallocate the buffers to fit the
>> firmware's expectations.
> 
> Oops, please ignore as this seems to depend on another patch... I will
> repost once I can figure out the correct dependency chain, unless
> Stanimir can find a better way to handle DRC during seek and flush.

This patch depends on [1] series which is still under review.

[1] https://www.spinics.net/lists/linux-media/msg177801.html

> 
>>
>> Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
>> ---
>>  drivers/media/platform/qcom/venus/vdec.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
>> index 8488411204c3..e3d0df7fd765 100644
>> --- a/drivers/media/platform/qcom/venus/vdec.c
>> +++ b/drivers/media/platform/qcom/venus/vdec.c
>> @@ -972,7 +972,10 @@ static int vdec_start_output(struct venus_inst *inst)
>>
>>         if (inst->codec_state == VENUS_DEC_STATE_SEEK) {
>>                 ret = venus_helper_process_initial_out_bufs(inst);
>> -               inst->codec_state = VENUS_DEC_STATE_DECODING;
>> +               if (inst->next_buf_last)
>> +                       inst->codec_state = VENUS_DEC_STATE_DRC;
>> +               else
>> +                       inst->codec_state = VENUS_DEC_STATE_DECODING;
>>                 goto done;
>>         }
>>
>> @@ -1077,8 +1080,10 @@ static int vdec_stop_capture(struct venus_inst *inst)
>>                 ret = hfi_session_flush(inst, HFI_FLUSH_ALL, true);
>>                 fallthrough;
>>         case VENUS_DEC_STATE_DRAIN:
>> -               vdec_cancel_dst_buffers(inst);
>>                 inst->codec_state = VENUS_DEC_STATE_STOPPED;
>> +               fallthrough;
>> +       case VENUS_DEC_STATE_SEEK:
>> +               vdec_cancel_dst_buffers(inst);
>>                 break;
>>         case VENUS_DEC_STATE_DRC:
>>                 WARN_ON(1);
>> @@ -1102,6 +1107,7 @@ static int vdec_stop_output(struct venus_inst *inst)
>>         case VENUS_DEC_STATE_DECODING:
>>         case VENUS_DEC_STATE_DRAIN:
>>         case VENUS_DEC_STATE_STOPPED:
>> +       case VENUS_DEC_STATE_DRC:
>>                 ret = hfi_session_flush(inst, HFI_FLUSH_ALL, true);
>>                 inst->codec_state = VENUS_DEC_STATE_SEEK;
>>                 break;
>> @@ -1371,6 +1377,7 @@ static void vdec_event_change(struct venus_inst *inst,
>>                         dev_dbg(dev, VDBGH "flush output error %d\n", ret);
>>         }
>>
>> +       inst->next_buf_last = true;
>>         inst->reconfig = true;
>>         v4l2_event_queue_fh(&inst->fh, &ev);
>>         wake_up(&inst->reconf_wait);
>> --
>> 2.29.2.454.gaff20da3a2-goog
>>

-- 
regards,
Stan

  reply	other threads:[~2020-12-02 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02  5:34 [PATCH] media: venus: preserve DRC state across seeks Alexandre Courbot
2020-12-02  9:28 ` kernel test robot
2020-12-02  9:28   ` kernel test robot
2020-12-02 10:24 ` Alexandre Courbot
2020-12-02 10:28   ` Stanimir Varbanov [this message]
2020-12-17  9:46 ` Stanimir Varbanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89086086-c0d9-62b0-2819-a537fe92782f@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=acourbot@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.