dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>, etnaviv@lists.freedesktop.org
Cc: Russell King <linux+etnaviv@armlinux.org.uk>,
	dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH 3/3] drm/etnaviv: implement softpin
Date: Mon, 05 Aug 2019 10:58:57 +0200	[thread overview]
Message-ID: <1564995537.3056.6.camel@pengutronix.de> (raw)
In-Reply-To: <20190802172953.4586-4-l.stach@pengutronix.de>

On Fri, 2019-08-02 at 19:29 +0200, Lucas Stach wrote:
> With softpin we allow the userspace to take control over the GPU virtual
> address space. The new capability is relected by a bump of the minor DRM
> version. There are a few restrictions for userspace to take into
> account:
> 
> 1. The kernel reserves a bit of the address space to implement zero page
> faulting and mapping of the kernel internal ring buffer. Userspace can
> query the kernel for the first usable GPU VM address via
> ETNAVIV_PARAM_SOFTPIN_START_ADDR.
> 
> 2. We only allow softpin on GPUs, which implement proper process
> separation via PPAS. If softpin is not available the softpin start
> address will be set to ~0.
> 
> 3. Softpin is all or nothing. A submit using softpin must not use any
> address fixups via relocs.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/etnaviv/etnaviv_drv.c        |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_drv.h        |  2 ++
>  drivers/gpu/drm/etnaviv/etnaviv_gem.c        |  4 ++--
>  drivers/gpu/drm/etnaviv/etnaviv_gem.h        |  1 +
>  drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 25 +++++++++++++++++++-
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c        |  9 +++++++
>  include/uapi/drm/etnaviv_drm.h               |  5 +++-
>  7 files changed, 43 insertions(+), 5 deletions(-)
> 
[...]
> diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h
> index 0d5c49dc478c..c5710485650c 100644
> --- a/include/uapi/drm/etnaviv_drm.h
> +++ b/include/uapi/drm/etnaviv_drm.h
> @@ -73,6 +73,7 @@ struct drm_etnaviv_timespec {
>  #define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT         0x18
>  #define ETNAVIV_PARAM_GPU_NUM_CONSTANTS             0x19
>  #define ETNAVIV_PARAM_GPU_NUM_VARYINGS              0x1a
> +#define ETNAVIV_PARAM_SOFTPIN_START_ADDR            0x1b
>  
>  #define ETNA_MAX_PIPES 4
>  
> @@ -177,9 +178,11 @@ struct drm_etnaviv_gem_submit_pmr {
>  #define ETNA_SUBMIT_NO_IMPLICIT         0x0001
>  #define ETNA_SUBMIT_FENCE_FD_IN         0x0002
>  #define ETNA_SUBMIT_FENCE_FD_OUT        0x0004
> +#define ETNA_SUBMIT_SOFTPIN             0x0008
>  #define ETNA_SUBMIT_FLAGS		(ETNA_SUBMIT_NO_IMPLICIT | \
>  					 ETNA_SUBMIT_FENCE_FD_IN | \
> -					 ETNA_SUBMIT_FENCE_FD_OUT)
> +					 ETNA_SUBMIT_FENCE_FD_OUT| \
> +					 ETNA_SUBMIT_SOFTPIN)
>  #define ETNA_PIPE_3D      0x00
>  #define ETNA_PIPE_2D      0x01
>  #define ETNA_PIPE_VG      0x02

The presumed field of drm_etnaviv_gem_submit_bo has an elaborate comment
on its supposed pre-softpin use in etnaviv_drm.h, maybe that should be
updated.

Otherwise,

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2019-08-05  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 17:29 [PATCH 0/3] etnaviv softpin support Lucas Stach
2019-08-02 17:29 ` [PATCH 1/3] drm/etnaviv: skip command stream validation on PPAS capable GPUs Lucas Stach
2019-08-05  8:20   ` Philipp Zabel
2019-08-02 17:29 ` [PATCH 2/3] drm/etnaviv: allow to request specific virtual address for gem mapping Lucas Stach
2019-08-05  8:21   ` Philipp Zabel
2019-08-02 17:29 ` [PATCH 3/3] drm/etnaviv: implement softpin Lucas Stach
2019-08-05  8:58   ` Philipp Zabel [this message]

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=1564995537.3056.6.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=patchwork-lst@pengutronix.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;
as well as URLs for NNTP newsgroup(s).