Summary: | Color correction breaks EffectFrames | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Thomas Lübking <thomas.luebking> |
Component: | colorcorrection | Assignee: | Casian Andrei <casian> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dariocambie, kde, ku.b, kwin-bugs-null, o3827102 |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Other | ||
Latest Commit: | http://commits.kde.org/kde-workspace/6cd210f611b7527922d62bc389dfe38b49566349 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
Patch that prevents color correction from changing the blending function
For fixing the GL invalid operation Fixes the GL invalid operation Should fix the effect frames |
Description
Thomas Lübking
2012-12-07 19:22:56 UTC
nvidia blob behavior: - effect frames (for QT) don't show up at all. - after deactivating color correction, there's an opaque white rect in the upper right corner - after re-enabling color correction, the rect remains and effect frames show up, but either color inverted or at least faaar too bright (using a dark plasma theme "Opaquity", the outline is usually translucent black and now translucent white) Can you guys please inspect your ~/.xsession-errors? You'll likely find *masses* of kwin(11518) KWin::checkGLError: GL error ( PostPaint ): "GL_INVALID_OPERATION" but do you also get sth. like (the PID will oc. differ) one (or more?) kwin(6492) KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE" void ColorCorrectionPrivate::setupCCTexture(GLuint texture, const Clut& clut) glBindTexture(GL_TEXTURE_3D, texture); fails here for m_dummyCCTexture Also ::setupCCTextures is called twice. When I reenable Color Correction I get this: kwin(681) KWin::ColorServerInterface::callFinishedSlot: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kolorserver'") kwin(681): Update of color profiles failed kwin(681) KWin::ColorServerInterface::callFinishedSlot: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kolorserver'") kwin(681) KWin::ColorServerInterface::callFinishedSlot: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kolorserver'") kwin(681) KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE" and when I hit Alt+Tab, I get this: Object::connect: No such slot IconItem::implicitWidthChanged() Object::connect: (sender name: 'kwin') Object::connect: No such slot IconItem::implicitHeightChanged() Object::connect: (sender name: 'kwin') file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:173: TypeError: Result of expression 'parent.margins' [undefined] is not an object. Object::connect: No such slot IconItem::implicitWidthChanged() Object::connect: (sender name: 'kwin') Object::connect: No such slot IconItem::implicitHeightChanged() Object::connect: (sender name: 'kwin') file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:173: TypeError: Result of expression 'parent.margins' [undefined] is not an object. Object::connect: No such slot IconItem::implicitWidthChanged() Object::connect: (sender name: 'kwin') Object::connect: No such slot IconItem::implicitHeightChanged() Object::connect: (sender name: 'kwin') file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:173: TypeError: Result of expression 'parent.margins' [undefined] is not an object. Object::connect: No such slot IconItem::implicitWidthChanged() Object::connect: (sender name: 'kwin') Object::connect: No such slot IconItem::implicitHeightChanged() Object::connect: (sender name: 'kwin') file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:173: TypeError: Result of expression 'parent.margins' [undefined] is not an object. Object::connect: No such slot IconItem::implicitWidthChanged() Object::connect: (sender name: 'kwin') Object::connect: No such slot IconItem::implicitHeightChanged() Object::connect: (sender name: 'kwin') file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:107:13: QML Item: Binding loop detected for property "height" file:///home-accel/janek/.kde4/share/apps/kwin/tabbox/presentwindowsclone-opaque/contents/code/presentwindowsclone.qml:173: TypeError: Result of expression 'parent.margins' [undefined] is not an object. When I drag a window to the edges of the screen of tiling, no special message is written. @Janek Bevendorff kwin(681) KWin::ColorServerInterface::callFinishedSlot: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kolorserver'") Have you installed kolor-manager? (I will check later, I'm on another pc now) Oh, right. Stupid me. I though I had (switched distributions recently). So with kolor-manager installed, the first message does not appear. But the second bulk of messages (when invoking Alt+Tab) stays the same. Actually the only important question is whether this: kwin(681) KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE" remains. The messages of alt+tab seem some (but definitively unrelated) defects in th QML code affecting geometries, but not visuals. Strange. I just realized that the kwin(681) KWin::ColorServerInterface::callFinishedSlot: QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/modules/kolorserver'") actually isn't gone, although I have definitely installed kolor-manager. The GL_INVALID_VALUE message, though, seems to be gone. At least I can't reproduce it right now. The white boxes remain. With color correction on I get: KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE" -> Red 1.000, Green 1.000, Blue 1.000 <- Red 1.000, Green 1.000, Blue 1.000 klauncher(12433) KConfigGroup::readXdgListEntry: List entry OnlyShowIn in "/etc/xdg/autostart/gnome-screensaver.desktop" is not compliant with XDG standard (missing trailing semicolon). kded(12435) ksOyMessage: WARNING 0,180000: [-1] oyranos_monitor_x11.c:1164 oyX1Monitor_getScreenGeometry_() Xinerama request failed kded(12435) ksOyMessage: WARNING 0,180000: [-1] oyranos_monitor_x11.c:912 oyX1MonitorProfileUnset() Error getting atom "_ICC_PROFILE_1" QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. kded(12435) ksOyMessage: WARNING 0,190000: oyOptions_s[165]="oyOptions_s" oyranos_cmm_oyX1.c:875 oyX1Configs_Modify() Could not obtain _ICC_DEVICE_PROFILE(_xxx) information for :0.0 kded(12435) ksOyMessage: WARNING 0,190000: oyOptions_s[182]="oyOptions_s" oyranos_cmm_oyX1.c:875 oyX1Configs_Modify() Could not obtain _ICC_PROFILE(_xxx) information for :0.0 QDBusObjectPath: invalid path "" sh: 1: xcalib: not found kded(12435) ksOyMessage: WARNING 0,220000: [-1] oyranos_monitor_x11.c:767 oyX1MonitorProfileSetup() No monitor gamma curves by profile: CMO-5926-_edid.icc kded(12435) ksOyMessage: WARNING 0,220000: [-1] oyranos_monitor_x11.c:837 oyX1MonitorProfileSetup() found issues bytes_after_return: 1 ImageProvider supports Pixmap type but has not implemented requestPixmap() on kwin startup (if color correction is enabled), or as soon as color correction is enabled (when disabled at startup). (I've now installed xcalib to remove the "xcalib: not found" part, but nothing significant changed) No errors shown at Alt-tab, neither in kwin output nor in .xsession-errors (other then the QML one, on the first alt-tab) > KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE"
This alone means that setting up the (dummy, i presume. it's at least here) texture fails, so it's further usage in the shaders isn't safe, esp. since apparently binding it seems to fail with invalid value, actually implying a non glGenTextures created ID - what does not seem the case here, though (no error on glGenTex and the values match)
Another funny thing is that it sometimes(?) creates two dummy textures (there're two screens, but one's disabled) and the second one does not cause this, yet i get masses of "GL_INVALID_OPERATION" for PostPaint related to the color correction
Sorry for late reply, I was offline since Friday. Currently I have been able only to quickly read the above comments. My first impression is that there might be some issue for some drivers regarding 3D textures, which triggers that invalid operation, which is not handled correctly within the color correction code. So, I think it would be useful to identify for which drivers or hardware this is happening. And the code should handle the error properly, so when there is a gl invalid operation over there, color correction needs to be immediately disabled without ugly side effects. So, kwin(6492) KWin::checkGLError: GL error ( setupCCTexture ): "GL_INVALID_VALUE" should be treated properly in the code. @ kwinglcolorcorrection.cpp:562 -> // TODO Handle errors (what if a texture isn't generated?) checkGLError("setupCCTextures"); Ok, this obviously needs to be implemented - I will try to do so during this weekend, and then we should see if the bug still persists after that. janek: OpenGL vendor string: nouveau OpenGL renderer string: Gallium 0.4 on NV92 OpenGL version string: 3.0 Mesa 8.1-devel (git-4f109ca) OpenGL shading language version string: 1.30 dario: OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile OpenGL version string: 3.0 Mesa 9.0 OpenGL shading language version string: 1.30 Driver: Intel GPU class: SandyBridge OpenGL version: 3.0 GLSL version: 1.30 Mesa version: 9.0 thomas: nvidia blob 3.10.19 / mesa 9.01 that's pretty much "all but ati" and 3d textures are supported here... (otherwise) Makes sense, I only tested with ati and mesa 7 and 9, with the open source driver. This means that there is something wrong with the way the code attempts to use the 3d textures, and it works accidentally on ati stuff. :( Yep, I just changed Nouveau for the NVIDIA Blob and the problem still persists. Here a possibly related change inside the Oyranos/KolorServer stack. A fix for XRandR with Xinerama setups is now in Oyranos git cmake branch, which affects KolorServer: http://www.oyranos.org/scm?p=oyranos.git;a=commit;h=a4f157beb6c60855f64d011cb2ad2f93071da461 I am quite astonished to not have seen the XRandR bug n Oyranos earlier. Anyway, the changes are tested with intel and works as usual with the nvidia driver for dual screens. However, I've not yet seen the above mentioned GL errors. Investigated a bit today and that gl invalid operation shows up for me too. So, it might not be the cause of the problem. At least I can track down and get rid of it. I tried implementing the error handling today but eventually I got a bit stuck with a crash and had no time to investigate that, for now. I wonder whether that XRandR bug is the cause of this bug :-?? Anyway, more investigating is needed. Created attachment 75858 [details]
Patch that prevents color correction from changing the blending function
This might change the observed behavior and indicate whether there is a problem with the blending function being changed by the color correction.
Created attachment 75860 [details]
For fixing the GL invalid operation
This fixes the GL invalid operation, but most likely this is not causing the problems. You need to apply it before the 0001 patch.
For me with patch attached (order 0002 then 0001) the problem of white windows in Alt+tab is still there, the GL-ERROR no more. Furthermore when enabling the color correction the shadow around the windows became "strange" (will attach a screenshot soon). Oh, and I get different errors in the console running "kwin --replace" KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: X_GetGeometry[14]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: RenderCreatePicture[RENDER+4]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: X_GetGeometry[14]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: RenderCreatePicture[RENDER+4]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: X_GetGeometry[14]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDrawable [9], request: RenderCreatePicture[RENDER+4]" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDamage [DAMAGE+0], request: XDamageDestroy[DAMAGE+2], resource: 0x380006c" ) kwin(2574) KWin::x11ErrorHandler: kwin: X Error ( "error: BadDamage [DAMAGE+0], request: XDamageDestroy[DAMAGE+2], resource: 0x38000af" ) And ~/.xsession-errors with *tons* (currently >100MBof Using fd 4Error opening terminal: unknown. (ops, sorry errors in .xsession-errors were unrelated, my own fault) The strange shadow around the windows is to be expected with that patch applied, although I currently do not know why it happens :( . So, you should remove the 001 patch if it did not fix anything. And those errors from kwin --replace I get them too, I don't think they are related to our issue. So the problem is more complicated, I need to read the code next week and figure out what are the effect frames about and how they work, and then try to see what is happening. A couple of screenshots would be awesome :) . Couldn't attach screenshots due to file size limit (1000kb, png screenshot being 1,8MB ca), so here they are: http://dl.dropbox.com/u/905879/varie/screenshots.zip Thanks for the screenshots! Now I have a much better idea of what is happening. I think I saw this a couple of times when I was writing the code but I forgot to investigate :( Created attachment 76195 [details]
Fixes the GL invalid operation
Updated fix, needed for the premultiplied alpha issue patch.
Created attachment 76196 [details] Should fix the effect frames There was an issue with the premultipled alpha when color correcting. It should have been obvious... See https://git.reviewboard.kde.org/r/108189/ This patch should be applied after 76195 ("Fixes the GL invalid operation") The two patches fix the problem for me. Thanks :) Git commit 6cd210f611b7527922d62bc389dfe38b49566349 by Casian Andrei. Committed on 05/01/2013 at 04:39. Pushed by casianandrei into branch 'master'. Fix premultiplied alpha issue with color correction When correcting a color that was with premultiplied alpha, the alpha value was not multiplied back again as a final step. This was breaking color correction when the blend function was GL_ONE, GL_ONE_MINUS_SRC_ALPHA. The blend function was changed for normal windows (a workaround), but not for effect frames, i.e. the effect frames were broken with color correction enabled. Removes the blend function workaround. Removes a useless setupForOutput. REVIEW: 108189 M +1 -1 kwin/libkwineffects/kwinglcolorcorrection.cpp M +4 -10 kwin/scene_opengl.cpp http://commits.kde.org/kde-workspace/6cd210f611b7527922d62bc389dfe38b49566349 |