linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Christoph Hellwig <hch@lst.de>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Dave Airlie <airlied@linux.ie>,
	DRI <dri-devel@lists.freedesktop.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] drm/ingenic: Alloc cached GEM buffers with dma_alloc_noncoherent
Date: Thu, 1 Oct 2020 07:35:09 +0200	[thread overview]
Message-ID: <20201001053509.GB19914@lst.de> (raw)
In-Reply-To: <20200930171644.299363-3-paul@crapouillou.net>

On Wed, Sep 30, 2020 at 07:16:44PM +0200, Paul Cercueil wrote:
> It turns out that if you want to mmap GEM buffers fully cached, then
> they should be allocated as such as well. Who would have known?
> 
> Introduce a custom .dumb_create callback, that will behave just like
> drm_gem_cma_dumb_create(), except that it will allocate the GEM buffer
> using dma_alloc_noncoherent() if non-coherent memory is what we want.

I think you want to merge this with patch 2, then change patch 2 to
still use dma_alloc_wc for the !ingenic_drm_cached_gem_buf and to
get the phys address using virt_to_phys for the
ingenic_drm_cached_gem_buf instead of abusing the dma address in
->paddr.  The free side also needs to use
dma_free_noncoherent.

> +static int ingenic_drm_gem_cma_dumb_create(struct drm_file *file_priv,
> +					   struct drm_device *drm,
> +					   struct drm_mode_create_dumb *args)
> +{
> +	/*
> +	 * This is basically a copy of drm_gem_cma_dumb_create, which supports
> +	 * creating fully cached GEM buffers.
> +	 */

What about adding this to the core GEM code instead?  We'll probaby
run into other potential users as well.

  reply	other threads:[~2020-10-01  5:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28  3:54 linux-next: build failure after merge of the drm tree Stephen Rothwell
2020-09-28  6:04 ` Christoph Hellwig
2020-09-28  6:08   ` Dave Airlie
2020-09-28  6:14     ` Christoph Hellwig
2020-09-28 10:15   ` Paul Cercueil
2020-09-28 11:34     ` Christoph Hellwig
2020-09-28 11:46       ` Paul Cercueil
2020-09-28 12:10         ` Christoph Hellwig
2020-09-28 13:31           ` Paul Cercueil
2020-09-30  9:02             ` Christoph Hellwig
2020-09-30 13:33               ` Paul Cercueil
2020-09-30 16:11                 ` Christoph Hellwig
2020-09-30 16:39                   ` Paul Cercueil
2020-09-30 16:40                     ` Christoph Hellwig
2020-09-30 16:45                       ` Paul Cercueil
2020-09-30 16:52                         ` Christoph Hellwig
2020-09-30 17:16                           ` [PATCH 1/3] drm: Add and export function drm_gem_cma_create_noalloc Paul Cercueil
2020-10-01  8:51                             ` Daniel Vetter
2020-09-30 17:16                           ` [PATCH 2/3] drm/ingenic: Update code to mmap GEM buffers cached Paul Cercueil
2020-10-01  5:32                             ` Christoph Hellwig
2020-09-30 17:16                           ` [PATCH 3/3] drm/ingenic: Alloc cached GEM buffers with dma_alloc_noncoherent Paul Cercueil
2020-10-01  5:35                             ` Christoph Hellwig [this message]
2020-10-04 14:17                           ` [PATCH] Revert "gpu/drm: ingenic: Add option to mmap GEM buffers cached" Paul Cercueil
2020-10-04 19:59                             ` Sam Ravnborg
2020-10-04 20:11                               ` Paul Cercueil
2020-10-05 12:01                                 ` Stephen Rothwell
2020-10-05 14:05                                   ` Daniel Vetter
2020-10-05 14:47                                     ` Paul Cercueil
2020-10-05 17:38                                       ` Daniel Vetter
2020-10-05 22:31                                       ` Daniel Vetter
2020-10-06  4:30                                   ` Stephen Rothwell

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=20201001053509.GB19914@lst.de \
    --to=hch@lst.de \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=sfr@canb.auug.org.au \
    /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).