From: Lucas Stach <l.stach@pengutronix.de>
To: Rob Clark <robdclark@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Rob Clark <robdclark@chromium.org>,
linux-arm-msm@vger.kernel.org,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
open list <linux-kernel@vger.kernel.org>,
Sean Paul <sean@poorly.run>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH] drm/msm: Add MSM_SUBMIT_BO_NO_IMPLICIT
Date: Wed, 07 Dec 2022 11:15:25 +0100 [thread overview]
Message-ID: <d3433e207ff8ea243ff1d4cceeea19e4676c97c5.camel@pengutronix.de> (raw)
In-Reply-To: <20221206192123.661448-1-robdclark@gmail.com>
Hi Rob,
Am Dienstag, dem 06.12.2022 um 11:21 -0800 schrieb Rob Clark:
> From: Rob Clark <robdclark@chromium.org>
>
> In cases where implicit sync is used, it is still useful (for things
> like sub-allocation, etc) to allow userspace to opt-out of implicit
> sync on per-BO basis.
>
Out of curiosity and because I have been thinking about something like
that for etnaviv for while: do you only use this for immutable buffers
or do you have some kind of userspace fencing in place for the
suballocated buffers?
Regards,
Lucas
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> drivers/gpu/drm/msm/msm_drv.c | 3 ++-
> drivers/gpu/drm/msm/msm_gem_submit.c | 11 +++++++++++
> include/uapi/drm/msm_drm.h | 4 +++-
> 3 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
> index 017a512982a2..e0e1199a822f 100644
> --- a/drivers/gpu/drm/msm/msm_drv.c
> +++ b/drivers/gpu/drm/msm/msm_drv.c
> @@ -45,9 +45,10 @@
> * - 1.7.0 - Add MSM_PARAM_SUSPENDS to access suspend count
> * - 1.8.0 - Add MSM_BO_CACHED_COHERENT for supported GPUs (a6xx)
> * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN
> + * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT
> */
> #define MSM_VERSION_MAJOR 1
> -#define MSM_VERSION_MINOR 9
> +#define MSM_VERSION_MINOR 10
> #define MSM_VERSION_PATCHLEVEL 0
>
> static const struct drm_mode_config_funcs mode_config_funcs = {
> diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
> index eb3536e3d66a..8bad07a04f85 100644
> --- a/drivers/gpu/drm/msm/msm_gem_submit.c
> +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
> @@ -334,9 +334,20 @@ static int submit_fence_sync(struct msm_gem_submit *submit, bool no_implicit)
> if (ret)
> return ret;
>
> + /* If userspace has determined that explicit fencing is
> + * used, it can disable implicit sync on the entire
> + * submit:
> + */
> if (no_implicit)
> continue;
>
> + /* Otherwise userspace can ask for implicit sync to be
> + * disabled on specific buffers. This is useful for internal
> + * usermode driver managed buffers, suballocation, etc.
> + */
> + if (submit->bos[i].flags & MSM_SUBMIT_BO_NO_IMPLICIT)
> + continue;
> +
> ret = drm_sched_job_add_implicit_dependencies(&submit->base,
> obj,
> write);
> diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
> index f54b48ef6a2d..329100016e7c 100644
> --- a/include/uapi/drm/msm_drm.h
> +++ b/include/uapi/drm/msm_drm.h
> @@ -222,10 +222,12 @@ struct drm_msm_gem_submit_cmd {
> #define MSM_SUBMIT_BO_READ 0x0001
> #define MSM_SUBMIT_BO_WRITE 0x0002
> #define MSM_SUBMIT_BO_DUMP 0x0004
> +#define MSM_SUBMIT_BO_NO_IMPLICIT 0x0008
>
> #define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | \
> MSM_SUBMIT_BO_WRITE | \
> - MSM_SUBMIT_BO_DUMP)
> + MSM_SUBMIT_BO_DUMP | \
> + MSM_SUBMIT_BO_NO_IMPLICIT)
>
> struct drm_msm_gem_submit_bo {
> __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
next prev parent reply other threads:[~2022-12-07 10:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 19:21 [PATCH] drm/msm: Add MSM_SUBMIT_BO_NO_IMPLICIT Rob Clark
2022-12-07 10:15 ` Lucas Stach [this message]
2022-12-07 14:46 ` Rob Clark
2023-01-05 12:49 ` Daniel Vetter
2023-01-05 14:51 ` Rob Clark
2023-01-05 14:52 ` Daniel Vetter
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=d3433e207ff8ea243ff1d4cceeea19e4676c97c5.camel@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/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