drm: Finally retire struct drm_format_name_buf
Subsystems (3)
Thomas Zimmermann
maintainercover drm: Finally retire struct drm_format_name_buf
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/[email protected]/
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
maintainerPATCH 1/4 drm/amdgpu: Use %p4cc to print 4CC format
Replace use of struct drm_format_name_buf with %p4cc for printing 4CC formats.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -5
@@ -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;
Signature · 1 line
2.31.1
Re: [PATCH 1/4] drm/amdgpu: Use %p4cc to print 4CC format
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
Quoted 4 lines
Replace use of struct
drm_format_name_bufwith %p4cc for printing 4CC formats.Signed-off-by Thomas Zimmermann <[email protected]>
Quoted 13 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0
-1@@ -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;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c int amdgpu_display_gem_fb_verify_and_init( · line 1085
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2
-4drm_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;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thomas Zimmermann
maintainerPATCH 2/4 drm/simpledrm: Use %p4cc to print 4CC format
In reply to Thomas ZimmermannReplace use of struct drm_format_name_buf with %p4cc for printing 4CC formats.
--- drivers/gpu/drm/tiny/simpledrm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/tiny/simpledrm.c +2 -4
@@ -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 ; }
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thomas Zimmermann
maintainerPATCH 3/4 drm: Remove drm_get_format_name()
In reply to Thomas ZimmermannFrom: Sakari Ailus <[email protected]>
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.
--- drivers/gpu/drm/drm_fourcc.c | 25 ------------------------- include/drm/drm_fourcc.h | 1 - 2 files changed, 26 deletions(-)
drivers/gpu/drm/drm_fourcc.c +0 -25
@@ -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.
include/drm/drm_fourcc.h +0 -1
@@ -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__ */
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thomas Zimmermann
maintainerPATCH 4/4 drm/fourcc: Remove struct drm_format_buf_name
In reply to Thomas ZimmermannThe structure is unused. Remove it.
--- include/drm/drm_fourcc.h | 8 -------- 1 file changed, 8 deletions(-)
include/drm/drm_fourcc.h +0 -8
@@ -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
Signature · 6 lines
2.31.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thomas Zimmermann
maintainerping for further a-bs / r-bs
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
Quoted 26 lines
This is a cleanup patchset to remove
drm_format_name_bufet 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 structdrm_format_name_buf.I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/[email protected]/
Sakari Ailus (1):
drm: Removedrm_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 structdrm_format_buf_namedrivers/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
Signature · 6 lines
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
Sakari Ailus
Reviewed-byQuoted 1 line · Thomas Zimmermann
ping for further a-bs / r-bs
Thanks for the ping.
For the series:
Quoted 29 lines
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
Quoted 26 lines
This is a cleanup patchset to remove
drm_format_name_bufet 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 structdrm_format_name_buf.I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/[email protected]/
Sakari Ailus (1):
drm: Removedrm_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 structdrm_format_buf_namedrivers/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
Signature · 1 line
Sakari Ailus
Alex Deucher
Acked-byfor the amdgpu changes.
Quoted 31 lines · Thomas Zimmermann
ping for further a-bs / r-bs
Am 16.05.21 um 14:13 schrieb Thomas Zimmermann:
Quoted 17 lines
This is a cleanup patchset to remove
drm_format_name_bufet 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 structdrm_format_name_buf.I built-tested with drm-tip. The patchsetcan be mered through drm-misc.
[1] https://lore.kernel.org/dri-devel/[email protected]/
Sakari Ailus (1):
drm: Removedrm_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 structdrm_format_buf_nameQuoted 9 lines
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
Quoted 8 lines
--
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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx