Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135065

Rendering sometimes stops for 100ms+ when opening a window

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/Yocto

    Description

      On some systems (custom yocto, Ubuntu 22.04 with nested Qt Wayland Compositor) an example like this stops for 100ms when opening a window in a Wayland Compositor:

      import QtQuick
      import QtQuick.Controls
      Window {
      width: 800
      height: 400
      visible: true
      Window {
      id: other
      }
      Button {
      onClicked: {
      other.visible = true
      }
      }
      }
      

      With WAYLAND_DEBUG and QSG_RENDER_TIMING enabled, it is visible like this:

      qt.scenegraph.time.glyph: distancefield: 35 glyphs prepared in 4ms, rendering=2, upload=2
      qt.scenegraph.time.renderer: time in renderer: total=1ms, preprocess=0, updates=0, rendering=1
      qt.scenegraph.time.texture: atlastexture upload enqueued in: -9223363746551ms (32x18)
      qt.scenegraph.time.texture: atlastexture upload enqueued in: -9223363746551ms (32x18)
      qt.scenegraph.time.renderer: time in renderer: total=11ms, preprocess=1, updates=0, rendering=10
      [1555328.539] -> wl_surface@31.frame(new id wl_callback@28)
      [1555328.618] -> zwp_linux_dmabuf_v1@5.create_params(new id zwp_linux_buffer_params_v1@38)
      [1555328.714] -> zwp_linux_buffer_params_v1@38.add(fd 58, 0, 0, 5120, 16777216, 4)
      [1555328.802] -> zwp_linux_buffer_params_v1@38.add(fd 60, 1, 3276800, 256, 16777216, 4)
      [1555328.867] -> zwp_linux_buffer_params_v1@38.create_immed(new id wl_buffer@39, 1280, 640, 875713089, 0)
      [1555328.928] -> zwp_linux_buffer_params_v1@38.destroy()
      [1555328.948] -> wl_surface@31.attach(wl_buffer@39, 0, 0)
      [1555328.990] -> wl_surface@31.damage(0, 0, 2147483647, 2147483647)
      [1555329.062] -> wl_surface@31.commit()
      [1555329.079] -> wl_display@1.sync(new id wl_callback@40)
      qt.scenegraph.time.renderloop: [window 0x55644251d4f0][gui thread]
      syncAndRender: frame rendered in 88ms, polish=9, sync=23, render=28,
      swap=27, perWindowFrameDelta=235
      qt.scenegraph.time.renderer: time in renderer: total=0ms, preprocess=0, updates=0, rendering=0
      [1555339.661] wl_display@1.delete_id(35)
      [1555339.725] wl_display@1.delete_id(36)
      [1555339.733] wl_display@1.delete_id(37)
      [1555339.739] wl_display@1.delete_id(38)
      [1555339.745] wl_display@1.delete_id(40)
      [1555432.204] wl_callback@40.done(245)
      [1555432.258] -> zwp_linux_dmabuf_v1@5.create_params(new id zwp_linux_buffer_params_v1@40)
      [1555432.314] -> zwp_linux_buffer_params_v1@40.add(fd 58, 0, 0, 5120, 16777216, 4)
      [1555432.360] -> zwp_linux_buffer_params_v1@40.add(fd 60, 1, 3276800, 256, 16777216, 4)
      [1555432.396] -> zwp_linux_buffer_params_v1@40.create_immed(new id wl_buffer@38, 1280, 640, 875713089, 0)
      [1555432.433] -> zwp_linux_buffer_params_v1@40.destroy()
      [1555432.442] -> wl_surface@31.attach(wl_buffer@38, 0, 0)
      [1555432.464] -> wl_surface@31.damage(0, 0, 2147483647, 2147483647)
      [1555432.515] -> wl_surface@31.commit()
      [1555432.524] -> wl_display@1.sync(new id wl_callback@37)
      qt.scenegraph.time.renderloop: [window 0x55644251d4f0][gui thread]
      syncAndRender: frame rendered in 103ms, polish=0, sync=0, render=0,
      swap=102, perWindowFrameDelta=103
      qt.scenegraph.time.renderer: time in renderer: total=0ms, preprocess=0, updates=0, rendering=0
      [1555439.121] wl_display@1.delete_id(40)
      [1555439.170] wl_display@1.delete_id(37)
      [1555535.497] wl_buffer@39.release()
      [1555535.535] wl_callback@37.done(245)
      [1555535.561] -> zwp_linux_dmabuf_v1@5.create_params(new id zwp_linux_buffer_params_v1@37)
      [1555535.622] -> zwp_linux_buffer_params_v1@37.add(fd 58, 0, 0, 5120, 16777216, 4)
      [1555535.663] -> zwp_linux_buffer_params_v1@37.add(fd 60, 1, 3276800, 256, 16777216, 4)
      [1555535.709] -> zwp_linux_buffer_params_v1@37.create_immed(new id wl_buffer@40, 1280, 640, 875713089, 0)
      [1555535.745] -> zwp_linux_buffer_params_v1@37.destroy()
      [1555535.753] -> wl_surface@31.attach(wl_buffer@40, 0, 0)
      [1555535.774] -> wl_surface@31.damage(0, 0, 2147483647, 2147483647)
      [1555535.824] -> wl_surface@31.commit()
      [1555535.834] -> wl_display@1.sync(new id wl_callback@36)
      qt.scenegraph.time.renderloop: [window 0x55644251d4f0][gui thread]
      syncAndRender: frame rendered in 103ms, polish=0, sync=0, render=0,
      swap=102, perWindowFrameDelta=103
      

      With QT_LOGGING_RULES=qt.qpa.wayland.backingstore.debug=true set, the issue seems to point to waiting in QWaylandWindow::waitForFrameSync():

      qt.qpa.wayland.backingstore: handleUpdate QSGRenderThread(0x61100198e200)
      qt.qpa.wayland.backingstore: requestUpdate
      qt.qpa.wayland.backingstore: Didn't receive frame callback in time, window should now be inexposed
      qt.qpa.wayland.backingstore: handleUpdate QSGRenderThread(0x61100198e200)
      qt.qpa.wayland.backingstore: Didn't receive frame callback in time, window should now be inexposed
      qt.qpa.wayland.backingstore: handleUpdate QSGRenderThread(0x61100198e200)
      qt.qpa.wayland.backingstore: deliverUpdateRequest
      

      Looks like it does not have this issue when running with basic render loop.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes