r27849 - trunk/libvo/x11_common.c
Author: ben Date: Wed Oct 29 23:03:36 2008 New Revision: 27849 Log: Remove X11 backing store: this is now a useless flag. Also, it is mandatory for Xserver 1.5.x (part of Xorg 7.4, shipped on all Linux distributions starting from Oct. 08) and will be removed from Xserver 1.6 anyhow ... Patch by Stephane Marchesin (marchesin at icps dot u dash strasbg dot fr). For more info, see long flame thread at: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-August/058323.html Modified: trunk/libvo/x11_common.c Modified: trunk/libvo/x11_common.c ============================================================================== --- trunk/libvo/x11_common.c (original) +++ trunk/libvo/x11_common.c Wed Oct 29 23:03:36 2008 @@ -1240,7 +1240,7 @@ Window vo_x11_create_smooth_window(Displ unsigned int width, unsigned int height, int depth, Colormap col_map) { - unsigned long xswamask = CWBackingStore | CWBorderPixel; + unsigned long xswamask = CWBorderPixel; XSetWindowAttributes xswa; Window ret_win; @@ -1251,7 +1251,7 @@ Window vo_x11_create_smooth_window(Displ } xswa.background_pixel = 0; xswa.border_pixel = 0; - xswa.backing_store = Always; + xswa.backing_store = NotUseful; xswa.bit_gravity = StaticGravity; ret_win =
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Sorry, but past X.org versions do not magically change, so how can it be now useless?
Also, it is mandatory for Xserver 1.5.x (part of Xorg 7.4, shipped on all Linux distributions starting from Oct. 08) and will be removed from Xserver 1.6 anyhow ...
Removed meaning? An API change?
Patch by Stephane Marchesin (marchesin at icps dot u dash strasbg dot fr).
For more info, see long flame thread at: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-August/058323.html
Well, and still nobody has clearly explained the why?! So, why did you commit it? Just because a patch was sent? Or to work around buggy/slow/stupid video drivers? Or why? Btw. I am the maintainer of that code and I still object to changing code when the arguments for it are all full of nonsense and/or inconsistent. Greetings, Reimar Döffinger
On Thu, 2008-10-30 at 18:46 +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Patch by Stephane Marchesin (marchesin at icps dot u dash strasbg dot fr).
For more info, see long flame thread at: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-August/058323.html
Well, and still nobody has clearly explained the why?! So, why did you commit it? Just because a patch was sent? Or to work around buggy/slow/stupid video drivers? Or why?
Enabling backing store is apparently harmful in xserver 1.5. See http://www.nvnews.net/vbulletin/showthread.php?t=119047 (I already posted that link when it was discussed before). I didn't see any mention of backing store being useful in the earlier mplayer-dev-eng thread. The above link says it's harmful in some xserver versions. Given that, turning backing store off seems reasonable to me. Even working around buggy drivers would be an OK reason if there's no clearly explained rationale why it would should remain on (switching it off seems unlikely to trigger any new bugs).
On Thu, Oct 30, 2008 at 08:35:58PM +0200, Uoti Urpala wrote:
On Thu, 2008-10-30 at 18:46 +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Patch by Stephane Marchesin (marchesin at icps dot u dash strasbg dot fr).
For more info, see long flame thread at: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-August/058323.html
Well, and still nobody has clearly explained the why?! So, why did you commit it? Just because a patch was sent? Or to work around buggy/slow/stupid video drivers? Or why?
Enabling backing store is apparently harmful in xserver 1.5. See http://www.nvnews.net/vbulletin/showthread.php?t=119047 (I already posted that link when it was discussed before).
I didn't see any mention of backing store being useful in the earlier mplayer-dev-eng thread. The above link says it's harmful in some xserver versions. Given that, turning backing store off seems reasonable to me. Even working around buggy drivers would be an OK reason if there's no clearly explained rationale why it would should remain on (switching it off seems unlikely to trigger any new bugs).
Oh, I do not disagree, but this was never discussed as "workaround for X.org 1.5 performance issue". I'd probably agree that it is worth it, but now even the commit message says the reason is it is "useless" which seen even in the most positive light only means there is no reason to keep it but is not a reason to remove it, which a commit message certainly should contain. Thus my question, which is the actual why and why was that reason considered more important than the performance improvement that probably could be possible with a well-implemented X-server (note this file is called x11_common.c, not xorg_specific_x11_common.c)?
On Thu, 2008-10-30 at 19:58 +0100, Reimar Döffinger wrote:
On Thu, Oct 30, 2008 at 08:35:58PM +0200, Uoti Urpala wrote:
Enabling backing store is apparently harmful in xserver 1.5. See http://www.nvnews.net/vbulletin/showthread.php?t=119047 (I already posted that link when it was discussed before).
I didn't see any mention of backing store being useful in the earlier mplayer-dev-eng thread. The above link says it's harmful in some xserver versions. Given that, turning backing store off seems reasonable to me. Even working around buggy drivers would be an OK reason if there's no clearly explained rationale why it would should remain on (switching it off seems unlikely to trigger any new bugs).
Oh, I do not disagree, but this was never discussed as "workaround for X.org 1.5 performance issue".
The main issue discussed in the above link is tearing-like corruption due to draw redirection without vsync, not performance.
I'd probably agree that it is worth it, but now even the commit message says the reason is it is "useless" which seen even in the most positive light only means there is no reason to keep it but is not a reason to remove it, which a commit message certainly should contain. Thus my question, which is the actual why and why was that reason considered more important than the performance improvement that probably could be possible with a well-implemented X-server (note this file is called x11_common.c, not xorg_specific_x11_common.c)?
What performance improvement? You mean you think MPlayer enabling backing store could improve performance at least on a theoretical X server? I don't see how that could be the case; a server is already free to keep the bitmaps in memory if it thinks that's good for performance, while forcing that behavior can require extra copies which degrade performance. The data is only required during expose events which are the exceptional case, so backing store should not give any benefit during basic playback while the requirement to always keep the data ready in case an expose event happens can add overhead.
On Thu, Oct 30, 2008 at 09:22:33PM +0200, Uoti Urpala wrote:
The data is only required during expose events which are the exceptional case, so backing store should not give any benefit during basic playback while the requirement to always keep the data ready in case an expose event happens can add overhead.
E.g. for XVideo expose events are the only events that matter. But I do not really want to discuss that again, I just want a commit message that give at least some idea of the point of it, which hopefully the committer can answer.
On Fri, 2008-10-31 at 12:08 +0100, Reimar Döffinger wrote:
On Thu, Oct 30, 2008 at 09:22:33PM +0200, Uoti Urpala wrote:
The data is only required during expose events which are the exceptional case, so backing store should not give any benefit during basic playback while the requirement to always keep the data ready in case an expose event happens can add overhead.
E.g. for XVideo expose events are the only events that matter.
I'm not quite sure what you're trying to say here. Expose and resize events are the only events that do anything nontrivial performance-wise, but no event type matters for basic playback performance. Expose events should only happen when a part of the window that was previously hidden becomes visible.
But I do not really want to discuss that again,
I do not remember any claim of possible "performance improvement" by enabling backing store in earlier discussion.
I just want a commit message that give at least some idea of the point of it, which hopefully the committer can answer.
I agree that the commit message did not explain the rationale clearly, but I'm not sure what you mean by the "which hopefully the committer can answer" part. Do you think it's still unclear whether a justified rationale exists? IMO the fact that there are documented cases where backing store is harmful and no indication of it being useful does justify the commit.
On Fri, Oct 31, 2008 at 04:08:39PM +0200, Uoti Urpala wrote:
On Fri, 2008-10-31 at 12:08 +0100, Reimar Döffinger wrote:
I just want a commit message that give at least some idea of the point of it, which hopefully the committer can answer.
I agree that the commit message did not explain the rationale clearly, but I'm not sure what you mean by the "which hopefully the committer can answer" part. Do you think it's still unclear whether a justified rationale exists? IMO the fact that there are documented cases where backing store is harmful and no indication of it being useful does justify the commit.
My real problem is: the commit message is utter crap, and that in a case of an obviously controversial change! First the message says: "Also, it is mandatory for Xserver 1.5.x" Huh? That was not mentioned in any of the discussion, what does this mean? Or was it supposed to say: "Fixes horrible performance with Xserver 1.5.x in some cases"? There is also: "and will be removed from Xserver 1.6 anyhow" Does that mean the previous code would no longer compile with 1.6? Or does it mean that the flag would be silently ignored (in which case it could be argued that it is not removed but actually a performance regression that 1.5 had is being fixed)? I think ifdeffery is overkill since we have no indication it matters on older X versions or alternative X implementations but if for example in one year someone comes and says "hey, on my OS xyz there is a problem since that flag was removed, just add it in again" the commit message has enough info so we can say "well, we will need a special case for this and that", and no the mailing list link is no good because a) there is just too much stuff in there, some theoretical discussion, some wrong stuff etc. b) it might not work anymore e.g. in one year's time. Greetings, Reimar Döffinger
Hi, On Thursday 30 October 2008 21:35, Uoti Urpala wrote:
On Thu, 2008-10-30 at 18:46 +0100, Reimar Döffinger wrote: [...]
Well, and still nobody has clearly explained the why?! So, why did you commit it? Just because a patch was sent? Or to work around buggy/slow/stupid video drivers? Or why?
Enabling backing store is apparently harmful in xserver 1.5. See http://www.nvnews.net/vbulletin/showthread.php?t=119047 (I already posted that link when it was discussed before).
But it works normally on previous version, and believe me not all people use the latest software on their desktops, even Gentoo guys 8-). I do not want to discuss if backstore is or is not a performance enhancement -- this is still questionable. But a sane solution should check a version of xserver, and only if it is >= 1.5.0 backstore should be disabled. -- Best regards, Andrew
On Fri, 2008-10-31 at 01:23 +0300, Andrew Savchenko wrote:
On Thursday 30 October 2008 21:35, Uoti Urpala wrote:
Enabling backing store is apparently harmful in xserver 1.5. See http://www.nvnews.net/vbulletin/showthread.php?t=119047 (I already posted that link when it was discussed before).
But it works normally on previous version, and believe me not all people use the latest software on their desktops, even Gentoo guys 8-).
I do not want to discuss if backstore is or is not a performance enhancement -- this is still questionable. But a sane solution should check a version of xserver, and only if it is >= 1.5.0 backstore should be disabled.
Do you have evidence that enabling backing store gives a noticeable benefit in _any_ xserver version? I've only seen evidence that it's harmful in some cases and makes no difference in others.
Hi, On Friday 31 October 2008 07:32, Uoti Urpala wrote: [...]
Do you have evidence that enabling backing store gives a noticeable benefit in _any_ xserver version?
No, but neither do you have an evidence that disabled backing store is usefull on xorg < 1.5.0. Well, there is a very little evidence that it may improve performance in some cases in the first mail of original tread in mplayer-dev ML.
I've only seen evidence that it's harmful in some cases and makes no difference in others.
It is harmful only for newer versions of xorg >= 1.5.0. We have not enough creditable data to talk about its usefullness or uselessness for older versions. Due to this fact I argue to leave things as is for old versions for safety measures and change it only for new versions of X server. IOW my proposition is just to add an appropriate configure check and #ifdef closure. I do not propose to remove this at all. -- Best regards, Andrew
On Fri, 2008-10-31 at 17:34 +0300, Andrew Savchenko wrote:
On Friday 31 October 2008 07:32, Uoti Urpala wrote:
I've only seen evidence that it's harmful in some cases and makes no difference in others.
It is harmful only for newer versions of xorg >= 1.5.0. We have not enough creditable data to talk about its usefullness or uselessness for older versions. Due to this fact I argue to leave things as is for old versions for safety measures and change it only for new versions of X server. IOW my proposition is just to add an appropriate configure check and #ifdef closure. I do not propose to remove this at all.
That's a really bad idea IMO. A version check would make the code more complex and harder to maintain (especially so when there would be no indication why or even if the complexity is needed), and the behavior of MPlayer would vary more depending on platform. If some problem does turn up it can be fixed after it occurs, with clear documentation of exactly _why_ some workaround is needed so the code can be maintained later without needing to keep something "just in case it was useful for something".
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Author: ben Date: Wed Oct 29 23:03:36 2008 New Revision: 27849
Log: Remove X11 backing store: this is now a useless flag. Also, it is mandatory for Xserver 1.5.x (part of Xorg 7.4, shipped on all Linux distributions starting from Oct. 08) and will be removed from Xserver 1.6 anyhow ...
Patch by Stephane Marchesin (marchesin at icps dot u dash strasbg dot fr).
For more info, see long flame thread at: http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-August/058323.html
Just not responding is not acceptable, even if it involves a bit of flaming. In my last mail I have asked for clarification about a few things in that commit message, if you do not answer them or someone else volunteers to improve the commit message I will revert within a few days. Greetings, Reimar Döffinger
On Sat, 2008-11-08 at 15:03 +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Just not responding is not acceptable, even if it involves a bit of flaming. In my last mail I have asked for clarification about a few things in that commit message, if you do not answer them or someone else volunteers to improve the commit message I will revert within a few days.
I agree that the commit message did not explain the rationale well. However I do not consider a revert to be an appropriate "solution" to that. IMO doing a revert would have no positive effects whatsoever while it would have negative effects (as far as I can tell not using backing store has a higher chance of working).
On Sun, Nov 09, 2008 at 02:02:23PM +0200, Uoti Urpala wrote:
On Sat, 2008-11-08 at 15:03 +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Just not responding is not acceptable, even if it involves a bit of flaming. In my last mail I have asked for clarification about a few things in that commit message, if you do not answer them or someone else volunteers to improve the commit message I will revert within a few days.
I agree that the commit message did not explain the rationale well. However I do not consider a revert to be an appropriate "solution" to that. IMO doing a revert would have no positive effects whatsoever while it would have negative effects (as far as I can tell not using backing store has a higher chance of working).
I has the advantage that we may get proper bug reports which allows recommitting with a proper commit message. That's all that is to it.
On Sun, 2008-11-09 at 13:41 +0100, Reimar Döffinger wrote:
On Sun, Nov 09, 2008 at 02:02:23PM +0200, Uoti Urpala wrote:
On Sat, 2008-11-08 at 15:03 +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag.
Just not responding is not acceptable, even if it involves a bit of flaming. In my last mail I have asked for clarification about a few things in that commit message, if you do not answer them or someone else volunteers to improve the commit message I will revert within a few days.
I agree that the commit message did not explain the rationale well. However I do not consider a revert to be an appropriate "solution" to that. IMO doing a revert would have no positive effects whatsoever while it would have negative effects (as far as I can tell not using backing store has a higher chance of working).
I has the advantage that we may get proper bug reports which allows recommitting with a proper commit message. That's all that is to it.
The link I posted earlier had as good a description of one problem case as any bugreport you're going to get (in short, xserver 1.5.0 implements backing store the same way as composite and it triggers the same problems that non-vsync-aware compositing managers have had). Also enabling backing store requires more justification than leaving it disabled, and the old change turning it on was no better documented.
On Sun, Nov 09, 2008 at 05:18:06PM +0200, Uoti Urpala wrote:
The link I posted earlier had as good a description of one problem case as any bugreport you're going to get (in short, xserver 1.5.0 implements backing store the same way as composite and it triggers the same problems that non-vsync-aware compositing managers have had).
No it is not helpful, because now we have reports that it happens _only_ with the Intel drivers on 1.5 and _not_ with NVidia drivers, that one seems to imply it happens with NVidia drivers, but it is most likely fixed with 1.5.1, so only a bug workaround, so enabling it again without additional checks would probably be okay if it ever causes an issue in the future. Lastly, in the thread you linked the same issues were reported with the 1.4 server and also with OpenGL games. So I can't see this as creating anything but more confusion, certainly not helpful information.
Also enabling backing store requires more justification than leaving it disabled, and the old change turning it on was no better documented.
And even more justification is required to apply a patch with a completely useless commit message to a completely non-understood issue. We can make this change just to try it out and because it seems likely to work better (would not be the first time), but a commit message then sure must reflect that it is "clueless" code tweaking. But lets just stop the pretenses, I just hoped that I could get someone who favours this to at least write a good commit message, since they obviously know what good it is supposed to do. Doesn't really seem to be _that_ important to anyone. I can also change it, but then don't complain that it clearly reflects my skepticism and lack of information. Greetings, Reimar Döffinger
On Sun, 2008-11-09 at 18:27 +0100, Reimar Döffinger wrote:
On Sun, Nov 09, 2008 at 05:18:06PM +0200, Uoti Urpala wrote:
The link I posted earlier had as good a description of one problem case as any bugreport you're going to get (in short, xserver 1.5.0 implements backing store the same way as composite and it triggers the same problems that non-vsync-aware compositing managers have had).
No it is not helpful, because now we have reports that it happens _only_ with the Intel drivers on 1.5 and _not_ with NVidia drivers, that one seems to imply it happens with NVidia drivers, but it is most likely fixed with
Wasn't that some separate issue? Intel drivers using blitting instead of overlay when backing store is enabled (and maybe not specific to 1.5)?
1.5.1, so only a bug workaround, so enabling it again without additional checks would probably be okay if it ever causes an issue in the future. Lastly, in the thread you linked the same issues were reported with the 1.4 server and also with OpenGL games. So I can't see this as creating anything but more confusion, certainly not helpful information.
Those 1.4/OpenGL cases were triggered by composite. Backing store causes the same issues even when composite is disabled.
Also enabling backing store requires more justification than leaving it disabled, and the old change turning it on was no better documented.
And even more justification is required to apply a patch with a completely useless commit message to a completely non-understood issue. We can make this change just to try it out and because it seems likely to work better (would not be the first time), but a commit message then sure must reflect that it is "clueless" code tweaking. But lets just stop the pretenses, I just hoped that I could get someone who favours this to at least write a good commit message, since they obviously know what good it is supposed to do. Doesn't really seem to be _that_ important to anyone.
I at least haven't considered fixing this particular commit message to be that important compared to all the other questionable things in MPlayer...
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag. Also, it is mandatory for Xserver 1.5.x (part of Xorg 7.4, shipped on all Linux distributions starting from Oct. 08) and will be removed from Xserver 1.6 anyhow ...
Suggested replacement commit message:
Do not request X11 backing store, Xorg server 1.5.0 seems to have performance and other issues with, particularly in combination with Intel drivers. While probably no other X server version is affected, backing store actually never seems to have any advantage, so disable it for now.
Provide something better or stay silent forever. I am not a fan of putting words in some other developers mouth by changing the message but I'm not going to do some extra effort to avoid that.
On Sun, 2008-11-09 at 19:36 +0100, Reimar Döffinger wrote:
Suggested replacement commit message:
Do not request X11 backing store, Xorg server 1.5.0 seems to have performance and other issues with, particularly in combination with Intel drivers.
I think it has vsync issues with any driver that has those issues when composite is enabled, at least NVIDIA (is there any driver that does _not_ have issues)?
While probably no other X server version is affected, backing store actually never seems to have any advantage, so disable it for now.
Was there any indication that the Intel-specific issue affected 1.5.0 only? I had the impression it was not 1.5.0-specific. I don't think it's necessarily worth it to verify all the details for this commit message if it'd require a lot of time though...
On Sun, Nov 09, 2008 at 07:36:24PM +0100, Reimar Döffinger wrote:
On Wed, Oct 29, 2008 at 11:03:39PM +0100, ben wrote:
Log: Remove X11 backing store: this is now a useless flag. Also, it is mandatory for Xserver 1.5.x (part of Xorg 7.4, shipped on all Linux distributions starting from Oct. 08) and will be removed from Xserver 1.6 anyhow ...
[...]
Ben, are you listening? Diego
participants (5)
-
Andrew Savchenko -
ben -
Diego Biurrun -
Reimar Döffinger -
Uoti Urpala