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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>160491</bug_id>
          
          <creation_ts>2016-08-02 23:53:14 -0700</creation_ts>
          <short_desc>[GTK] Bad performance in accelerated compositing mode with the modesetting intel driver and DRI3 enabled</short_desc>
          <delta_ts>2018-12-21 16:48:30 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.freedesktop.org/show_bug.cgi?id=85064</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>clopez</cc>
    
    <cc>jdapena</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>mrobinson</cc>
    
    <cc>rfarmer84</cc>
    
    <cc>svillar</cc>
    
    <cc>yoon</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1216822</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-08-02 23:53:14 -0700</bug_when>
    <thetext>This is becoming the default in several linux distributions and it makes WebKitGTK+ unusable in accelerated compositing mode, which is now always enabled because since we switched to use the threaded compositor. The problem seems to be an optimization of the intel driver for windows that are offscreen, and our redirected window is always positioned at ScreenWidth + 1, 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216823</commentid>
    <comment_count>1</comment_count>
      <attachid>285205</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-08-02 23:59:05 -0700</bug_when>
    <thetext>Created attachment 285205
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216832</commentid>
    <comment_count>2</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2016-08-03 00:50:07 -0700</bug_when>
    <thetext>I was tempted to r+ but it looks like this is an undesirable side effect, so I&apos;d prefer not to rely on that. From the freedesktop bug:

&quot;Weird, not sure why that avoids the problem; maybe there&apos;s an off-by-one bug somewhere which causes the window to be incorrectly considered on-screen. I wouldn&apos;t recommend relying on that. Also, again I&apos;m not sure that negative coordinates can never be visible.&quot;

Also

&quot;Assuming a window is really the only possibility, (why) can&apos;t it set the swap interval to 0 via one of the GLX extensions for this, to prevent SwapBuffers operations from getting throttled?&quot;

Can&apos;t we do this instead?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1216841</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-08-03 01:10:51 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I was tempted to r+ but it looks like this is an undesirable side effect, so
&gt; I&apos;d prefer not to rely on that. From the freedesktop bug:
&gt; 
&gt; &quot;Weird, not sure why that avoids the problem; maybe there&apos;s an off-by-one
&gt; bug somewhere which causes the window to be incorrectly considered
&gt; on-screen. I wouldn&apos;t recommend relying on that. Also, again I&apos;m not sure
&gt; that negative coordinates can never be visible.&quot;

Yes, but he also said that using WidthOfScreen is bad in any case, so if the patch fixes that and works as a workaround, we could land it in any case and then continue working a better solution, but with a workaround to make WebKitGTK+ usable again.

&gt; Also
&gt; 
&gt; &quot;Assuming a window is really the only possibility, (why) can&apos;t it set the
&gt; swap interval to 0 via one of the GLX extensions for this, to prevent
&gt; SwapBuffers operations from getting throttled?&quot;
&gt; 
&gt; Can&apos;t we do this instead?

I guess, I&apos;m not a graphics expert, and I don&apos;t even know if we really need to use a window or not. I&apos;ll take a look at the swap interval thing in any case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217070</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-08-03 12:40:48 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Yes, but he also said that using WidthOfScreen is bad in any case

True. r=me on that basis, but I recommend giving the upstream bug a couple days to settle before committing, now that the Xorg folks are actively looking into the issue.

We also should have an answer to their question as to why we use an offscreen window instead of a pixmap, which is clearly their recommendation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217071</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-08-03 12:41:51 -0700</bug_when>
    <thetext>CCing folks who might possibly have an answer to the question in comment #4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217072</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-08-03 12:44:14 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I was tempted to r+ but it looks like this is an undesirable side effect, so
&gt; I&apos;d prefer not to rely on that.

My main concern is that it might be a bug that the negative offset works to avoid throttling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217314</commentid>
    <comment_count>7</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-08-03 21:55:30 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #2)
&gt; &gt; I was tempted to r+ but it looks like this is an undesirable side effect, so
&gt; &gt; I&apos;d prefer not to rely on that.
&gt; 
&gt; My main concern is that it might be a bug that the negative offset works to
&gt; avoid throttling.

Right, that&apos;s why I don&apos;t consider it a fix, if that&apos;s actually a bug and is fixed eventually the performance will be bad again, but I&apos;m pretty sure we will not be the only ones affected like now, because most of the code that creates an offscreen window use negative coords, either -1, -1 or -100, -100.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1218458</commentid>
    <comment_count>8</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-08-07 22:42:25 -0700</bug_when>
    <thetext>Committed r204250: &lt;http://trac.webkit.org/changeset/204250&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490570</commentid>
    <comment_count>9</comment_count>
    <who name="Ryan Farmer">rfarmer84</who>
    <bug_when>2018-12-21 16:48:30 -0800</bug_when>
    <thetext>I experience bad performance with accelerated compositing mode on using WebkitGTK+ 2.22.5 on Fedora 29 with Intel Iris 540 (Skylake mobile) graphics. Turning it off makes pretty much everything faster, but particularly Facebook, which is nearly unusable with accelerated compositing on.

Also, when playing videos or scrolling through a site like Facebook, the laptop becomes hot and the fan goes full blast, which does not happen with accelerated compositing off. 

Would this bug be the issue I&apos;m experiencing, or should I file a new bug about this?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>285205</attachid>
            <date>2016-08-02 23:59:05 -0700</date>
            <delta_ts>2016-08-03 12:40:56 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>wk2-dri3.diff</filename>
            <type>text/plain</type>
            <size>1986</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCA1Y2NhZGQ2Li4zYzY1MGZjIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMjAg
QEAKKzIwM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AgICBt
X3BhcmVudFdpbmRvdyA9IFhDcmVhdGVXaW5kb3cobV9kaXNwbGF5LAogICAgICAgICBSb290V2lu
ZG93T2ZTY3JlZW4oc2NyZWVuKSwKLSAgICAgICAgV2lkdGhPZlNjcmVlbihzY3JlZW4pICsgMSwg
MCwgMSwgMSwKKyAgICAgICAgLTEsIC0xLCAxLCAxLAogICAgICAgICAwLAogICAgICAgICBnZGtf
dmlzdWFsX2dldF9kZXB0aCh2aXN1YWwpLAogICAgICAgICBJbnB1dE91dHB1dCwK
</data>
<flag name="review"
          id="308837"
          type_id="1"
          status="+"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>