From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109631] New: Moving gbm bo from GART to VRAM does not wait for rendering Date: Thu, 14 Feb 2019 14:16:54 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1423503788==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1423503788== Content-Type: multipart/alternative; boundary="15501538141.8E4A.15459" Content-Transfer-Encoding: 7bit --15501538141.8E4A.15459 Date: Thu, 14 Feb 2019 14:16:54 +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=3D109631 Bug ID: 109631 Summary: Moving gbm bo from GART to VRAM does not wait for rendering Product: xorg Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Driver/nouveau Assignee: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Reporter: vincent.vanlaer-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org QA Contact: xorg-team-go0+a7rfsptAfugRpC6u6w@public.gmane.org A way to demonstrate this is with the following situation. This assumes that one has opened DRM and EGL devices. - create a gbm surface with gbm_surface_create and usage GBM_BO_USE_LINEAR - create an EGLSurface from the gbm surface with eglCreatePlatformWindowSurfaceEXT - render something to it using GLES - get the resulting buffer using gbm_bo_lock_front_buffer - attach it to the hardware cursor using drmModeSetCursor - the cursor is not displayed During these steps the following things happen in the DRM driver: - when the surface is made current using eglMakeCurrent a new bo is created= in NOUVEAU_GBM_DOMAIN_GART (due to GBM_BO_USE_LINEAR) - the rendering operations get queued (and may be flushed with glFlush(), i= n my specific case this didn't matter) - when the bo is attached to the cursor plane, it is moved to NOUVEAU_GBM_DOMAIN_VRAM. If the rendering operations haven't finished at th= is point, the copied buffer is empty. Note that since this is a timing issue it might not be reproducible in all situations.=20 This was tested on different GPUs (GTX 1080 and GT 445M) with rootston (wlr= oots example wayland compositor: https://github.com/swaywm/wlroots , git commit b2f56ad4) running weston-terminal (this makes the issue appear more frequen= tly) Probably the driver should wait for pending rendering operations on the sur= face before moving it around. Another possibility for the scenario listed above = is to let the bo start in VRAM, so no moves are necessary. In order to prevent other setups from breaking this would then only be done if GBM_BO_USE_SCANO= UT was set on creation. A workaround is to add glFinish() in the application before calling drmModeSetCursor. Kernel version: 4.20.6 Mesa version: 18.3.3 --=20 You are receiving this mail because: You are the assignee for the bug.= --15501538141.8E4A.15459 Date: Thu, 14 Feb 2019 14:16:54 +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 109631
Summary Moving gbm bo from GART to VRAM does not wait for rendering
Product xorg
Version unspecified
Hardware x86-64 (AMD64)
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component Driver/nouveau
Assignee nouveau@lists.freedesktop.org
Reporter vincent.vanlaer@skynet.be
QA Contact xorg-team@lists.x.org

A way to demonstrate this is with the following situation. Thi=
s assumes that
one has opened DRM and EGL devices.

- create a gbm surface with gbm_surface_create and usage GBM_BO_USE_LINEAR
- create an EGLSurface from the gbm surface with
eglCreatePlatformWindowSurfaceEXT
- render something to it using GLES
- get the resulting buffer using gbm_bo_lock_front_buffer
- attach it to the hardware cursor using drmModeSetCursor
- the cursor is not displayed

During these steps the following things happen in the DRM driver:
- when the surface is made current using eglMakeCurrent a new bo is created=
 in
NOUVEAU_GBM_DOMAIN_GART (due to GBM_BO_USE_LINEAR)
- the rendering operations get queued (and may be flushed with glFlush(), i=
n my
specific case this didn't matter)
- when the bo is attached to the cursor plane, it is moved to
NOUVEAU_GBM_DOMAIN_VRAM. If the rendering operations haven't finished at th=
is
point, the copied buffer is empty.

Note that since this is a timing issue it might not be reproducible in all
situations.=20
This was tested on different GPUs (GTX 1080 and GT 445M) with rootston (wlr=
oots
example wayland compositor: h=
ttps://github.com/swaywm/wlroots , git commit
b2f56ad4) running weston-terminal (this makes the issue appear more frequen=
tly)

Probably the driver should wait for pending rendering operations on the sur=
face
before moving it around. Another possibility for the scenario listed above =
is
to let the bo start in VRAM, so no moves are necessary. In order to prevent
other setups from breaking this would then only be done if GBM_BO_USE_SCANO=
UT
was set on creation. A workaround is to add glFinish() in the application
before calling drmModeSetCursor.

Kernel version: 4.20.6
Mesa version: 18.3.3


You are receiving this mail because:
  • You are the assignee for the bug.
= --15501538141.8E4A.15459-- --===============1423503788== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1 --===============1423503788==--