pixel-formats: Added pixel_format_get_info_shm() helper for printing SHM buffers

In current form SHM buffers pixel format can only be printed as 0 and 1.
With the help of this helper we align with DRM_FORMAT_ pixel format.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c
index c64a9b9..b96f3b2 100644
--- a/libweston/pixel-formats.c
+++ b/libweston/pixel-formats.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <drm_fourcc.h>
+#include <wayland-client-protocol.h>
 
 #include "helpers.h"
 #include "wayland-util.h"
@@ -376,6 +377,17 @@
 };
 
 WL_EXPORT const struct pixel_format_info *
+pixel_format_get_info_shm(uint32_t format)
+{
+	if (format == WL_SHM_FORMAT_XRGB8888)
+		return pixel_format_get_info(DRM_FORMAT_XRGB8888);
+	else if (format == WL_SHM_FORMAT_ARGB8888)
+		return pixel_format_get_info(DRM_FORMAT_ARGB8888);
+	else
+		return pixel_format_get_info(format);
+}
+
+WL_EXPORT const struct pixel_format_info *
 pixel_format_get_info(uint32_t format)
 {
 	unsigned int i;