All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: sam@ravnborg.org, intel-gfx@lists.freedesktop.org,
	thomas@shipmail.org, David Lechner <david@lechnology.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 5/5] drm/tinydrm: Switch from CMA to shmem buffers
Date: Mon, 29 Oct 2018 10:07:27 +0100	[thread overview]
Message-ID: <20181029090727.GS21967@phenom.ffwll.local> (raw)
In-Reply-To: <7f08ab6d-8fbf-c545-88bf-5d9ad2c9eaad@tronnes.org>

On Sun, Oct 28, 2018 at 09:46:43PM +0100, Noralf Trønnes wrote:
> 
> Den 28.10.2018 21.21, skrev David Lechner:
> > On 10/26/2018 05:38 PM, Noralf Trønnes wrote:
> > > Den 17.10.2018 15.04, skrev Noralf Trønnes:
> > > > This move makes tinydrm useful for more drivers. tinydrm doesn't need
> > > > continuous memory, but at the time it was convenient to use the CMA
> > > > library. The spi core can do dma on is_vmalloc() addresses making this
> > > > possible.
> > > > 
> > > > Cc: David Lechner <david@lechnology.com>
> > > > Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> > > > Acked-by: David Lechner <david@lechnology.com>
> > > > Tested-by: David Lechner <david@lechnology.com>
> > > > ---
> > > David,
> > > FYI This series is scratched.
> > > See the shmem helper patch thread for details.
> > > 
> > Yes, I saw that. Thank you.
> > 
> > I don't suppose there is a way to configure the DMA controller to do
> > the byte swapping?
> > 
> 
> Not that I know of.
> "Proper" SPI hw can do 16-bit transfers and for them there's no problem.
> The DMA capable SPI block on the Pi can only do 8-bit, hence the swapping.
> 
> But that wasn't the problem, the byteswapping actually papered over the
> problem. I'm no -mm expert so I don't know why the problem onyl showed
> up when using the virtual address of the buffer used by fbcon and not on
> mmap'ed fbdev as Daniel suggested would happen.

Hm, I missed that detail. This sounds like one of the mappings ended up
being write-combining (which avoids all the issues with dirty cpu cache
lines), while the broken one was not.

Or we ended up with a flush somewhere by accident.

> Either way shmem not being coherent is a problem on the Pi, even though
> I expected the DMA streaming API called by the spi core to flush "things".

It should do that for you. At least if it's using dma_map/unmap_sg and
friends.

> The solution I'm aiming for is to make it easy for tinydrm drivers to use
> the
> buffer type they want, instead of having one type they all have to use.

General recommendation for this is "less midlayer, more helper". Which was
the goal of all this ... Oh well :-/ Maybe we can progress in other areas
meanwhile.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-29  9:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 13:04 [PATCH v5 0/5] drm: Add shmem GEM library Noralf Trønnes
2018-10-17 13:04 ` [PATCH v5 1/5] drm/driver: Add defaults for .gem_prime_export/import callbacks Noralf Trønnes
2018-10-17 13:04 ` [PATCH v5 2/5] drm/prime: Add drm_gem_prime_mmap() Noralf Trønnes
2018-10-17 15:22   ` Daniel Vetter
2018-10-17 13:04 ` [PATCH v5 3/5] drm/gem: Add drm_gem_object_funcs Noralf Trønnes
2018-10-22 12:57   ` Christian König
2018-10-23 13:46     ` Daniel Vetter
2018-10-31 23:37   ` Noralf Trønnes
2018-11-01  8:36     ` [Intel-gfx] " Daniel Vetter
2018-10-17 13:04 ` [PATCH v5 4/5] drm: Add library for shmem backed GEM objects Noralf Trønnes
2018-10-17 15:46   ` Daniel Vetter
2018-10-22 14:15     ` Noralf Trønnes
2018-10-23 13:50       ` Daniel Vetter
2018-11-27  0:36   ` Eric Anholt
2018-11-27  8:58     ` [Intel-gfx] " Daniel Vetter
2018-11-27 20:38       ` Eric Anholt
2018-11-28  8:22         ` [Intel-gfx] " Daniel Vetter
2018-11-28 21:52           ` Eric Anholt
2018-11-29  9:17             ` Daniel Vetter
2018-11-29 23:58               ` Eric Anholt
2018-12-02 15:58                 ` Noralf Trønnes
2019-01-28 20:57                   ` [Intel-gfx] " Rob Herring
2019-01-28 21:22                     ` Noralf Trønnes
2019-01-28 22:01                       ` Rob Herring
2019-01-29  0:19                       ` Eric Anholt
2019-01-29  8:44                         ` [Intel-gfx] " Noralf Trønnes
2018-10-17 13:04 ` [PATCH v5 5/5] drm/tinydrm: Switch from CMA to shmem buffers Noralf Trønnes
2018-10-26 22:38   ` Noralf Trønnes
2018-10-28 20:21     ` David Lechner
2018-10-28 20:46       ` Noralf Trønnes
2018-10-29  9:07         ` Daniel Vetter [this message]
2018-10-31 18:41           ` Noralf Trønnes
2018-10-17 13:43 ` ✗ Fi.CI.CHECKPATCH: warning for drm: Add shmem GEM library Patchwork
2018-10-17 14:02 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-17 17:37 ` ✓ Fi.CI.IGT: " Patchwork

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=20181029090727.GS21967@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    --cc=thomas@shipmail.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 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.