XPresentPixmap() BadWindow, recompiling fixes it

Bug #1801071 reported by Evaldas Granickas on 2018-11-01
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
libxpresent (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned

Bug Description

I've downloaded the latest xfwm 4.13 with XPresent support from this ppa https://launchpad.net/~xubuntu-dev/+archive/ubuntu/experimental , but it did not work. Instead I got this error:
(xfwm4:712): xfwm4-WARNING **: 14:40:45.838: Dismissing XPresent as unusable, error 3 for request 148.

The problem seems to be caused by XPresentPixmap() throwing a BadWindow error. I've found an older post talking about the same issue here https://lists.x.org/archives/xorg-devel/2017-June/053874.html . They suggest that the issue was solved in presentproto, which in Ubuntu is in the package x11proto-present-dev.

I've noticed that when libxpresent was last compiled, in 2015, Ubuntu still had the version of presentproto without this fix. So I recompiled it on my system and the issue went away - xfwm4 now works perfectly with XPresent.

$ lsb_release -rd
Description: Ubuntu 18.04.1 LTS
Release: 18.04

$ apt-cache policy libxpresent1
libxpresent1:
  Installed: 1.0.0-2
  Candidate: 1.0.0-2
  Version table:
 *** 1.0.0-2 500
        500 http://lt.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libxpresent (Ubuntu):
status: New → Confirmed
bwat47 (bwat47) wrote :

This also effects MATE's xpresent compositing: https://ubuntu-mate.community/t/ubuntu-mate-18-04-marco-and-dri3/16262/29

Would love to see this fixed, it works fine in other distros...

Simon Quigley (tsimonq2) on 2019-05-07
Changed in libxpresent (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libxpresent - 1.0.0-2build1

---------------
libxpresent (1.0.0-2build1) eoan; urgency=medium

  * No-change rebuild for a new version of presentproto (LP: #1801071).

 -- Martin Wimpress <email address hidden> Tue, 07 May 2019 08:12:58 -0500

Changed in libxpresent (Ubuntu):
status: Fix Committed → Fix Released
Victor Kareh (vkareh) wrote :

This fixes the issue for me on MATE (using marco). Thanks!

tags: added: performance
Pedro Fleck (freckts) wrote :

How to install the updated package in Disco? I'm suffering from terrible tearing using XFCE and modesetting driver, Compton works really bad and I don't want to use the old Intel DDX driver.

Daniel van Vugt (vanvugt) wrote :

I haven't verified this works on disco, but first you can try installing the package from eoan on disco:

  https://launchpad.net/ubuntu/+archive/primary/+files/libxpresent1_1.0.0-2build1_amd64.deb

Daniel van Vugt (vanvugt) wrote :

By the way, this particular bug is not about tearing, even if the aforementioned fix is.

If you want to talk about tearing in MATE then please use bug 1565496.

If you want to talk about tearing in XFCE or any other desktop then please open a new bug.

Pedro Fleck (freckts) wrote :

I know it is not, but I found this issue trying to fix the tearing since modesetting doesn't have a VSync option like Intel did and XFWM 4.12 VSync option didn't fix it. But I just tried the Eoan package and now XPresent works for XFWM 4.13 and my tearing problem is solved! Any chance that it will be backported to 19.04/18.04?

Daniel van Vugt (vanvugt) wrote :

> modesetting doesn't have a VSync option like Intel did

The modesetting driver shouldn't ever tear in the single monitor case. If it does then that's a bug like this one. Although modesetting may tear in the multi-monitor case and there is an effort underway by Intel to fix that:

  https://gitlab.freedesktop.org/xorg/xserver/merge_requests/24

And yes I hope we can backport LP: #1801071 to existing Ubuntu releases. Please try comment #7 to start with.

Pedro Fleck (freckts) wrote :

Since when? What I know is that modesetting doesn't provide VSync and it's up to the DE to enable something to avoid tearing. From what I understood from this merge request is that TearFree isn't ready yet. But the Eoan package works just fine.

Daniel van Vugt (vanvugt) wrote :

Modesetting provides vsync and avoids tearing in all cases except in some edge cases:

  * Multi-monitor
  * Xrandr scaling
  * Other broken packages like this bug

But those are just bugs. One of them is fixed here and the rest should be fixed eventually in:

  https://gitlab.freedesktop.org/xorg/xserver/merge_requests/24

You can call it "TearFree" if you like, but one of the reasons modesetting doesn't contain an option by that name is that it aims to never tear. So an option by the name "TearFree" isn't required. If it does tear then that's just a bug.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libxpresent (Ubuntu Bionic):
status: New → Confirmed
Changed in libxpresent (Ubuntu Disco):
status: New → Confirmed
agent 8131 (agent-8131) wrote :

I consider this a regression from 16.04 to 18.04. However, installing from eoan on 18.04 resolved this set of issues for me:

https://packages.ubuntu.com/eoan/amd64/libxpresent1/download

It would be great to get this into other versions as it seems like a trivial fix.

Matteo Panella (mpanella) wrote :

I can confirm that the package from eoan fixes the xpresent compatibility error with marco/compton on 18.04 (and consequently compositing actually works).

I hope this qualifies as a potential SRU for 18.04.

tags: added: rls-bb-incoming rls-dd-incoming
Timo Aaltonen (tjaalton) on 2020-01-28
Changed in libxpresent (Ubuntu Disco):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers