All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
To: Steven Price <steven.price@arm.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <sean@poorly.run>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Robin Murphy <Robin.Murphy@arm.com>
Subject: Re: [PATCH v2 6/7] drm/panfrost: Add support for GPU heap allocations
Date: Fri, 26 Jul 2019 06:57:08 -0700	[thread overview]
Message-ID: <20190726135708.GA8834@kevin> (raw)
In-Reply-To: <1c54bd6c-a594-614d-7de0-badb00269ea1@arm.com>


[-- Attachment #1.1: Type: text/plain, Size: 1680 bytes --]

> It looks like the driver might be allocated a depth or stencil buffer
> without knowing whether it will be used. The buffer is then "grown" if
> it is needed by the GPU. The problem is it is possible for the
> application to access it later.

Hmm. I "think" you should be able to use a dummy (unbacked) Z/S buffer
when it won't be used, and as soon as the *driver* decides it will be
used (e.g. by setting the MALI_MFBD_DEPTH_WRITE bit), *that* is when you
allocate a real memory-backed BO. Neither case needs to be growable;
growable just pushes the logic into kernelspace (instead of handling it
in userspace).

The only wrinkle is if you need to give out addresses a priori, but that
could be solved by a mechanism to mmap a BO to a particular CPU address,
I think. (I recall MEM_ALIAS in kbase might be relevant?)

> * Use HMM: CPU VA==GPU VA. This nicely solves the problem, but falls over
> badly when the GPU VA size is smaller than the user space VA size - which is
> sadly true on many 64 bit integrations.
> 
> * Provide an allocation flag which causes the kernel driver to not pick a
> GPU address until the buffer is mapped on the CPU. The mmap callback would
> then need to look for a region that is free on both the CPU and GPU.
> 
> The second is obviously most similar to the kbase approach. kbase simplifies
> things because the kernel driver has the ultimate say over whether the
> buffer is SAME_VA or not. So on 64 bit user space we upgrade everything to
> be SAME_VA - which means the GPU VA space just follows the CPU VA (similar
> to HMM).

I'll let Rob chime in on this one. Thank you for the detailed write-up!

-Alyssa

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

  reply	other threads:[~2019-07-26 13:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25  1:09 [PATCH v2 0/7] drm/panfrost: Add heap and no execute buffer allocation Rob Herring
2019-07-25  1:09 ` [PATCH v2 1/7] drm/gem: Allow sparsely populated page arrays in drm_gem_put_pages Rob Herring
2019-07-25 15:36   ` Steven Price
2019-07-25  1:09 ` [PATCH v2 2/7] drm/shmem: Put pages independent of a SG table being set Rob Herring
2019-07-25 15:38   ` Steven Price
2019-07-25  1:09 ` [PATCH v2 3/7] drm/panfrost: Restructure the GEM object creation Rob Herring
2019-07-25 15:40   ` Steven Price
2019-07-25  1:10 ` [PATCH v2 4/7] drm/panfrost: Split panfrost_mmu_map SG list mapping to its own function Rob Herring
2019-07-25  1:10 ` [PATCH v2 5/7] drm/panfrost: Add a no execute flag for BO allocations Rob Herring
2019-07-25 15:45   ` Steven Price
2019-07-25  1:10 ` [PATCH v2 6/7] drm/panfrost: Add support for GPU heap allocations Rob Herring
2019-07-25 13:08   ` Robin Murphy
2019-07-25 21:11     ` Rob Herring
2019-07-26  9:15       ` Steven Price
2019-07-26  9:32         ` Robin Murphy
2019-07-26 16:11         ` Rob Herring
2019-07-25 14:59   ` Steven Price
2019-07-25 15:35     ` Steven Price
2019-07-25 16:13       ` Alyssa Rosenzweig
2019-07-25 16:28         ` Steven Price
2019-07-25 17:40           ` Alyssa Rosenzweig
2019-07-26 10:43             ` Steven Price
2019-07-26 13:57               ` Alyssa Rosenzweig [this message]
2019-07-30 18:49               ` Rob Herring
     [not found]                 ` <20190730185455.GA3205@kevin>
2019-07-30 19:08                   ` Rob Herring
2019-07-31  9:22                     ` Steven Price
2019-07-25 21:28       ` Rob Herring
2019-07-26  9:20         ` Steven Price
2019-07-30 20:03       ` Rob Herring
2019-07-31  9:30         ` Steven Price
2019-07-25  1:10 ` [PATCH v2 7/7] drm/panfrost: Bump driver version to 1.1 Rob Herring
2019-07-25 13:04 ` [PATCH v2 0/7] drm/panfrost: Add heap and no execute buffer allocation Alyssa Rosenzweig

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=20190726135708.GA8834@kevin \
    --to=alyssa.rosenzweig@collabora.com \
    --cc=Robin.Murphy@arm.com \
    --cc=airlied@linux.ie \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=sean@poorly.run \
    --cc=steven.price@arm.com \
    --cc=tomeu.vizoso@collabora.com \
    /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.