From: Matthias Clasen Date: Fri, 1 Apr 2016 00:31:00 +0000 (-0400) Subject: wayland: Print out more debug info X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~5038 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4c698bc82418f43076320819cdbb5af9ffd00e50;p=gtk4.git wayland: Print out more debug info Print out the subpixel layout and frame rates that the compositor sends us. --- diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c index f1db311d53..f7569cb1f5 100644 --- a/gdk/wayland/gdkscreen-wayland.c +++ b/gdk/wayland/gdkscreen-wayland.c @@ -1075,6 +1075,56 @@ update_screen_size (GdkWaylandScreen *screen_wayland) g_signal_emit_by_name (screen_wayland, "size-changed"); } +#ifdef G_ENABLE_DEBUG + +static const char * +subpixel_to_string (int layout) +{ + int i; + struct { int layout; const char *name; } layouts[] = { + { WL_OUTPUT_SUBPIXEL_UNKNOWN, "unknown" }, + { WL_OUTPUT_SUBPIXEL_NONE, "none" }, + { WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB, "rgb" }, + { WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR, "bgr" }, + { WL_OUTPUT_SUBPIXEL_VERTICAL_RGB, "vrgb" }, + { WL_OUTPUT_SUBPIXEL_VERTICAL_BGR, "vbgr" }, + { 0xffffffff, NULL } + }; + + for (i = 0; layouts[i].name; i++) + { + if (layouts[i].layout == layout) + return layouts[i].name; + } + return NULL; +} + +static const char * +transform_to_string (int transform) +{ + int i; + struct { int transform; const char *name; } transforms[] = { + { WL_OUTPUT_TRANSFORM_NORMAL, "normal" }, + { WL_OUTPUT_TRANSFORM_90, "90" }, + { WL_OUTPUT_TRANSFORM_180, "180" }, + { WL_OUTPUT_TRANSFORM_270, "270" }, + { WL_OUTPUT_TRANSFORM_FLIPPED, "flipped" }, + { WL_OUTPUT_TRANSFORM_FLIPPED_90, "flipped 90" }, + { WL_OUTPUT_TRANSFORM_FLIPPED_180, "flipped 180" }, + { WL_OUTPUT_TRANSFORM_FLIPPED_270, "flipped 270" }, + { 0xffffffff, NULL } + }; + + for (i = 0; transforms[i].name; i++) + { + if (transforms[i].transform == transform) + return transforms[i].name; + } + return NULL; +} + +#endif + static void output_handle_geometry (void *data, struct wl_output *wl_output, @@ -1090,8 +1140,8 @@ output_handle_geometry (void *data, GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data; GDK_NOTE (MISC, - g_message ("handle geometry output %d, position %d %d, phys. size %d %d, manufacturer %s, model %s", - monitor->id, x, y, physical_width, physical_height, make, model)); + g_message ("handle geometry output %d, position %d %d, phys. size %d %d, subpixel layout %s, manufacturer %s, model %s, transform %s", + monitor->id, x, y, physical_width, physical_height, subpixel_to_string (subpixel), make, model, transform_to_string (transform))); monitor->geometry.x = x; monitor->geometry.y = y;