From: Sean Paul <sean@poorly.run>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
Rob Clark <robdclark@chromium.org>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Jeykumar Sankaran <jsanka@codeaurora.org>,
Allison Randal <allison@lohutok.net>,
Jordan Crouse <jcrouse@codeaurora.org>,
Thomas Gleixner <tglx@linutronix.de>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<linux-arm-msm@vger.kernel.org>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<freedreno@lists.freedesktop.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/9] drm/msm/dpu: add real wait_for_commit_done()
Date: Thu, 29 Aug 2019 09:04:59 -0400 [thread overview]
Message-ID: <20190829130459.GG218215@art_vandelay> (raw)
In-Reply-To: <20190827213421.21917-3-robdclark@gmail.com>
On Tue, Aug 27, 2019 at 02:33:32PM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Just waiting for next vblank isn't ideal.. we should really be looking
> at the hw FLUSH register value to know if there is still an in-progress
> flush without stalling unnecessarily when there is no pending flush.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
> ---
> .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 22 ++++++++++++++++++-
> 1 file changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> index 737fe963a490..7c73b09894f0 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
> @@ -526,6 +526,26 @@ static int dpu_encoder_phys_vid_wait_for_vblank(
> return _dpu_encoder_phys_vid_wait_for_vblank(phys_enc, true);
> }
>
> +static int dpu_encoder_phys_vid_wait_for_commit_done(
> + struct dpu_encoder_phys *phys_enc)
> +{
> + struct dpu_hw_ctl *hw_ctl = phys_enc->hw_ctl;
> + int ret;
> +
> + if (!hw_ctl)
> + return 0;
> +
> + ret = wait_event_timeout(phys_enc->pending_kickoff_wq,
> + (hw_ctl->ops.get_flush_register(hw_ctl) == 0),
> + msecs_to_jiffies(50));
> + if (ret <= 0) {
> + DPU_ERROR("vblank timeout\n");
> + return -ETIMEDOUT;
> + }
> +
> + return 0;
> +}
> +
> static void dpu_encoder_phys_vid_prepare_for_kickoff(
> struct dpu_encoder_phys *phys_enc)
> {
> @@ -676,7 +696,7 @@ static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops)
> ops->destroy = dpu_encoder_phys_vid_destroy;
> ops->get_hw_resources = dpu_encoder_phys_vid_get_hw_resources;
> ops->control_vblank_irq = dpu_encoder_phys_vid_control_vblank_irq;
> - ops->wait_for_commit_done = dpu_encoder_phys_vid_wait_for_vblank;
> + ops->wait_for_commit_done = dpu_encoder_phys_vid_wait_for_commit_done;
> ops->wait_for_vblank = dpu_encoder_phys_vid_wait_for_vblank;
> ops->wait_for_tx_complete = dpu_encoder_phys_vid_wait_for_vblank;
> ops->irq_control = dpu_encoder_phys_vid_irq_control;
> --
> 2.21.0
>
--
Sean Paul, Software Engineer, Google / Chromium OS
next prev parent reply other threads:[~2019-08-29 13:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 21:33 [PATCH 0/9] drm/msm: async commit support Rob Clark
2019-08-27 21:33 ` [PATCH 1/9] drm/msm/dpu: unwind async commit handling Rob Clark
2019-08-29 13:04 ` Sean Paul
2019-08-27 21:33 ` [PATCH 2/9] drm/msm/dpu: add real wait_for_commit_done() Rob Clark
2019-08-29 13:04 ` Sean Paul [this message]
2019-08-27 21:33 ` [PATCH 3/9] drm/msm/dpu: handle_frame_done() from vblank irq Rob Clark
2019-08-29 13:05 ` Sean Paul
2019-08-27 21:33 ` [PATCH 4/9] drm/msm: add kms->wait_flush() Rob Clark
2019-08-29 13:04 ` Sean Paul
2019-08-27 21:33 ` [PATCH 5/9] drm/msm: convert kms->complete_commit() to crtc_mask Rob Clark
2019-08-27 21:33 ` [PATCH 6/9] drm/msm: add kms->flush_commit() Rob Clark
2019-08-27 21:33 ` [PATCH 7/9] drm/msm: split power control from prepare/complete_commit Rob Clark
2019-08-27 21:33 ` [PATCH 8/9] drm/msm: async commit support Rob Clark
2019-08-27 21:33 ` [PATCH 9/9] drm/msm/dpu: " Rob Clark
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=20190829130459.GG218215@art_vandelay \
--to=sean@poorly.run \
--cc=airlied@linux.ie \
--cc=allison@lohutok.net \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jcrouse@codeaurora.org \
--cc=jsanka@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®