From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Sat, 28 Apr 2018 20:06:49 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1733722550==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C88E6E17F for ; Sat, 28 Apr 2018 20:06:49 +0000 (UTC) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1733722550== Content-Type: multipart/alternative; boundary="15249460090.c77AE.6102" Content-Transfer-Encoding: 7bit --15249460090.c77AE.6102 Date: Sat, 28 Apr 2018 20:06:49 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 Bug ID: 106302 Summary: [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Product: Mesa Version: 17.2 Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/radeonsi Assignee: dri-devel@lists.freedesktop.org Reporter: seb@vestigecounty.com QA Contact: dri-devel@lists.freedesktop.org Created attachment 139204 --> https://bugs.freedesktop.org/attachment.cgi?id=3D139204&action=3Dedit Isolated test case Summary: =3D=3D=3D=3D=3D=3D=3D=3D On radeonsi, when performing an "asynchronous texture upload" (that is, a texture upload on a secondary thread and secondary shared EGL context) the produced texture is not usable on the main thread (contains garbage). Steps to reproduce: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1. Create an EGL context (with its own pbuffer surface) and make it current= on Thread 1. 2. Create another EGL context (with its own pbuffer surface) and make it current on Thread 2. 3. Generate and upload a texture on Thread 2. 4. When Thread 2 is finished, pass the texture name to Thread 1. 5. Draw a textured quad on Thread 1 using the texture passed from Thread 2. Expected behavior: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Valid texture content in pbuffer surface of Thread 1. Actual behavior: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Garbage is observed. Behavior is observed in stock mesa in Ubuntu 17.10. Bug is not repro with software renderer or the i915 driver. Please use the attached cpp file to reproduce. --=20 You are receiving this mail because: You are the assignee for the bug.= --15249460090.c77AE.6102 Date: Sat, 28 Apr 2018 20:06:49 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 106302
Summary [radeonsi] Garbage content when accessing a texture in multip= le shared EGL contexts
Product Mesa
Version 17.2
Hardware x86-64 (AMD64)
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component Drivers/Gallium/radeonsi
Assignee dri-devel@lists.freedesktop.org
Reporter seb@vestigecounty.com
QA Contact dri-devel@lists.freedesktop.org

Created attachment 139204=
 [details]
Isolated test case

Summary:
=3D=3D=3D=3D=3D=3D=3D=3D
On radeonsi, when performing an "asynchronous texture upload" (th=
at is, a
texture upload on a secondary thread and secondary shared EGL context) the
produced texture is not usable on the main thread (contains garbage).

Steps to reproduce:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1. Create an EGL context (with its own pbuffer surface) and make it current=
 on
Thread 1.
2. Create another EGL context (with its own pbuffer surface) and make it
current on Thread 2.
3. Generate and upload a texture on Thread 2.
4. When Thread 2 is finished, pass the texture name to Thread 1.
5. Draw a textured quad on Thread 1 using the texture passed from Thread 2.

Expected behavior:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Valid texture content in pbuffer surface of Thread 1.

Actual behavior:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Garbage is observed.

Behavior is observed in stock mesa in Ubuntu 17.10.  Bug is not repro with
software renderer or the i915 driver.  Please use the attached cpp file to
reproduce.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15249460090.c77AE.6102-- --===============1733722550== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1733722550==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Wed, 22 May 2019 11:59:02 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0895182287==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F2A88994A for ; Wed, 22 May 2019 11:59:02 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0895182287== Content-Type: multipart/alternative; boundary="15585263421.fFbBb8.5958" Content-Transfer-Encoding: 7bit --15585263421.fFbBb8.5958 Date: Wed, 22 May 2019 11:59:02 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 --- Comment #1 from Pierre-Eric Pelloux-Prayer --- I can reproduce but I don't think it's a bug in Mesa: your createTexture() function doesn't use any synchronization mechanisms so you can't expect the other thread/context to pick up the changes mades to the texture. Adding a call to glFlush or glFinish at the end of createTexture() is enoug= h in this case to fix the issue. --=20 You are receiving this mail because: You are the assignee for the bug.= --15585263421.fFbBb8.5958 Date: Wed, 22 May 2019 11:59:02 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 10630= 2 from Pierre-Eric Pelloux-Prayer
I can reproduce but I don't think it's a bug in Mesa: your cre=
ateTexture()
function doesn't use any synchronization mechanisms so you can't expect the
other thread/context to pick up the changes mades to the texture.

Adding a call to glFlush or glFinish at the end of createTexture() is enoug=
h in
this case to fix the issue.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15585263421.fFbBb8.5958-- --===============0895182287== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0895182287==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Sat, 25 May 2019 20:07:38 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0371626290==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 61E8F89FED for ; Sat, 25 May 2019 20:07:38 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0371626290== Content-Type: multipart/alternative; boundary="15588148580.C0e3C444c.10693" Content-Transfer-Encoding: 7bit --15588148580.C0e3C444c.10693 Date: Sat, 25 May 2019 20:07:38 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 --- Comment #2 from seb@vestigecounty.com --- Pierre-Eric, in my interpretation of OpenGL(R) ES Version 3.0.5 (November 3, 2016) Specification, Appendix 4: Shared Objects and Multiple Contexts, D.3. Propagating Changes to Objects, Rule 4:... ---- If the contents of an object T are changed in a context other than the curr= ent context, T must be attached or re-attached to at least one binding point in= the current context, or at least one attachment point of a currently bound container object C, in order to guarantee that the new contents of T are visible in the current context. Example: If a texture image is bound to multiple texture bind points and the texture is changed in another context, re-binding the texture at any one of= the texture bind points is sufficient to cause the changes to be visible at all texture bind points. ---- ...Finish or Fence are not required, since I am re-binding the texture on t= he secondary thread where I expect changes to be seen. --=20 You are receiving this mail because: You are the assignee for the bug.= --15588148580.C0e3C444c.10693 Date: Sat, 25 May 2019 20:07:38 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 2 on bug 10630= 2 from seb@vest= igecounty.com
Pierre-Eric, in my interpretation of OpenGL(R) ES Version 3.0.=
5 (November 3,
2016) Specification, Appendix 4: Shared Objects and Multiple Contexts, D.3.
Propagating Changes to Objects, Rule 4:...

----
If the contents of an object T are changed in a context other than the curr=
ent
context, T must be attached or re-attached to at least one binding point in=
 the
current context, or at least one attachment point of a currently bound
container object C, in order to guarantee that the new contents of T are
visible in the current context.

Example: If a texture image is bound to multiple texture bind points and the
texture is changed in another context, re-binding the texture at any one of=
 the
texture bind points is sufficient to cause the changes to be visible at all
texture bind points.
----

...Finish or Fence are not required, since I am re-binding the texture on t=
he
secondary thread where I expect changes to be seen.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15588148580.C0e3C444c.10693-- --===============0371626290== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0371626290==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Mon, 27 May 2019 18:47:35 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0251884218==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D80E89A74 for ; Mon, 27 May 2019 18:47:35 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0251884218== Content-Type: multipart/alternative; boundary="15589828552.DFbd67D.4606" Content-Transfer-Encoding: 7bit --15589828552.DFbd67D.4606 Date: Mon, 27 May 2019 18:47:35 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 --- Comment #3 from Pierre-Eric Pelloux-Prayer --- I agree but "D.3.1 Determining Completion of Changes to an object" says: "T= he contents of an object T are considered to have been changed once a command = such as described in section D.3 has completed. Completion of a command may be determined either by calling Finish, or by calling FenceSync and executing a WaitSync command on the associated sync object.". So in my understanding, the contents of your texture in your example haven't changed by the end of createTexture() (because the glTexImage command hasn't completed) so rule 4 isn't relevant. --=20 You are receiving this mail because: You are the assignee for the bug.= --15589828552.DFbd67D.4606 Date: Mon, 27 May 2019 18:47:35 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 3 on bug 10630= 2 from Pierre-Eric Pelloux-Prayer
I agree but "D.3.1 Determining Completion of Changes to a=
n object" says: "The
contents of an object T are considered to have been changed once a command =
such
as described in section D.3 has completed. Completion of a command may be
determined either by calling Finish, or by calling FenceSync and executing a
WaitSync command on the associated sync object.".

So in my understanding, the contents of your texture in your example haven't
changed by the end of createTexture() (because the glTexImage command hasn't
completed) so rule 4 isn't relevant.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15589828552.DFbd67D.4606-- --===============0251884218== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0251884218==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Tue, 28 May 2019 18:59:10 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1724117783==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [IPv6:2610:10:20:722:a800:ff:fe98:4b55]) by gabe.freedesktop.org (Postfix) with ESMTP id 2175D6E053 for ; Tue, 28 May 2019 18:59:10 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1724117783== Content-Type: multipart/alternative; boundary="15590699500.62D36.14410" Content-Transfer-Encoding: 7bit --15590699500.62D36.14410 Date: Tue, 28 May 2019 18:59:10 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 --- Comment #4 from seb@vestigecounty.com --- Thank you for being exactly on point, it turns out I was using a frivolous interpretation of "change" rather than the one specified in OpenGL ES. The= bug can safely be closed as invalid, as fence is necessary in this case. One thing that is curious to me still, is whether sampling the texture in t= he second thread should yield (0,0,0), since the texture change has not comple= ted yet, and associated texture object is thus incomplete. --=20 You are receiving this mail because: You are the assignee for the bug.= --15590699500.62D36.14410 Date: Tue, 28 May 2019 18:59:10 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 4 on bug 10630= 2 from seb@vest= igecounty.com
Thank you for being exactly on point, it turns out I was using=
 a frivolous
interpretation of "change" rather than the one specified in OpenG=
L ES.  The bug
can safely be closed as invalid, as fence is necessary in this case.

One thing that is curious to me still, is whether sampling the texture in t=
he
second thread should yield (0,0,0), since the texture change has not comple=
ted
yet, and associated texture object is thus incomplete.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15590699500.62D36.14410-- --===============1724117783== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============1724117783==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 106302] [radeonsi] Garbage content when accessing a texture in multiple shared EGL contexts Date: Wed, 29 May 2019 08:00:02 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0143323871==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B13D6E2A6 for ; Wed, 29 May 2019 08:00:02 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0143323871== Content-Type: multipart/alternative; boundary="15591168020.A0E96D90.20894" Content-Transfer-Encoding: 7bit --15591168020.A0E96D90.20894 Date: Wed, 29 May 2019 08:00:02 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D106302 Pierre-Eric Pelloux-Prayer changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --=20 You are receiving this mail because: You are the assignee for the bug.= --15591168020.A0E96D90.20894 Date: Wed, 29 May 2019 08:00:02 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated Pierre-Eric Pel= loux-Prayer changed bug 10630= 2
What Removed Added
Status NEW RESOLVED
Resolution --- INVALID


You are receiving this mail because:
  • You are the assignee for the bug.
= --15591168020.A0E96D90.20894-- --===============0143323871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0143323871==--