public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Sam Ravnborg <sam@ravnborg.org>,
	od@zcrc.me, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org
Subject: Re: [PATCH v2 4/5] drm: Add and export function drm_gem_cma_sync_data
Date: Mon, 15 Mar 2021 11:59:50 +0000	[thread overview]
Message-ID: <QNE0QQ.C6TR84CKS0AX1@crapouillou.net> (raw)
In-Reply-To: <9c3c8e15-9e8c-4413-e75b-de989a750954@suse.de>

Hi Thomas,

Le lun. 15 mars 2021 à 8:43, Thomas Zimmermann <tzimmermann@suse.de> a 
écrit :
> Hi
> 
> Am 11.03.21 um 13:33 schrieb Paul Cercueil:
>> 
>> 
>> Le jeu. 11 mars 2021 à 12:28, Christoph Hellwig <hch@infradead.org> 
>> a \x7fécrit :
>>> On Sun, Mar 07, 2021 at 08:28:34PM +0000, Paul Cercueil wrote:
>>>>  +    drm_atomic_for_each_plane_damage(&iter, &clip) {
>>>>  +        for (i = 0; i < finfo->num_planes; i++) {
>>>>  +            daddr = drm_fb_cma_get_gem_addr(state->fb, state, i);
>>>>  +
>>>>  +            /* Ignore x1/x2 values, invalidate complete lines */
>>>>  +            offset = clip.y1 * state->fb->pitches[i];
>>>>  +
>>>>  +            dma_sync_single_for_device(dev, daddr + offset,
>>>>  +                       (clip.y2 - clip.y1) * 
>>>> state->fb->pitches[i],
>>>>  +                       DMA_TO_DEVICE);
>>> 
>>> Are these helpers only ever used to transfer data to the device and
>>> never from it?  If so please clearly document that.
>> 
>> Yes. In the DRM world, are there cases where we transfer data from 
>> the \x7fdevice? I assume these cases are handled by v4l2 instead.
> 
> Software rendering (i.e., anything wrt dumb buffers) likely reads 
> back framebuffer content during blit operations. For devices where 
> this is a slow operation (e.g., PCI read) we set struct 
> drm_mode_config.prefer_shadow to hint renderers to use shadow 
> buffering.

This has been brought up a few times already. I answered that in the 
cover letter. In my case, *writes* (e.g. dumb memcpy) are also slower 
with a write-combine buffer than with a non-coherent buffer + cache 
sync. So a shadow buffer does nothing for me.

Cheers,
-Paul



  reply	other threads:[~2021-03-15 12:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 20:28 [PATCH v2 0/5] Add option to mmap GEM buffers cached Paul Cercueil
2021-03-07 20:28 ` [PATCH v2 1/5] drm: Add and export function drm_gem_cma_create_noncoherent Paul Cercueil
2021-03-11 12:23   ` Christoph Hellwig
2021-03-07 20:28 ` [PATCH v2 2/5] drm: Add and export function drm_gem_cma_dumb_create_noncoherent Paul Cercueil
2021-03-07 20:28 ` [PATCH v2 3/5] drm: Add and export function drm_gem_cma_mmap_noncoherent Paul Cercueil
2021-03-11 12:26   ` Christoph Hellwig
2021-03-11 12:32     ` Paul Cercueil
2021-03-11 12:36       ` Christoph Hellwig
2021-03-11 16:12         ` Paul Cercueil
2021-03-12 16:36           ` Christoph Hellwig
2021-03-07 20:28 ` [PATCH v2 4/5] drm: Add and export function drm_gem_cma_sync_data Paul Cercueil
2021-03-11 12:28   ` Christoph Hellwig
2021-03-11 12:33     ` Paul Cercueil
2021-03-15  7:43       ` Thomas Zimmermann
2021-03-15 11:59         ` Paul Cercueil [this message]
2021-03-07 20:28 ` [PATCH v2 5/5] drm/ingenic: Add option to alloc cached GEM buffers Paul Cercueil
     [not found]   ` <20210308034727.1951-1-hdanton@sina.com>
2021-03-10 19:01     ` Paul Cercueil
     [not found]       ` <20210311022743.2542-1-hdanton@sina.com>
2021-03-11 12:10         ` Paul Cercueil
2021-03-11 12:30   ` Christoph Hellwig
2021-03-11 13:40     ` Paul Cercueil
2021-03-08  8:41 ` [PATCH v2 0/5] Add option to mmap GEM buffers cached Thomas Zimmermann
2021-03-10 19:02   ` Paul Cercueil
2021-03-11  7:52     ` Thomas Zimmermann

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=QNE0QQ.C6TR84CKS0AX1@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=od@zcrc.me \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.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