dmabuf: Unify initialization debug messages
... and print if a format is advertised. We now use the same style of message and use the term "advertise" for formats that will be available via GdkDisplay::dmabuf-formats and "supports" for formats the backend pretends it can handle but don't want to advertise them.
This commit is contained in:
@@ -2002,7 +2002,7 @@ gdk_display_init_dmabuf (GdkDisplay *self)
|
||||
self->dmabuf_formats = gdk_dmabuf_formats_builder_free_to_formats (builder);
|
||||
|
||||
GDK_DISPLAY_DEBUG (self, DMABUF,
|
||||
"Initialized support for %zu dmabuf formats",
|
||||
"Initialization finished. Advertising %zu dmabuf formats",
|
||||
gdk_dmabuf_formats_get_n_formats (self->dmabuf_formats));
|
||||
}
|
||||
|
||||
|
@@ -2068,7 +2068,7 @@ gdk_dmabuf_get_mmap_formats (void)
|
||||
continue;
|
||||
|
||||
GDK_DEBUG (DMABUF,
|
||||
"mmap dmabuf format %.4s:%#0" G_GINT64_MODIFIER "x",
|
||||
"mmap advertises dmabuf format %.4s::%016" G_GINT64_MODIFIER "x",
|
||||
(char *) &supported_formats[i].fourcc, (guint64) DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
gdk_dmabuf_formats_builder_add_format (builder,
|
||||
|
@@ -94,20 +94,22 @@ gdk_dmabuf_egl_downloader_collect_formats (GdkDisplay *display,
|
||||
|
||||
for (int j = 0; j < num_modifiers; j++)
|
||||
{
|
||||
/* All linear formats we support are already added my the mmap downloader.
|
||||
/* All linear formats we support are already advertised by the mmap downloader.
|
||||
* We don't add external formats, unless we can use them (via GLES)
|
||||
*/
|
||||
gboolean advertise = modifiers[j] != DRM_FORMAT_MOD_LINEAR &&
|
||||
(!external_only[j] || gdk_gl_context_get_use_es (context));
|
||||
|
||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||
"EGL supports %s dmabuf format %.4s:%#" G_GINT64_MODIFIER "x",
|
||||
"EGL %s %sdmabuf format %.4s::%016" G_GINT64_MODIFIER "x",
|
||||
advertise ? "advertises" : "supports",
|
||||
external_only[j] ? "external " : "",
|
||||
(char *) &fourccs[i],
|
||||
modifiers[j]);
|
||||
|
||||
if (modifiers[j] != DRM_FORMAT_MOD_LINEAR &&
|
||||
(!external_only[j] || gdk_gl_context_get_use_es (context)))
|
||||
{
|
||||
gdk_dmabuf_formats_builder_add_format (formats, fourccs[i], modifiers[j]);
|
||||
}
|
||||
if (advertise)
|
||||
gdk_dmabuf_formats_builder_add_format (formats, fourccs[i], modifiers[j]);
|
||||
|
||||
if (!external_only[j])
|
||||
{
|
||||
gdk_dmabuf_formats_builder_add_format (internal, fourccs[i], modifiers[j]);
|
||||
|
@@ -1911,19 +1911,20 @@ gdk_vulkan_init_dmabuf (GdkDisplay *display)
|
||||
g_warn_if_fail (modifier_props.drmFormatModifierCount < sizeof (modifier_list));
|
||||
for (j = 0; j < modifier_props.drmFormatModifierCount; j++)
|
||||
{
|
||||
gboolean advertise = modifier_list[j].drmFormatModifier != DRM_FORMAT_MOD_LINEAR;
|
||||
|
||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||
"Vulkan supports dmabuf format %.4s::%016llx with %u planes and features 0x%x",
|
||||
"Vulkan %s dmabuf format %.4s::%016"G_GINT64_MODIFIER"x with %u planes and features 0x%x",
|
||||
advertise ? "advertises" : "supports",
|
||||
(char *) &fourcc,
|
||||
(long long unsigned) modifier_list[j].drmFormatModifier,
|
||||
modifier_list[j].drmFormatModifier,
|
||||
modifier_list[j].drmFormatModifierPlaneCount,
|
||||
modifier_list[j].drmFormatModifierTilingFeatures);
|
||||
|
||||
if (modifier_list[j].drmFormatModifier == DRM_FORMAT_MOD_LINEAR)
|
||||
continue;
|
||||
|
||||
gdk_dmabuf_formats_builder_add_format (vulkan_builder,
|
||||
fourcc,
|
||||
modifier_list[j].drmFormatModifier);
|
||||
if (advertise)
|
||||
gdk_dmabuf_formats_builder_add_format (vulkan_builder,
|
||||
fourcc,
|
||||
modifier_list[j].drmFormatModifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user