<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12936</bug_id>
          
          <creation_ts>2018-09-27 08:36:12 +0000</creation_ts>
          <short_desc>xserver upgrade probably broke video rendering using vaapisink</short_desc>
          <delta_ts>2021-01-22 04:29:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anuj Mittal">anuj.mittal</reporter>
          <assigned_to name="Anuj Mittal">anuj.mittal</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>81647</commentid>
    <comment_count>0</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-09-27 08:36:12 +0000</bug_when>
    <thetext>gst-launch-1.0 videotestsrc ! vaapisink

This results in a non responsive display with 1.20.1 version. Tried reverting the upgrade and didn&apos;t see any issues after that. Using glimagesink works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81757</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-10-04 15:05:34 +0000</bug_when>
    <thetext>Updates from Anuj:

I was looking at this bug and it looks like a problem with glamor
acceleration in the latest xserver/mesa upstream when using dri2 when
both dri2 and dri3 are enabled.

* As an example, this also fails (with no error in Xorg.log or in dmesg)
with poky master:

LIBGL_DRI3_DISABLE=1 glxgears

when dri2 and dri3 are built-in with modesetting driver using glamor 2D
acceleration (all default). vaapi apps fail probably because libva
relies on dri2.

* I built the latest X/mesa/xcb with 4.18 kernel and it doesn&apos;t seem to
have been fixed yet upstream. Will log a bug after debugging the code
some more to see if I can fix this.

* Using intel driver with dri3/dri2 works. Using wayland or xwayland
instead of X also works with dri3/glamor. Disabling glamor to switch to
software rendering also works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81760</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-10-04 15:24:54 +0000</bug_when>
    <thetext>Best thing I can recommend so far is to chase this with the libva upstream.  They&apos;re Intel so we should have a good route there.

Also https://github.com/intel/intel-vaapi-driver/pull/369 is interesting, and worth applying as an experiment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81785</commentid>
    <comment_count>3</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-10-09 09:03:26 +0000</bug_when>
    <thetext>I did a bisect to see what changed that is resulting in this behaviour and this is the bad commit:

commit 86b2d8740a330deafe8a9bbf0402705a43efbb42
Author: Daniel Stone &lt;daniels@collabora.com&gt;
Date:   Wed Apr 4 16:16:36 2018 +0100

    glamor: Reallocate pixmap storage without modifiers if necessary
    
    If we need a pixmap&apos;s storage to be exported to a context in which we
    aren&apos;t aware of modifiers, reallocate the buffer again without
    modifiers.
    
    This makes it possible to run a compositing manager on an old GLX/EGL
    stack on top of an X server which allocates internal buffer storage
    using exotic modifiers from modifier-aware GBM/EGL/KMS.

I think I have a fix:

https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=anujm/wip&amp;id=cfab34da2b73eb229c61b39fa443fb66b954e9ed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81786</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-10-09 10:44:40 +0000</bug_when>
    <thetext>I spoke to Daniel earlier and he says that your fix isn&apos;t right, and:

[11:39:46]  &lt;daniels&gt;	i have the inkling of an idea what this might be
[11:39:52]  &lt;daniels&gt;	but it gets into some seriously unpleasant parts of glx

Such fun!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81853</commentid>
    <comment_count>5</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-10-15 02:10:51 +0000</bug_when>
    <thetext>Thanks Ross. I have filed a bug upstream. Looks like FreeBSD has the same problem:

https://bugs.freebsd.org/bugzilla/attachment.cgi?id=197417&amp;action=diff#x11-servers/xorg-server/Makefile_sec5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82237</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-11-15 14:25:43 +0000</bug_when>
    <thetext>Anuj: can you file a detailed bug upstream at https://gitlab.freedesktop.org/xorg/xserver/issues.  Include a minimal reproducer, the works/fails matrix, as much context as possible.  Please CC me and llandwerlin (Intel VPG developer here in London), we&apos;ll try to rope others in too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82258</commentid>
    <comment_count>7</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-11-16 08:50:18 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Anuj: can you file a detailed bug upstream at
&gt; https://gitlab.freedesktop.org/xorg/xserver/issues.  Include a minimal
&gt; reproducer, the works/fails matrix, as much context as possible.  Please CC
&gt; me and llandwerlin (Intel VPG developer here in London), we&apos;ll try to rope
&gt; others in too.

Done, thanks! 

https://gitlab.freedesktop.org/xorg/xserver/issues/13</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82388</commentid>
    <comment_count>8</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2018-12-04 02:00:58 +0000</bug_when>
    <thetext>Ross was able to reproduce this on Fedora 29 (more details in xserver bug report n comment above) and it was decided that we should reduce the rank of vaapisink for now so playbin works. 

The patch was merged:

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=67f5aac7dfe90f3d2c527fe6387ffc3256aa8065

Changing milestone to 2.7 so we know that this still needs to be fixed and this patch should also be reverted then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88996</commentid>
    <comment_count>9</comment_count>
    <who name="Anuj Mittal">anuj.mittal</who>
    <bug_when>2021-01-22 04:29:13 +0000</bug_when>
    <thetext>Upstream also reduced the rank of vaapisink

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/commit/13d090b5660a2e2e2c997db44ba9a391101e8bd6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>