intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments
@ 2017-11-30 18:07 Chris Wilson
  2017-11-30 18:56 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Chris Wilson @ 2017-11-30 18:07 UTC (permalink / raw)
  To: intel-gfx

dma-bufs are device coherent, with explicit CPU synchronisation provided
via the begin/end cpu access ioctls. As the coherency of the dma-buf is
explicitly defined to be under user control, flushing any caches on
attach/detach of the dma-buf is additional work that doesn't aide the
user in the slightest.

Suggested-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_dmabuf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 864439a214c8..68c8bfd8eb7a 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -67,7 +67,9 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attachme
 		src = sg_next(src);
 	}
 
-	if (!dma_map_sg(attachment->dev, st->sgl, st->nents, dir)) {
+	if (!dma_map_sg_attrs(attachment->dev,
+			      st->sgl, st->nents, dir,
+			      DMA_ATTR_SKIP_CPU_SYNC)) {
 		ret = -ENOMEM;
 		goto err_free_sg;
 	}
@@ -90,7 +92,9 @@ static void i915_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
 {
 	struct drm_i915_gem_object *obj = dma_buf_to_obj(attachment->dmabuf);
 
-	dma_unmap_sg(attachment->dev, sg->sgl, sg->nents, dir);
+	dma_unmap_sg_attrs(attachment->dev,
+			   sg->sgl, sg->nents, dir,
+			   DMA_ATTR_SKIP_CPU_SYNC);
 	sg_free_table(sg);
 	kfree(sg);
 
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Skip CPU synchronisation on dmabuf attachments
  2017-11-30 18:07 [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments Chris Wilson
@ 2017-11-30 18:56 ` Patchwork
  2017-11-30 20:48 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-30 18:56 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Skip CPU synchronisation on dmabuf attachments
URL   : https://patchwork.freedesktop.org/series/34702/
State : success

== Summary ==

Series 34702v1 drm/i915: Skip CPU synchronisation on dmabuf attachments
https://patchwork.freedesktop.org/api/1.0/series/34702/revisions/1/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_exec_reloc:
        Subgroup basic-cpu-active:
                dmesg-fail -> PASS       (fi-gdg-551) fdo#102582 +1
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:439s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:443s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:381s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:514s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:506s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:504s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:486s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:475s
fi-elk-e7500     total:224  pass:162  dwarn:15  dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:1   dfail:0   fail:0   skip:108 time:270s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:374s
fi-hsw-4770r     total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  time:260s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:393s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-ivb-3770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:447s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:485s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:532s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:534s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:589s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:535s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-skl-6700k     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:523s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:495s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:450s
fi-snb-2520m     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:550s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:419s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:607s
fi-cnl-y         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:545s
fi-glk-dsi       total:288  pass:257  dwarn:0   dfail:0   fail:1   skip:30  time:484s

07df63d96015816fbf6dd44e634474587931a294 drm-tip: 2017y-11m-30d-17h-26m-53s UTC integration manifest
be6a7ad5bd19 drm/i915: Skip CPU synchronisation on dmabuf attachments

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7383/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915: Skip CPU synchronisation on dmabuf attachments
  2017-11-30 18:07 [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments Chris Wilson
  2017-11-30 18:56 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-11-30 20:48 ` Patchwork
  2020-02-10 19:34 ` [Intel-gfx] [PATCH] " Dongwon Kim
  2020-02-10 19:46 ` Dongwon Kim
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2017-11-30 20:48 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Skip CPU synchronisation on dmabuf attachments
URL   : https://patchwork.freedesktop.org/series/34702/
State : success

== Summary ==

Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-snb) fdo#101623 +1
Test drv_selftest:
        Subgroup mock_sanitycheck:
                dmesg-warn -> PASS       (shard-snb) fdo#102707 +1
Test gem_tiled_swapping:
        Subgroup non-threaded:
                incomplete -> PASS       (shard-snb)
Test kms_cursor_crc:
        Subgroup cursor-256x256-suspend:
                dmesg-warn -> PASS       (shard-snb) fdo#102365

fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365

shard-hsw        total:2650 pass:1525 dwarn:2   dfail:0   fail:9   skip:1113 time:9214s
shard-snb        total:2663 pass:1307 dwarn:2   dfail:0   fail:12  skip:1342 time:8111s
Blacklisted hosts:
shard-apl        total:2641 pass:1668 dwarn:1   dfail:0   fail:22  skip:949 time:13431s
shard-kbl        total:2663 pass:1792 dwarn:12  dfail:0   fail:27  skip:832 time:10865s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7383/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments
  2017-11-30 18:07 [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments Chris Wilson
  2017-11-30 18:56 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-11-30 20:48 ` ✓ Fi.CI.IGT: " Patchwork
@ 2020-02-10 19:34 ` Dongwon Kim
  2020-02-10 19:54   ` Dongwon Kim
  2020-02-10 19:46 ` Dongwon Kim
  3 siblings, 1 reply; 6+ messages in thread
From: Dongwon Kim @ 2020-02-10 19:34 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx, james.xiong

Acked-by: Dongwon Kim <dongwon.kim@intel.com>

It makes lots of sense to make CPU cache operation done only when
needed. Similar change was already landed in drm-prime and other
vendor specific drivers. We are actually seeing huge performance
boost in a specific customer case where dmabuf was used between
camera driver (importer) and i915 after applying this patch.

Please consider upstreaming this code change. 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments
  2017-11-30 18:07 [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments Chris Wilson
                   ` (2 preceding siblings ...)
  2020-02-10 19:34 ` [Intel-gfx] [PATCH] " Dongwon Kim
@ 2020-02-10 19:46 ` Dongwon Kim
  3 siblings, 0 replies; 6+ messages in thread
From: Dongwon Kim @ 2020-02-10 19:46 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx, james.xiong

(mistakenly put a wrong message id in "In-reply-To")

Acked-by: Dongwon Kim <dongwon.kim@intel.com>
 
It makes lots of sense to make CPU cache operation done only when
needed. Similar change was already landed in drm-prime and other
vendor specific drivers. We are actually seeing huge performance
boost in a specific customer case where dmabuf was used between
camera driver (importer) and i915 after applying this patch.

Please consider upstreaming this code change. 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments
  2020-02-10 19:34 ` [Intel-gfx] [PATCH] " Dongwon Kim
@ 2020-02-10 19:54   ` Dongwon Kim
  0 siblings, 0 replies; 6+ messages in thread
From: Dongwon Kim @ 2020-02-10 19:54 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx, james.xiong

The patch is here:
https://lists.freedesktop.org/archives/intel-gfx/2017-November/148988.html

On Mon, Feb 10, 2020 at 11:34:07AM -0800, Dongwon Kim wrote:
> Acked-by: Dongwon Kim <dongwon.kim@intel.com>
> 
> It makes lots of sense to make CPU cache operation done only when
> needed. Similar change was already landed in drm-prime and other
> vendor specific drivers. We are actually seeing huge performance
> boost in a specific customer case where dmabuf was used between
> camera driver (importer) and i915 after applying this patch.
> 
> Please consider upstreaming this code change. 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-10 20:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 18:07 [PATCH] drm/i915: Skip CPU synchronisation on dmabuf attachments Chris Wilson
2017-11-30 18:56 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-11-30 20:48 ` ✓ Fi.CI.IGT: " Patchwork
2020-02-10 19:34 ` [Intel-gfx] [PATCH] " Dongwon Kim
2020-02-10 19:54   ` Dongwon Kim
2020-02-10 19:46 ` Dongwon Kim

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).