<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 4, 2017 12:58 PM, "Nicolai Hähnle" <<a href="mailto:nhaehnle@gmail.com">nhaehnle@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On 01.12.2017 21:19, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
<br>
Cc: 17.3 <<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop<wbr>.org</a>><br>
</blockquote>
<br></div>
What's the use-case for this?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">OpenCL interop.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What if somebody exports as DMABUF, then re-imports in a different API and exports as FD for inter-process sharing from there?</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">DMABUF export is impossible for local BOs.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
  src/gallium/drivers/radeon/r60<wbr>0_texture.c | 4 +++-<br>
  1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/gallium/drivers/radeon/r<wbr>600_texture.c b/src/gallium/drivers/radeon/r<wbr>600_texture.c<br>
index 2aa47b5..7a5d704 100644<br>
--- a/src/gallium/drivers/radeon/r<wbr>600_texture.c<br>
+++ b/src/gallium/drivers/radeon/r<wbr>600_texture.c<br>
@@ -740,21 +740,23 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,<br>
                                 rtex->surface.bpe;<br>
                        slice_size = rtex->surface.u.gfx9.surf_slic<wbr>e_size;<br>
                } else {<br>
                        offset = rtex->surface.u.legacy.level[0<wbr>].offset;<br>
                        stride = rtex->surface.u.legacy.level[0<wbr>].nblk_x *<br>
                                 rtex->surface.bpe;<br>
                        slice_size = (uint64_t)rtex->surface.u.lega<wbr>cy.level[0].slice_size_dw * 4;<br>
                }<br>
        } else {<br>
                /* Move a suballocated buffer into a non-suballocated allocation. */<br>
-               if (sscreen->ws->buffer_is_suball<wbr>ocated(res->buf)) {<br>
+               if (sscreen->ws->buffer_is_suball<wbr>ocated(res->buf) ||<br>
+                   (rtex->resource.flags & RADEON_FLAG_NO_INTERPROCESS_SH<wbr>ARING &&<br>
+                    whandle->type != DRM_API_HANDLE_TYPE_KMS)) {<br>
                        assert(!res->b.is_shared);<br>
                        /* Allocate a new buffer with PIPE_BIND_SHARED. */<br>
                        struct pipe_resource templ = res->b.b;<br>
                        templ.bind |= PIPE_BIND_SHARED;<br>
                        struct pipe_resource *newb =<br>
                                screen->resource_create(screen<wbr>, &templ);<br>
                        if (!newb)<br>
                                return false;<br>
<br>
</blockquote>
<br>
<br>
-- <br></div>
Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.<br>
</blockquote></div><br></div></div></div>