onscreen/native: Prefer gbm_surface_create_with_modifiers even for linear
The Nvidia driver doesn't implement `gbm_surface_create` properly, which was first mentioned in 9fee3a9ec1. So using `gbm_surface_create` as a fallback for the linear case was failing with ENOSYS (Function not implemented). Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3918 Fixes: 163520c177 ("onscreen/native: Do not use modifiers if surface should be sharable") See also: https://forums.developer.nvidia.com/t/gbm-surface-create-fails-if-flags-0/279951 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4284>
This commit is contained in:
parent
db955eccc7
commit
045342eb5a
@ -2407,11 +2407,23 @@ create_surfaces_gbm (CoglOnscreen *onscreen,
|
|||||||
cogl_renderer_egl->edpy,
|
cogl_renderer_egl->edpy,
|
||||||
egl_config);
|
egl_config);
|
||||||
|
|
||||||
if (!should_be_sharable &&
|
if (meta_renderer_native_use_modifiers (renderer_native))
|
||||||
meta_renderer_native_use_modifiers (renderer_native))
|
{
|
||||||
modifiers = get_supported_modifiers (onscreen, format);
|
if (should_be_sharable)
|
||||||
|
{
|
||||||
|
modifiers = g_array_sized_new (FALSE, FALSE, sizeof (uint64_t), 1);
|
||||||
|
g_array_set_size (modifiers, 1);
|
||||||
|
((uint64_t *) modifiers->data)[0] = DRM_FORMAT_MOD_LINEAR;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
modifiers = get_supported_modifiers (onscreen, format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
modifiers = NULL;
|
modifiers = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (modifiers)
|
if (modifiers)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user