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

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>308332</bug_id>
          
          <creation_ts>2012-10-13 16:42:20 +0000</creation_ts>
          <short_desc>When compositing is enabled, videos are tearing in mplayer</short_desc>
          <delta_ts>2012-10-13 20:20:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>scene-opengl</component>
          <version>4.9.2</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>307965</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ralf Jung">post</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1305518</commentid>
    <comment_count>0</comment_count>
    <who name="Ralf Jung">post</who>
    <bug_when>2012-10-13 16:42:20 +0000</bug_when>
    <thetext>When watching a video in mplayer or VLC using the GL backend (mplayer -vo gl, corresponding configuration in VLC), KWin compositing introduces tearing:

If I disable compositing, mplayer shows a perfectly tear-free video even in fullscreen. VLC is almost as good, tearing creeps in every once in a while but quickly disappears again.

After enabling compositing, I have permanent tearing in both of them. It&apos;s hardly noticeable in the default mplayer window size (which is about a quarter of my screen), but clearly visible when using full-screen (1920x1200 pixels).

Reproducible: Always

Steps to Reproduce:
1. Enable compositing
2. Run &quot;mplayer -vo gl teartest.mp4&quot;
3. Hit &quot;F&quot; (for full-screen mode)
Actual Results:  
Tearing is clearly visible.

Expected Results:  
No tearing should be visible.

* I am using teartest.mp4 from http://ompldr.org/iYXBldg-hide which makes it very easy to see even slight tearing
* I am using Debian testing and a self-compiled KDE 4.9.2
* The graphics card is the HD 3000 from a Core i5-2450M
* Mesa is at version 8.0.1, the Intel Xorg driver at 2.19, the kernel at 3.6
* Tearing is also occasionally visible in games using OpenGL, but that&apos;s much harder to see or reproduce</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305519</commentid>
    <comment_count>1</comment_count>
    <who name="Ralf Jung">post</who>
    <bug_when>2012-10-13 16:53:08 +0000</bug_when>
    <thetext>I forgot to mention:
* &quot;Use VSync&quot; is enabled
* &quot;Suspend Desktop effects for full-screen windows&quot; is disabled</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305522</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-10-13 17:06:48 +0000</bug_when>
    <thetext>most likely bug #307965 ?

does the &quot;upper part&quot; condition hold or does the tearing shift all over thh screen?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305549</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-10-13 18:35:50 +0000</bug_when>
    <thetext>This patch might avoid tearing IN FULLSCREEN WINDOWS ONLY
The more feedback we can get on it, the more likely it&apos;ll get into the next release.

https://git.reviewboard.kde.org/r/106833/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305574</commentid>
    <comment_count>4</comment_count>
    <who name="Ralf Jung">post</who>
    <bug_when>2012-10-13 20:03:13 +0000</bug_when>
    <thetext>Indeed the tearing appears only if I leave the VLC/mplayer window in the upper part of the screen - as if the vblank and screen repaint would get slightly, but not entirely out of sync.

I&apos;ll apply the patch onto my kde-master installation (after verifying I can reproduce the issue there), but it&apos;ll take a time until it&apos;s all compiled and up-to-date again.

Do I understand the explanations in the patch correct in that there is no good way to avoid tearing for non-fullscreen repaints?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1305579</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2012-10-13 20:20:12 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Do I understand the explanations in the patch correct in that there is no
&gt; good way to avoid tearing for non-fullscreen repaints?

- Either glWaitVideoSync is &quot;broken&quot; (for nvidia and now intel) and syncs to the end of the retrace and not the start
- Or that is the intended behavior (making it worthless)
- Or there&apos;s actually the technical limitation that the subbuffer copy cannot be performed during the retrace
- Or it&apos;s sth. entirely different =)

I had hoped it&apos;s broken glWaitVideoSync in the nvidia blob, but, well - seems that&apos;s not the case.


Pending idea is to copy the undamaged parts of the frontbuffer into the backbuffer before doing the actual update on the backbuffer, so we can then perform a (fast) swap during the retrace.

*** This bug has been marked as a duplicate of bug 307965 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>