This is a cleanup patchset to remove drm_format_name_buf et al. There are two instances in drivers that need to be replaced with the %4cc printk format modifier. Patch 3 was left over back from an earlier patchset. [1] Patch 4 removes struct drm_format_name_buf.
I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/20210216155723.17109-1-sakari.ailus@linux....
Sakari Ailus (1): drm: Remove drm_get_format_name()
Thomas Zimmermann (3): drm/amdgpu: Use %p4cc to print 4CC format drm/simpledrm: Use %p4cc to print 4CC format drm/fourcc: Remove struct drm_format_buf_name
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++---- drivers/gpu/drm/drm_fourcc.c | 25 --------------------- drivers/gpu/drm/tiny/simpledrm.c | 6 ++--- include/drm/drm_fourcc.h | 9 -------- 4 files changed, 4 insertions(+), 43 deletions(-)
-- 2.31.1
Replace use of struct drm_format_name_buf with %p4cc for printing 4CC formats.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 8a1fb8b6606e..49f73b5b89b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -1077,12 +1077,9 @@ int amdgpu_display_gem_fb_verify_and_init( /* Verify that the modifier is supported. */ if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format, mode_cmd->modifier[0])) { - struct drm_format_name_buf format_name; drm_dbg_kms(dev, - "unsupported pixel format %s / modifier 0x%llx\n", - drm_get_format_name(mode_cmd->pixel_format, - &format_name), - mode_cmd->modifier[0]); + "unsupported pixel format %p4cc / modifier 0x%llx\n", + &mode_cmd->pixel_format, mode_cmd->modifier[0]);
ret = -EINVAL; goto err;
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
Replace use of struct drm_format_name_buf with %p4cc for printing 4CC formats.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de
Acked-by: Christian König christian.koenig@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 8a1fb8b6606e..49f73b5b89b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -1077,12 +1077,9 @@ int amdgpu_display_gem_fb_verify_and_init( /* Verify that the modifier is supported. */ if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format, mode_cmd->modifier[0])) {
drm_dbg_kms(dev,struct drm_format_name_buf format_name;
"unsupported pixel format %s / modifier 0x%llx\n",
drm_get_format_name(mode_cmd->pixel_format,
&format_name),
mode_cmd->modifier[0]);
"unsupported pixel format %p4cc / modifier 0x%llx\n",
&mode_cmd->pixel_format, mode_cmd->modifier[0]);
ret = -EINVAL; goto err;
Replace use of struct drm_format_name_buf with %p4cc for printing 4CC formats.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- drivers/gpu/drm/tiny/simpledrm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simpledrm.c index ed40dde4d218..2defd5cc6c99 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -466,7 +466,6 @@ static int simpledrm_device_init_fb(struct simpledrm_device *sdev) { int width, height, stride; const struct drm_format_info *format; - struct drm_format_name_buf buf; struct drm_device *dev = &sdev->dev; struct platform_device *pdev = sdev->pdev; const struct simplefb_platform_data *pd = dev_get_platdata(&pdev->dev); @@ -510,9 +509,8 @@ static int simpledrm_device_init_fb(struct simpledrm_device *sdev) drm_dbg_kms(dev, "display mode={" DRM_MODE_FMT "}\n", DRM_MODE_ARG(&sdev->mode)); drm_dbg_kms(dev, - "framebuffer format="%s", size=%dx%d, stride=%d byte\n", - drm_get_format_name(format->format, &buf), width, - height, stride); + "framebuffer format=%p4cc, size=%dx%d, stride=%d byte\n", + &format->format, width, height, stride);
return 0; }
From: Sakari Ailus sakari.ailus@linux.intel.com
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 Reviewed-by: Petr Mladek pmladek@suse.com Reviewed-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- drivers/gpu/drm/drm_fourcc.c | 25 ------------------------- include/drm/drm_fourcc.h | 1 - 2 files changed, 26 deletions(-)
diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 03262472059c..5cf45aa6eedc 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -30,11 +30,6 @@ #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. diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 156b122c0ad5..3ea17b8a79d3 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -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__ */
The structure is unused. Remove it.
Signed-off-by: Thomas Zimmermann tzimmermann@suse.de --- include/drm/drm_fourcc.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 3ea17b8a79d3..3b138d4ae67e 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -135,14 +135,6 @@ struct drm_format_info { bool is_yuv; };
-/** - * struct drm_format_name_buf - name of a DRM format - * @str: string buffer containing the format name - */ -struct drm_format_name_buf { - char str[32]; -}; - /** * drm_format_info_is_yuv_packed - check that the format info matches a YUV * format with data laid in a single plane
ping for further a-bs / r-bs
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
This is a cleanup patchset to remove drm_format_name_buf et al. There are two instances in drivers that need to be replaced with the %4cc printk format modifier. Patch 3 was left over back from an earlier patchset. [1] Patch 4 removes struct drm_format_name_buf.
I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/20210216155723.17109-1-sakari.ailus@linux....
Sakari Ailus (1): drm: Remove drm_get_format_name()
Thomas Zimmermann (3): drm/amdgpu: Use %p4cc to print 4CC format drm/simpledrm: Use %p4cc to print 4CC format drm/fourcc: Remove struct drm_format_buf_name
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++---- drivers/gpu/drm/drm_fourcc.c | 25 --------------------- drivers/gpu/drm/tiny/simpledrm.c | 6 ++--- include/drm/drm_fourcc.h | 9 -------- 4 files changed, 4 insertions(+), 43 deletions(-)
-- 2.31.1
On Wed, May 26, 2021 at 09:21:10PM +0200, Thomas Zimmermann wrote:
ping for further a-bs / r-bs
Thanks for the ping.
For the series:
Reviewed-by: Sakari Ailus sakari.ailus@linux.intel.com
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
This is a cleanup patchset to remove drm_format_name_buf et al. There are two instances in drivers that need to be replaced with the %4cc printk format modifier. Patch 3 was left over back from an earlier patchset. [1] Patch 4 removes struct drm_format_name_buf.
I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/20210216155723.17109-1-sakari.ailus@linux....
Sakari Ailus (1): drm: Remove drm_get_format_name()
Thomas Zimmermann (3): drm/amdgpu: Use %p4cc to print 4CC format drm/simpledrm: Use %p4cc to print 4CC format drm/fourcc: Remove struct drm_format_buf_name
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++---- drivers/gpu/drm/drm_fourcc.c | 25 --------------------- drivers/gpu/drm/tiny/simpledrm.c | 6 ++--- include/drm/drm_fourcc.h | 9 -------- 4 files changed, 4 insertions(+), 43 deletions(-)
-- 2.31.1
Acked-by: Alex Deucher alexander.deucher@amd.com for the amdgpu changes.
On Wed, May 26, 2021 at 3:21 PM Thomas Zimmermann tzimmermann@suse.de wrote:
ping for further a-bs / r-bs
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
This is a cleanup patchset to remove drm_format_name_buf et al. There are two instances in drivers that need to be replaced with the %4cc printk format modifier. Patch 3 was left over back from an earlier patchset. [1] Patch 4 removes struct drm_format_name_buf.
I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/20210216155723.17109-1-sakari.ailus@linux....
Sakari Ailus (1): drm: Remove drm_get_format_name()
Thomas Zimmermann (3): drm/amdgpu: Use %p4cc to print 4CC format drm/simpledrm: Use %p4cc to print 4CC format drm/fourcc: Remove struct drm_format_buf_name
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++---- drivers/gpu/drm/drm_fourcc.c | 25 --------------------- drivers/gpu/drm/tiny/simpledrm.c | 6 ++--- include/drm/drm_fourcc.h | 9 -------- 4 files changed, 4 insertions(+), 43 deletions(-)
-- 2.31.1
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
dri-devel@lists.freedesktop.org