* [PATCH] drm/i915: Serialise presentation with imported dmabufs
@ 2016-06-14 15:03 Chris Wilson
2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Chris Wilson @ 2016-06-14 15:03 UTC (permalink / raw)
To: intel-gfx; +Cc: Alex Goins
obj->base.dma_buf represents a dma-buf exported from this object (for
use by others). On the contrary, ob->base.import_attach represents the
source dma-buf that was used to create this object (if any). When
serialising with third parties, we want to wait on their rendering via
the import attachment (and not our own via the dma_buf export).
Note that for an object exported from i915 and passed to another i915
client, we do not create the import attachment and so serialisation will
use our native paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Goins <agoins@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 801e4c17dd8d..cbaa2e6f7679 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11425,8 +11425,8 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
return true;
else if (i915.enable_execlists)
return true;
- else if (obj->base.dma_buf &&
- !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
+ else if (obj->base.import_attach &&
+ !reservation_object_test_signaled_rcu(obj->base.import_attach->dmabuf->resv,
false))
return true;
else
@@ -11526,8 +11526,8 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
&dev_priv->rps.mmioflips));
/* For framebuffer backed by dmabuf, wait for fence */
- if (obj->base.dma_buf)
- WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
+ if (obj->base.import_attach)
+ WARN_ON(reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
false, false,
MAX_SCHEDULE_TIMEOUT) < 0);
@@ -13952,10 +13952,10 @@ intel_prepare_plane_fb(struct drm_plane *plane,
}
/* For framebuffer backed by dmabuf, wait for fence */
- if (obj && obj->base.dma_buf) {
+ if (obj && obj->base.import_attach) {
long lret;
- lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
+ lret = reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
false, true,
MAX_SCHEDULE_TIMEOUT);
if (lret == -ERESTARTSYS)
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* ✓ Ro.CI.BAT: success for drm/i915: Serialise presentation with imported dmabufs
2016-06-14 15:03 [PATCH] drm/i915: Serialise presentation with imported dmabufs Chris Wilson
@ 2016-06-14 15:37 ` Patchwork
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
2016-06-15 5:59 ` ✗ Ro.CI.BAT: failure for drm/i915: Serialise presentation with imported dmabufs (rev2) Patchwork
2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-06-14 15:37 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Serialise presentation with imported dmabufs
URL : https://patchwork.freedesktop.org/series/8689/
State : success
== Summary ==
Series 8689v1 drm/i915: Serialise presentation with imported dmabufs
http://patchwork.freedesktop.org/api/1.0/series/8689/revisions/1/mbox
Test drv_module_reload_basic:
dmesg-warn -> PASS (ro-byt-n2820)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> SKIP (ro-bdw-i7-5557U)
fi-bdw-i7-5557u total:213 pass:201 dwarn:0 dfail:0 fail:0 skip:12
fi-skl-i5-6260u total:213 pass:202 dwarn:0 dfail:0 fail:0 skip:11
fi-skl-i7-6700k total:213 pass:188 dwarn:0 dfail:0 fail:0 skip:25
ro-bdw-i5-5250u total:213 pass:197 dwarn:2 dfail:0 fail:0 skip:14
ro-bdw-i7-5557U total:213 pass:198 dwarn:0 dfail:0 fail:0 skip:15
ro-bdw-i7-5600u total:213 pass:185 dwarn:0 dfail:0 fail:0 skip:28
ro-bsw-n3050 total:213 pass:172 dwarn:0 dfail:0 fail:2 skip:39
ro-byt-n2820 total:213 pass:173 dwarn:0 dfail:0 fail:3 skip:37
ro-hsw-i3-4010u total:213 pass:190 dwarn:0 dfail:0 fail:0 skip:23
ro-hsw-i7-4770r total:213 pass:190 dwarn:0 dfail:0 fail:0 skip:23
ro-ilk-i7-620lm total:213 pass:150 dwarn:0 dfail:0 fail:1 skip:62
ro-ilk1-i5-650 total:208 pass:150 dwarn:0 dfail:0 fail:1 skip:57
ro-ivb-i7-3770 total:213 pass:181 dwarn:0 dfail:0 fail:0 skip:32
ro-ivb2-i7-3770 total:213 pass:185 dwarn:0 dfail:0 fail:0 skip:28
ro-skl3-i5-6260u total:213 pass:201 dwarn:1 dfail:0 fail:0 skip:11
ro-snb-i7-2620M total:213 pass:174 dwarn:0 dfail:0 fail:1 skip:38
fi-hsw-i7-4770k failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1185/
8973dd9 drm-intel-nightly: 2016y-06m-14d-14h-34m-35s UTC integration manifest
9d74900 drm/i915: Serialise presentation with imported dmabufs
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Serialise presentation with imported dmabufs
2016-06-14 15:03 [PATCH] drm/i915: Serialise presentation with imported dmabufs Chris Wilson
2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
@ 2016-06-14 15:45 ` Daniel Vetter
2016-06-14 20:02 ` Chris Wilson
2016-06-14 20:56 ` [PATCH v2] " Chris Wilson
2016-06-15 5:59 ` ✗ Ro.CI.BAT: failure for drm/i915: Serialise presentation with imported dmabufs (rev2) Patchwork
2 siblings, 2 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-06-14 15:45 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Alex Goins
On Tue, Jun 14, 2016 at 04:03:57PM +0100, Chris Wilson wrote:
> obj->base.dma_buf represents a dma-buf exported from this object (for
> use by others). On the contrary, ob->base.import_attach represents the
> source dma-buf that was used to create this object (if any). When
> serialising with third parties, we want to wait on their rendering via
> the import attachment (and not our own via the dma_buf export).
>
> Note that for an object exported from i915 and passed to another i915
> client, we do not create the import attachment and so serialisation will
> use our native paths.
But that would break it, if the foreign object attaches a some fence to
the reservation. We need things to work both ways, and that is done by
having a reservation pointer, where we either store our own per-bo lock +
list of reservations, or the imported one from the other driver.
A bit much, but interim we'd need at least both base.dma_buf and
base.import_attach.
Also, we should just extract the fence, and wait on that later on in the
atomic path.
-Daniel
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Alex Goins <agoins@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 801e4c17dd8d..cbaa2e6f7679 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11425,8 +11425,8 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
> return true;
> else if (i915.enable_execlists)
> return true;
> - else if (obj->base.dma_buf &&
> - !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
> + else if (obj->base.import_attach &&
> + !reservation_object_test_signaled_rcu(obj->base.import_attach->dmabuf->resv,
> false))
> return true;
> else
> @@ -11526,8 +11526,8 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
> &dev_priv->rps.mmioflips));
>
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj->base.dma_buf)
> - WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> + if (obj->base.import_attach)
> + WARN_ON(reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
> false, false,
> MAX_SCHEDULE_TIMEOUT) < 0);
>
> @@ -13952,10 +13952,10 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> }
>
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj && obj->base.dma_buf) {
> + if (obj && obj->base.import_attach) {
> long lret;
>
> - lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> + lret = reservation_object_wait_timeout_rcu(obj->base.import_attach->dmabuf->resv,
> false, true,
> MAX_SCHEDULE_TIMEOUT);
> if (lret == -ERESTARTSYS)
> --
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Serialise presentation with imported dmabufs
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
@ 2016-06-14 20:02 ` Chris Wilson
2016-06-14 20:56 ` [PATCH v2] " Chris Wilson
1 sibling, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2016-06-14 20:02 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, Alex Goins
On Tue, Jun 14, 2016 at 05:45:24PM +0200, Daniel Vetter wrote:
> On Tue, Jun 14, 2016 at 04:03:57PM +0100, Chris Wilson wrote:
> > obj->base.dma_buf represents a dma-buf exported from this object (for
> > use by others). On the contrary, ob->base.import_attach represents the
> > source dma-buf that was used to create this object (if any). When
> > serialising with third parties, we want to wait on their rendering via
> > the import attachment (and not our own via the dma_buf export).
> >
> > Note that for an object exported from i915 and passed to another i915
> > client, we do not create the import attachment and so serialisation will
> > use our native paths.
>
> But that would break it, if the foreign object attaches a some fence to
> the reservation.
The foreign object case is the situation that is broken right now. Since
obj->base.import_attach != NULL, but obj->base.dma_buf == NULL.
> We need things to work both ways, and that is done by
> having a reservation pointer, where we either store our own per-bo lock +
> list of reservations, or the imported one from the other driver.
>
> A bit much, but interim we'd need at least both base.dma_buf and
> base.import_attach.
If you really insist on having both channels being bidirectional,
everything needs to be duplicated and then filtered for relevance.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] drm/i915: Serialise presentation with imported dmabufs
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
2016-06-14 20:02 ` Chris Wilson
@ 2016-06-14 20:56 ` Chris Wilson
2016-06-15 20:26 ` Alex Goins
2016-06-16 21:41 ` Daniel Vetter
1 sibling, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2016-06-14 20:56 UTC (permalink / raw)
To: intel-gfx; +Cc: Alex Goins
obj->base.dma_buf represents a dma-buf exported from this object (for
use by others). On the contrary, obj->base.import_attach represents the
source dma-buf that was used to create this object (if any). When
serialising with third parties, we need to wait on their rendering via
the import attachment as well as their rendering on our exported
dma-buf.
v2: Wait on both import and export.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Goins <agoins@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_gem_dmabuf.h | 45 +++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_display.c | 48 ++++++++++++++++++----------------
2 files changed, 71 insertions(+), 22 deletions(-)
create mode 100644 drivers/gpu/drm/i915/i915_gem_dmabuf.h
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.h b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
new file mode 100644
index 000000000000..092bb363693c
--- /dev/null
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef _I915_GEM_DMABUF_H_
+#define _I915_GEM_DMABUF_H_
+
+#include <linux/dma-buf.h>
+
+static inline struct reservation_object *
+i915_gem_object_get_dmabuf_resv(struct drm_i915_gem_object *obj)
+{
+ struct dma_buf *dma_buf;
+
+ if (obj->base.import_attach)
+ dma_buf = obj->base.import_attach->dmabuf;
+ else if (obj->base.dma_buf)
+ dma_buf = obj->base.dma_buf;
+ else
+ return NULL;
+
+ return dma_buf->resv;
+}
+
+#endif
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 801e4c17dd8d..33531e6cb236 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -36,6 +36,7 @@
#include "intel_drv.h"
#include <drm/i915_drm.h>
#include "i915_drv.h"
+#include "i915_gem_dmabuf.h"
#include "intel_dsi.h"
#include "i915_trace.h"
#include <drm/drm_atomic.h>
@@ -46,7 +47,6 @@
#include <drm/drm_rect.h>
#include <linux/dma_remapping.h>
#include <linux/reservation.h>
-#include <linux/dma-buf.h>
static bool is_mmio_work(struct intel_flip_work *work)
{
@@ -11405,6 +11405,8 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
static bool use_mmio_flip(struct intel_engine_cs *engine,
struct drm_i915_gem_object *obj)
{
+ struct reservation_object *resv;
+
/*
* This is not being used for older platforms, because
* non-availability of flip done interrupt forces us to use
@@ -11425,12 +11427,12 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
return true;
else if (i915.enable_execlists)
return true;
- else if (obj->base.dma_buf &&
- !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
- false))
+
+ resv = i915_gem_object_get_dmabuf_resv(obj);
+ if (resv && !reservation_object_test_signaled_rcu(resv, false))
return true;
- else
- return engine != i915_gem_request_get_engine(obj->last_write_req);
+
+ return engine != i915_gem_request_get_engine(obj->last_write_req);
}
static void skl_do_mmio_flip(struct intel_crtc *intel_crtc,
@@ -11519,6 +11521,7 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
struct intel_framebuffer *intel_fb =
to_intel_framebuffer(crtc->base.primary->fb);
struct drm_i915_gem_object *obj = intel_fb->obj;
+ struct reservation_object *resv;
if (work->flip_queued_req)
WARN_ON(__i915_wait_request(work->flip_queued_req,
@@ -11526,11 +11529,10 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
&dev_priv->rps.mmioflips));
/* For framebuffer backed by dmabuf, wait for fence */
- if (obj->base.dma_buf)
- WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
- false, false,
+ resv = i915_gem_object_get_dmabuf_resv(obj);
+ if (resv)
+ WARN_ON(reservation_object_wait_timeout_rcu(resv, false, false,
MAX_SCHEDULE_TIMEOUT) < 0);
-
intel_pipe_update_start(crtc);
if (INTEL_GEN(dev_priv) >= 9)
@@ -13922,6 +13924,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
struct intel_plane *intel_plane = to_intel_plane(plane);
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
+ struct reservation_object *resv;
int ret = 0;
if (!obj && !old_obj)
@@ -13951,12 +13954,17 @@ intel_prepare_plane_fb(struct drm_plane *plane,
}
}
+ if (!obj) {
+ i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
+ return 0;
+ }
+
/* For framebuffer backed by dmabuf, wait for fence */
- if (obj && obj->base.dma_buf) {
+ resv = i915_gem_object_get_dmabuf_resv(obj);
+ if (resv) {
long lret;
- lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
- false, true,
+ lret = reservation_object_wait_timeout_rcu(resv, false, true,
MAX_SCHEDULE_TIMEOUT);
if (lret == -ERESTARTSYS)
return lret;
@@ -13964,9 +13972,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
WARN(lret < 0, "waiting returns %li\n", lret);
}
- if (!obj) {
- ret = 0;
- } else if (plane->type == DRM_PLANE_TYPE_CURSOR &&
+ if (plane->type == DRM_PLANE_TYPE_CURSOR &&
INTEL_INFO(dev)->cursor_needs_physical) {
int align = IS_I830(dev) ? 16 * 1024 : 256;
ret = i915_gem_object_attach_phys(obj, align);
@@ -13977,13 +13983,11 @@ intel_prepare_plane_fb(struct drm_plane *plane,
}
if (ret == 0) {
- if (obj) {
- struct intel_plane_state *plane_state =
- to_intel_plane_state(new_state);
+ struct intel_plane_state *plane_state =
+ to_intel_plane_state(new_state);
- i915_gem_request_assign(&plane_state->wait_req,
- obj->last_write_req);
- }
+ i915_gem_request_assign(&plane_state->wait_req,
+ obj->last_write_req);
i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
}
--
2.8.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* ✗ Ro.CI.BAT: failure for drm/i915: Serialise presentation with imported dmabufs (rev2)
2016-06-14 15:03 [PATCH] drm/i915: Serialise presentation with imported dmabufs Chris Wilson
2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
@ 2016-06-15 5:59 ` Patchwork
2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-06-15 5:59 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Serialise presentation with imported dmabufs (rev2)
URL : https://patchwork.freedesktop.org/series/8689/
State : failure
== Summary ==
Series 8689v2 drm/i915: Serialise presentation with imported dmabufs
http://patchwork.freedesktop.org/api/1.0/series/8689/revisions/2/mbox
Test drv_module_reload_basic:
pass -> SKIP (ro-hsw-i3-4010u)
Test gem_exec_flush:
Subgroup basic-batch-kernel-default-uc:
pass -> DMESG-FAIL (ro-ivb2-i7-3770)
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
fail -> PASS (ro-snb-i7-2620M)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> SKIP (ro-bdw-i5-5250u)
fi-skl-i7-6700k total:213 pass:188 dwarn:0 dfail:0 fail:0 skip:25
ro-bdw-i5-5250u total:213 pass:197 dwarn:2 dfail:0 fail:0 skip:14
ro-bdw-i7-5557U total:213 pass:198 dwarn:0 dfail:0 fail:0 skip:15
ro-bdw-i7-5600u total:213 pass:185 dwarn:0 dfail:0 fail:0 skip:28
ro-bsw-n3050 total:213 pass:172 dwarn:0 dfail:0 fail:2 skip:39
ro-byt-n2820 total:213 pass:173 dwarn:0 dfail:0 fail:3 skip:37
ro-hsw-i3-4010u total:213 pass:189 dwarn:0 dfail:0 fail:0 skip:24
ro-hsw-i7-4770r total:213 pass:190 dwarn:0 dfail:0 fail:0 skip:23
ro-ilk-i7-620lm total:213 pass:150 dwarn:0 dfail:0 fail:1 skip:62
ro-ilk1-i5-650 total:208 pass:150 dwarn:0 dfail:0 fail:1 skip:57
ro-ivb-i7-3770 total:213 pass:181 dwarn:0 dfail:0 fail:0 skip:32
ro-ivb2-i7-3770 total:213 pass:184 dwarn:0 dfail:1 fail:0 skip:28
ro-skl3-i5-6260u total:213 pass:201 dwarn:1 dfail:0 fail:0 skip:11
ro-snb-i7-2620M total:213 pass:174 dwarn:0 dfail:0 fail:1 skip:38
fi-bdw-i7-5557u failed to connect after reboot
fi-hsw-i7-4770k failed to connect after reboot
fi-skl-i5-6260u failed to connect after reboot
fi-snb-i7-2600 failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1188/
5fb50cc drm-intel-nightly: 2016y-06m-14d-21h-33m-58s UTC integration manifest
2c3521f drm/i915: Serialise presentation with imported dmabufs
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] drm/i915: Serialise presentation with imported dmabufs
2016-06-14 20:56 ` [PATCH v2] " Chris Wilson
@ 2016-06-15 20:26 ` Alex Goins
2016-06-16 21:41 ` Daniel Vetter
1 sibling, 0 replies; 8+ messages in thread
From: Alex Goins @ 2016-06-15 20:26 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
Tested-by: Alex Goins <agoins@nvidia.com>
Thanks,
Alex
On Tue, 14 Jun 2016, Chris Wilson wrote:
> obj->base.dma_buf represents a dma-buf exported from this object (for
> use by others). On the contrary, obj->base.import_attach represents the
> source dma-buf that was used to create this object (if any). When
> serialising with third parties, we need to wait on their rendering via
> the import attachment as well as their rendering on our exported
> dma-buf.
>
> v2: Wait on both import and export.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Alex Goins <agoins@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_dmabuf.h | 45 +++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_display.c | 48 ++++++++++++++++++----------------
> 2 files changed, 71 insertions(+), 22 deletions(-)
> create mode 100644 drivers/gpu/drm/i915/i915_gem_dmabuf.h
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.h b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
> new file mode 100644
> index 000000000000..092bb363693c
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
> @@ -0,0 +1,45 @@
> +/*
> + * Copyright 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef _I915_GEM_DMABUF_H_
> +#define _I915_GEM_DMABUF_H_
> +
> +#include <linux/dma-buf.h>
> +
> +static inline struct reservation_object *
> +i915_gem_object_get_dmabuf_resv(struct drm_i915_gem_object *obj)
> +{
> + struct dma_buf *dma_buf;
> +
> + if (obj->base.import_attach)
> + dma_buf = obj->base.import_attach->dmabuf;
> + else if (obj->base.dma_buf)
> + dma_buf = obj->base.dma_buf;
> + else
> + return NULL;
> +
> + return dma_buf->resv;
> +}
> +
> +#endif
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 801e4c17dd8d..33531e6cb236 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -36,6 +36,7 @@
> #include "intel_drv.h"
> #include <drm/i915_drm.h>
> #include "i915_drv.h"
> +#include "i915_gem_dmabuf.h"
> #include "intel_dsi.h"
> #include "i915_trace.h"
> #include <drm/drm_atomic.h>
> @@ -46,7 +47,6 @@
> #include <drm/drm_rect.h>
> #include <linux/dma_remapping.h>
> #include <linux/reservation.h>
> -#include <linux/dma-buf.h>
>
> static bool is_mmio_work(struct intel_flip_work *work)
> {
> @@ -11405,6 +11405,8 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
> static bool use_mmio_flip(struct intel_engine_cs *engine,
> struct drm_i915_gem_object *obj)
> {
> + struct reservation_object *resv;
> +
> /*
> * This is not being used for older platforms, because
> * non-availability of flip done interrupt forces us to use
> @@ -11425,12 +11427,12 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
> return true;
> else if (i915.enable_execlists)
> return true;
> - else if (obj->base.dma_buf &&
> - !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
> - false))
> +
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv && !reservation_object_test_signaled_rcu(resv, false))
> return true;
> - else
> - return engine != i915_gem_request_get_engine(obj->last_write_req);
> +
> + return engine != i915_gem_request_get_engine(obj->last_write_req);
> }
>
> static void skl_do_mmio_flip(struct intel_crtc *intel_crtc,
> @@ -11519,6 +11521,7 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
> struct intel_framebuffer *intel_fb =
> to_intel_framebuffer(crtc->base.primary->fb);
> struct drm_i915_gem_object *obj = intel_fb->obj;
> + struct reservation_object *resv;
>
> if (work->flip_queued_req)
> WARN_ON(__i915_wait_request(work->flip_queued_req,
> @@ -11526,11 +11529,10 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
> &dev_priv->rps.mmioflips));
>
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj->base.dma_buf)
> - WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> - false, false,
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv)
> + WARN_ON(reservation_object_wait_timeout_rcu(resv, false, false,
> MAX_SCHEDULE_TIMEOUT) < 0);
> -
> intel_pipe_update_start(crtc);
>
> if (INTEL_GEN(dev_priv) >= 9)
> @@ -13922,6 +13924,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> struct intel_plane *intel_plane = to_intel_plane(plane);
> struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
> + struct reservation_object *resv;
> int ret = 0;
>
> if (!obj && !old_obj)
> @@ -13951,12 +13954,17 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> }
> }
>
> + if (!obj) {
> + i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
> + return 0;
> + }
> +
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj && obj->base.dma_buf) {
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv) {
> long lret;
>
> - lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> - false, true,
> + lret = reservation_object_wait_timeout_rcu(resv, false, true,
> MAX_SCHEDULE_TIMEOUT);
> if (lret == -ERESTARTSYS)
> return lret;
> @@ -13964,9 +13972,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> WARN(lret < 0, "waiting returns %li\n", lret);
> }
>
> - if (!obj) {
> - ret = 0;
> - } else if (plane->type == DRM_PLANE_TYPE_CURSOR &&
> + if (plane->type == DRM_PLANE_TYPE_CURSOR &&
> INTEL_INFO(dev)->cursor_needs_physical) {
> int align = IS_I830(dev) ? 16 * 1024 : 256;
> ret = i915_gem_object_attach_phys(obj, align);
> @@ -13977,13 +13983,11 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> }
>
> if (ret == 0) {
> - if (obj) {
> - struct intel_plane_state *plane_state =
> - to_intel_plane_state(new_state);
> + struct intel_plane_state *plane_state =
> + to_intel_plane_state(new_state);
>
> - i915_gem_request_assign(&plane_state->wait_req,
> - obj->last_write_req);
> - }
> + i915_gem_request_assign(&plane_state->wait_req,
> + obj->last_write_req);
>
> i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
> }
> --
> 2.8.1
>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] drm/i915: Serialise presentation with imported dmabufs
2016-06-14 20:56 ` [PATCH v2] " Chris Wilson
2016-06-15 20:26 ` Alex Goins
@ 2016-06-16 21:41 ` Daniel Vetter
1 sibling, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-06-16 21:41 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx, Alex Goins
On Tue, Jun 14, 2016 at 09:56:01PM +0100, Chris Wilson wrote:
> obj->base.dma_buf represents a dma-buf exported from this object (for
> use by others). On the contrary, obj->base.import_attach represents the
> source dma-buf that was used to create this object (if any). When
> serialising with third parties, we need to wait on their rendering via
> the import attachment as well as their rendering on our exported
> dma-buf.
>
> v2: Wait on both import and export.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Alex Goins <agoins@nvidia.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/i915_gem_dmabuf.h | 45 +++++++++++++++++++++++++++++++
> drivers/gpu/drm/i915/intel_display.c | 48 ++++++++++++++++++----------------
> 2 files changed, 71 insertions(+), 22 deletions(-)
> create mode 100644 drivers/gpu/drm/i915/i915_gem_dmabuf.h
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.h b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
> new file mode 100644
> index 000000000000..092bb363693c
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.h
> @@ -0,0 +1,45 @@
> +/*
> + * Copyright 2016 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef _I915_GEM_DMABUF_H_
> +#define _I915_GEM_DMABUF_H_
> +
> +#include <linux/dma-buf.h>
> +
> +static inline struct reservation_object *
> +i915_gem_object_get_dmabuf_resv(struct drm_i915_gem_object *obj)
> +{
> + struct dma_buf *dma_buf;
> +
> + if (obj->base.import_attach)
> + dma_buf = obj->base.import_attach->dmabuf;
> + else if (obj->base.dma_buf)
> + dma_buf = obj->base.dma_buf;
> + else
> + return NULL;
> +
> + return dma_buf->resv;
> +}
> +
> +#endif
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 801e4c17dd8d..33531e6cb236 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -36,6 +36,7 @@
> #include "intel_drv.h"
> #include <drm/i915_drm.h>
> #include "i915_drv.h"
> +#include "i915_gem_dmabuf.h"
> #include "intel_dsi.h"
> #include "i915_trace.h"
> #include <drm/drm_atomic.h>
> @@ -46,7 +47,6 @@
> #include <drm/drm_rect.h>
> #include <linux/dma_remapping.h>
> #include <linux/reservation.h>
> -#include <linux/dma-buf.h>
>
> static bool is_mmio_work(struct intel_flip_work *work)
> {
> @@ -11405,6 +11405,8 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
> static bool use_mmio_flip(struct intel_engine_cs *engine,
> struct drm_i915_gem_object *obj)
> {
> + struct reservation_object *resv;
> +
> /*
> * This is not being used for older platforms, because
> * non-availability of flip done interrupt forces us to use
> @@ -11425,12 +11427,12 @@ static bool use_mmio_flip(struct intel_engine_cs *engine,
> return true;
> else if (i915.enable_execlists)
> return true;
> - else if (obj->base.dma_buf &&
> - !reservation_object_test_signaled_rcu(obj->base.dma_buf->resv,
> - false))
> +
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv && !reservation_object_test_signaled_rcu(resv, false))
> return true;
> - else
> - return engine != i915_gem_request_get_engine(obj->last_write_req);
> +
> + return engine != i915_gem_request_get_engine(obj->last_write_req);
> }
>
> static void skl_do_mmio_flip(struct intel_crtc *intel_crtc,
> @@ -11519,6 +11521,7 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
> struct intel_framebuffer *intel_fb =
> to_intel_framebuffer(crtc->base.primary->fb);
> struct drm_i915_gem_object *obj = intel_fb->obj;
> + struct reservation_object *resv;
>
> if (work->flip_queued_req)
> WARN_ON(__i915_wait_request(work->flip_queued_req,
> @@ -11526,11 +11529,10 @@ static void intel_mmio_flip_work_func(struct work_struct *w)
> &dev_priv->rps.mmioflips));
>
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj->base.dma_buf)
> - WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> - false, false,
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv)
> + WARN_ON(reservation_object_wait_timeout_rcu(resv, false, false,
> MAX_SCHEDULE_TIMEOUT) < 0);
> -
> intel_pipe_update_start(crtc);
>
> if (INTEL_GEN(dev_priv) >= 9)
> @@ -13922,6 +13924,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> struct intel_plane *intel_plane = to_intel_plane(plane);
> struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
> + struct reservation_object *resv;
> int ret = 0;
>
> if (!obj && !old_obj)
> @@ -13951,12 +13954,17 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> }
> }
>
> + if (!obj) {
> + i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
> + return 0;
> + }
> +
> /* For framebuffer backed by dmabuf, wait for fence */
> - if (obj && obj->base.dma_buf) {
> + resv = i915_gem_object_get_dmabuf_resv(obj);
> + if (resv) {
> long lret;
>
> - lret = reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> - false, true,
> + lret = reservation_object_wait_timeout_rcu(resv, false, true,
> MAX_SCHEDULE_TIMEOUT);
> if (lret == -ERESTARTSYS)
> return lret;
> @@ -13964,9 +13972,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> WARN(lret < 0, "waiting returns %li\n", lret);
> }
>
> - if (!obj) {
> - ret = 0;
> - } else if (plane->type == DRM_PLANE_TYPE_CURSOR &&
> + if (plane->type == DRM_PLANE_TYPE_CURSOR &&
> INTEL_INFO(dev)->cursor_needs_physical) {
> int align = IS_I830(dev) ? 16 * 1024 : 256;
> ret = i915_gem_object_attach_phys(obj, align);
> @@ -13977,13 +13983,11 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> }
>
> if (ret == 0) {
> - if (obj) {
> - struct intel_plane_state *plane_state =
> - to_intel_plane_state(new_state);
> + struct intel_plane_state *plane_state =
> + to_intel_plane_state(new_state);
>
> - i915_gem_request_assign(&plane_state->wait_req,
> - obj->last_write_req);
> - }
> + i915_gem_request_assign(&plane_state->wait_req,
> + obj->last_write_req);
>
> i915_gem_track_fb(old_obj, obj, intel_plane->frontbuffer_bit);
> }
> --
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-06-16 21:41 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14 15:03 [PATCH] drm/i915: Serialise presentation with imported dmabufs Chris Wilson
2016-06-14 15:37 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-14 15:45 ` [PATCH] " Daniel Vetter
2016-06-14 20:02 ` Chris Wilson
2016-06-14 20:56 ` [PATCH v2] " Chris Wilson
2016-06-15 20:26 ` Alex Goins
2016-06-16 21:41 ` Daniel Vetter
2016-06-15 5:59 ` ✗ Ro.CI.BAT: failure for drm/i915: Serialise presentation with imported dmabufs (rev2) Patchwork
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.