From: "Christian König" <christian.koenig@amd.com>
To: Rob Clark <robdclark@gmail.com>, dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Rob Clark <robdclark@chromium.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
"open list:DMA BUFFER SHARING FRAMEWORK"
<linux-media@vger.kernel.org>,
"moderated list:DMA BUFFER SHARING FRAMEWORK"
<linaro-mm-sig@lists.linaro.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 1/3] dma-fence: Add boost fence op
Date: Thu, 20 May 2021 08:46:51 +0200 [thread overview]
Message-ID: <8dcdc8d5-176c-f0ad-0d54-6466e9e68a0a@amd.com> (raw)
In-Reply-To: <20210519183855.1523927-2-robdclark@gmail.com>
Uff, that looks very hardware specific to me.
As far as I can see you can also implement completely inside the backend
by starting a timer on enable_signaling, don't you?
Christian.
Am 19.05.21 um 20:38 schrieb Rob Clark:
> From: Rob Clark <robdclark@chromium.org>
>
> Add a way to hint to the fence signaler that a fence waiter has missed a
> deadline waiting on the fence.
>
> In some cases, missing a vblank can result in lower gpu utilization,
> when really we want to go in the opposite direction and boost gpu freq.
> The boost callback gives some feedback to the fence signaler that we
> are missing deadlines, so it can take this into account in it's freq/
> utilization calculations.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> include/linux/dma-fence.h | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
> index 9f12efaaa93a..172702521acc 100644
> --- a/include/linux/dma-fence.h
> +++ b/include/linux/dma-fence.h
> @@ -231,6 +231,17 @@ struct dma_fence_ops {
> signed long (*wait)(struct dma_fence *fence,
> bool intr, signed long timeout);
>
> + /**
> + * @boost:
> + *
> + * Optional callback, to indicate that a fence waiter missed a deadline.
> + * This can serve as a signal that (if possible) whatever signals the
> + * fence should boost it's clocks.
> + *
> + * This can be called in any context that can call dma_fence_wait().
> + */
> + void (*boost)(struct dma_fence *fence);
> +
> /**
> * @release:
> *
> @@ -586,6 +597,21 @@ static inline signed long dma_fence_wait(struct dma_fence *fence, bool intr)
> return ret < 0 ? ret : 0;
> }
>
> +/**
> + * dma_fence_boost - hint from waiter that it missed a deadline
> + *
> + * @fence: the fence that caused the missed deadline
> + *
> + * This function gives a hint from a fence waiter that a deadline was
> + * missed, so that the fence signaler can factor this in to device
> + * power state decisions
> + */
> +static inline void dma_fence_boost(struct dma_fence *fence)
> +{
> + if (fence->ops->boost)
> + fence->ops->boost(fence);
> +}
> +
> struct dma_fence *dma_fence_get_stub(void);
> u64 dma_fence_context_alloc(unsigned num);
>
next prev parent reply other threads:[~2021-05-20 6:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 18:38 [RFC 0/3] dma-fence: Add a "boost" mechanism Rob Clark
2021-05-19 18:38 ` [RFC 1/3] dma-fence: Add boost fence op Rob Clark
2021-05-20 6:46 ` Christian König [this message]
2021-05-20 14:07 ` Rob Clark
2021-05-20 14:11 ` Christian König
2021-05-20 14:54 ` Rob Clark
2021-05-20 16:01 ` [Linaro-mm-sig] " Christian König
2021-05-20 16:34 ` Daniel Vetter
2021-05-20 16:40 ` Christian König
2021-05-20 17:08 ` Daniel Vetter
2021-05-21 7:43 ` Christian König
2021-05-21 14:21 ` Daniel Vetter
2021-05-20 16:25 ` Daniel Vetter
2021-05-19 18:38 ` [RFC 2/3] drm/atomic: Call dma_fence_boost() when we've missed a vblank Rob Clark
2021-05-20 16:29 ` Daniel Vetter
2021-05-30 14:33 ` Rob Clark
2021-06-01 14:18 ` Daniel Vetter
2021-06-01 15:46 ` Rob Clark
2021-06-01 16:11 ` Daniel Vetter
2021-05-19 18:38 ` [RFC 3/3] drm/msm: Wire up gpu boost 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=8dcdc8d5-176c-f0ad-0d54-6466e9e68a0a@amd.com \
--to=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sumit.semwal@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).