By introducing a BufferImpl that handles the buffer
allocation/de-allocation bits and making the driver responsible for
creating the correct impl.
This allow moving various Buffer specific vfuncs from Driver as well as
getting rid of the gl_handle field from Buffer.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4181>
Currently, we cast the CoglXlibRenderer pointer into a CoglX11Renderer
which is something that we would get rid of later on, along with the
usage of a data field once the Renderers become a subtypes of
CoglRenderer.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4187>
As they are no longer used separately by the GL3/GLES2 drivers.
The remaining Buffer/Texture/Attribute/Clip stack helpers are kept in
separate files as they are complex and are probably better kept split.
Further cleanups might be done in future commits.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4132>
As they are now shared between GL3 and GLES3 texture driver, there is no
need anymore for having them in a separate header and included.
Cleanup the names of the functions while doing so.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4163>
Abstract away the common bits between GL3 and GLES2 TextureDriver
implementations by sharing the common bits in a parent class.
Ideally, we would move the various vfuncs that are GL specific from the
abstract TextureDriver type but that can be done at a later stage once
there is actual work on adding a Vulkan driver.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4163>
As they make more sense there. Maybe we could have a common
OpenGLTextureDriver
that would share the common texture_2d_* vfuncs but that can be done
later.
By moving those vfuncs to the TextureDriver, we can get rid of the
texutre_2d
nop driver implementations.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4163>
SwapBuffers will implicitly flush the query along with the other GPU
work for the frame.
The comment was about this function being called for direct scanout,
which hasn't been the case since 56580ea7c941 ("backends/native: Assume
zero rendering time for direct scanout buffers").
This eliminates one GPU work flush to the kernel per frame with the
Mesa radeonsi driver, leaving only a single flush per frame.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4158>
Indirectly via cogl_framebuffer_flush, since we also need to call
glFlush now. Need to do it in cogl_onscreen_egl_swap_* because
meta_onscreen_native_swap_buffers_with_damage uses
cogl_context_get_latest_sync_fd.
Doing it before the swap was problematic because the swap may do GPU
work of its own, which wasn't covered by the EGL sync object created in
_cogl_context_update_sync. This could result in visual artifacts. See
the discussion starting at
https://gitlab.freedesktop.org/mesa/mesa/-/issues/11996#note_2678104 for
details.
For similar reasons, move the cogl_framebuffer_finish calls after the
swap as well.
As a bonus, this eliminates one of 3 GPU work flushes to the kernel per
frame with the Mesa radeonsi driver, because the glFlush/glFinish call
in cogl_framebuffer_flush/finish doesn't have any GPU work to flush
after SwapBuffers.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4158>
This makes DMA buffer allocation in all layers take an array of possible
modifiers to allocate using, or zero modifiers if implicit modifiers
should be used.
The format hard coding previously used is moved to the screen cast code,
or in case of the (unused by default) shadow buffer buffers use the same
format as the the CoglOnscreen.
This also means the CoglDmaBufHandle and MetaDrmBuffer got taught how to
distinguish between planes. It's mostly unused in practice, so rather
untested.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3900>
It's only implemented by the GBM render device backend, and uses EGL,
thus does not distinguish scanout capable modifiers.
A filter enum is added to Cogl, since it'll be used via the Cogl API,
but the actual Cogl API isn't added yet.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3900>
The cogl_scanout_get_dst_rect() fell back on the buffer dimensions as
the destination rectangle when nothing was explicitly set. This,
however, is not necessarily correct. For example, if a buffer is larger
the CRTC resolution, but the surface is scaled to exactly match the CRTC view,
the expected destination size should match the CRTC resolution, not the
buffer dimension, which would be the case if no explicit destination was
set.
In meta_wayland_try_aquire_scanout() we're in a good position to
determine the destination rect in the CRTC primary plane, since we have
all the prerequisits, i.e. that the surface effectively covers the whole
CRTC, the actor allocation box (the non-black border part), the scale
and transform of the view.
This tweaks the CoglScanout API a bit to make it explicit that the
dst_rect must be unconditionally provided, and removes the fallback to
the buffer dimension as the destination rectangle, which sometimes
resulted in a destination rectangle being larger than the primary plane
itself, resulting in clipping and incorrect scaling.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3773
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4147>
In try_create_context(), if COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT
is set, don't try to choose an egl config.
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4088>