Bug 107287 - [glamor] Texture from pixmap broken with glamor on xserver 1.20
Summary: [glamor] Texture from pixmap broken with glamor on xserver 1.20
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Acceleration/glamor (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-19 09:26 UTC by Olivier Fourdan
Modified: 2018-12-13 18:25 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Simple reproducer based on khronos example (5.40 KB, text/plain)
2018-07-19 09:26 UTC, Olivier Fourdan
no flags Details
[PATCH] xwayland: Enable DRI3 for glamor (1.14 KB, patch)
2018-07-19 12:23 UTC, Olivier Fourdan
no flags Details | Splinter Review

Description Olivier Fourdan 2018-07-19 09:26:45 UTC
Created attachment 140707 [details]
Simple reproducer based on khronos example

Description:

Using texture from pixmap on Xwayland or modesetting with glamor acceleration leads to a blank output.

How reproducible

Always

Steps to reproduce:

1. Install Xwayland from xserver-1.20
2. Run weston
3. Save, build and run the attached example (reproducer)

Actual result:

Blank window

Expected results:

Window with content

Additional information:

I apologize in advance for the apparent confusion around this issue, which is caused by me trying to pinpoint the problem in various places...

A similar issue was for reported in Debian with xfce compositor using the GL backend:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901789

Then later reported to xfce bugzilla:

  https://bugzilla.xfce.org/show_bug.cgi?id=14475

From which I filed a bug in Mesa as a regression:

  https://bugs.freedesktop.org/show_bug.cgi?id=107117

To realize that the same issue was seen in Xwayland and was related to the use of glamor acceleration (in either the modesetting driver on Xorg or Xwayland).

Attach is a simple reproducer taken from khronos sample code:

  https://www.khronos.org/opengl/wiki/Programming_OpenGL_in_Linux:_Using_texture_from_pixmap_extension

I bisected xserver and came up with:

c8c276c9569b3ca1e695682a5443f1b615c606bd is the first bad commit
commit c8c276c9569b3ca1e695682a5443f1b615c606bd
Author: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Date:   Wed Feb 28 01:19:43 2018 +0000

    glamor: Implement PixmapFromBuffers and BuffersFromPixmap
    
    It relies on GBM >= 17.1.0 where we can import BO with multiple
    planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER).
    
    v2: Properly free fds in Xwayland
    
    [Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax]
    
    Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
    Reviewed-by: Daniel Stone <daniels@collabora.com>
    Acked-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>

:100644 100644 f4534e30be40418d52459bdc35b504f101de0d19 773567b53d5df6d7f8f2d94bcefd43bd71247de4 M	configure.ac
:040000 040000 c0b6c60c7f495b364563a1c4bc2ab09a894d0226 631ddb5a8cd1df72577a082b9fb2b51c489bfe4f M	glamor
:040000 040000 e3c1ceb61a269c4672143f59d5dc149ce8ade721 033f6fbcc370ba076c2ca811ce67673368b0fa6f M	hw
:040000 040000 26e8d926cdd79d805a7850ee0c20c49f5e9de969 ac974d68896345c126304f5338c4f52abd83acfd M	include
Comment 1 Michel Dänzer 2018-07-19 09:44:59 UTC
FWIW, it's still working for me with modesetting on amdgpu, presumably it only broke on platforms with modifier support?
Comment 2 Olivier Fourdan 2018-07-19 09:49:40 UTC
(In reply to Michel Dänzer from comment #1)
> FWIW, it's still working for me with modesetting on amdgpu, presumably it
> only broke on platforms with modifier support?

That's what I suspect as well. 

Out of curiosity, on amdgpu and modesetting+glamor, does that other reproducer work https://bugzilla.xfce.org/attachment.cgi?id=7835 ?
Comment 3 Michel Dänzer 2018-07-19 10:49:28 UTC
(In reply to Olivier Fourdan from comment #2)
> Out of curiosity, on amdgpu and modesetting+glamor, does that other
> reproducer work https://bugzilla.xfce.org/attachment.cgi?id=7835 ?

Yep, shows a red square on grey background, same as with xf86-video-amdgpu.
Comment 4 Olivier Fourdan 2018-07-19 12:23:25 UTC
Created attachment 140710 [details] [review]
[PATCH] xwayland: Enable DRI3 for glamor

So we may have two issues actually. For the reproducer to work, this attached patch seems to fix the problem.

However, the second reproducer still doesn't work so there is probably more to it.
Comment 5 Eero Tamminen 2018-07-19 12:37:33 UTC
Could also bug 106734 be related to this?
Comment 6 Olivier Fourdan 2018-07-19 12:50:51 UTC
(In reply to Eero Tamminen from comment #5)
> Could also bug 106734 be related to this?

Nope, I doubt it, this seems completely unrelated.
Comment 7 GitLab Migration User 2018-12-13 18:25:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/101.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.