OSDN Git Service

drm: Remove drm_get_format_name()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Sun, 16 May 2021 12:13:14 +0000 (14:13 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 27 May 2021 06:34:50 +0000 (08:34 +0200)
The %p4cc printk format modifier was recently added to print fourcc codes,
replacing drm_get_format_name(). The function is no longer needed, so
remove it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210516121315.30321-4-tzimmermann@suse.de
drivers/gpu/drm/drm_fourcc.c
include/drm/drm_fourcc.h

index 0326247..5cf45aa 100644 (file)
 #include <drm/drm_device.h>
 #include <drm/drm_fourcc.h>
 
-static char printable_char(int c)
-{
-       return isascii(c) && isprint(c) ? c : '?';
-}
-
 /**
  * drm_mode_legacy_fb_format - compute drm fourcc code from legacy description
  * @bpp: bits per pixels
@@ -130,26 +125,6 @@ uint32_t drm_driver_legacy_fb_format(struct drm_device *dev,
 }
 EXPORT_SYMBOL(drm_driver_legacy_fb_format);
 
-/**
- * drm_get_format_name - fill a string with a drm fourcc format's name
- * @format: format to compute name of
- * @buf: caller-supplied buffer
- */
-const char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf)
-{
-       snprintf(buf->str, sizeof(buf->str),
-                "%c%c%c%c %s-endian (0x%08x)",
-                printable_char(format & 0xff),
-                printable_char((format >> 8) & 0xff),
-                printable_char((format >> 16) & 0xff),
-                printable_char((format >> 24) & 0x7f),
-                format & DRM_FORMAT_BIG_ENDIAN ? "big" : "little",
-                format);
-
-       return buf->str;
-}
-EXPORT_SYMBOL(drm_get_format_name);
-
 /*
  * Internal function to query information for a given format. See
  * drm_format_info() for the public API.
index 156b122..3ea17b8 100644 (file)
@@ -318,6 +318,5 @@ unsigned int drm_format_info_block_height(const struct drm_format_info *info,
                                          int plane);
 uint64_t drm_format_info_min_pitch(const struct drm_format_info *info,
                                   int plane, unsigned int buffer_width);
-const char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf);
 
 #endif /* __DRM_FOURCC_H__ */