Simplify (or get rid of) previous surface pixmap tracking
Every surface item has the current and the previous pixmap. The reason why there's previous pixmap is twofold - it used to serve as an implementation detail of cross-fading (since we have sub-surfaces on wayland, it's not suitable anymore) and handling weird async issues on X11 (kwin can configure a window, but the server side geometry can still differ). On Wayland, surface pixmap tracking doesn't have to be so complex, we just need to know the current pixmap, that's it. Another potential issue is that kwin can hold more than 2 buffers at a time, some apps don't like it even though kwin doesn't do anything wrong per se.
Regardless, it's a good idea to simplify the previous surface pixmap tracking or maybe remove it completely in the surface item and make it an implementation detail of SurfaceItemX11.