]> Gentwo Git Trees - linux/.git/commitdiff
drm/format-helper: Remove drm_fb_blit()
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 18 Sep 2025 15:39:51 +0000 (17:39 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 23 Sep 2025 13:06:06 +0000 (15:06 +0200)
The function is unused; remove it.

Instead of relying on a general blit helper, drivers should pick a blit
function by themselves from their list of supported color formats.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250918154207.84714-4-tzimmermann@suse.de
drivers/gpu/drm/drm_format_helper.c
include/drm/drm_format_helper.h

index 006836554cc2fefa357562d9162ccd66ffc3425a..6cddf05c493bd5bf8adec5ba8fb47e3fc457dd16 100644 (file)
@@ -1165,97 +1165,6 @@ void drm_fb_argb8888_to_argb4444(struct iosys_map *dst, const unsigned int *dst_
 }
 EXPORT_SYMBOL(drm_fb_argb8888_to_argb4444);
 
-/**
- * drm_fb_blit - Copy parts of a framebuffer to display memory
- * @dst:       Array of display-memory addresses to copy to
- * @dst_pitch: Array of numbers of bytes between the start of two consecutive scanlines
- *             within @dst; can be NULL if scanlines are stored next to each other.
- * @dst_format:        FOURCC code of the display's color format
- * @src:       The framebuffer memory to copy from
- * @fb:                The framebuffer to copy from
- * @clip:      Clip rectangle area to copy
- * @state: Transform and conversion state
- *
- * This function copies parts of a framebuffer to display memory. If the
- * formats of the display and the framebuffer mismatch, the blit function
- * will attempt to convert between them during the process. The parameters @dst,
- * @dst_pitch and @src refer to arrays. Each array must have at least as many
- * entries as there are planes in @dst_format's format. Each entry stores the
- * value for the format's respective color plane at the same index.
- *
- * This function does not apply clipping on @dst (i.e. the destination is at the
- * top-left corner).
- *
- * Returns:
- * 0 on success, or
- * -EINVAL if the color-format conversion failed, or
- * a negative error code otherwise.
- */
-int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format,
-               const struct iosys_map *src, const struct drm_framebuffer *fb,
-               const struct drm_rect *clip, struct drm_format_conv_state *state)
-{
-       uint32_t fb_format = fb->format->format;
-
-       if (fb_format == dst_format) {
-               drm_fb_memcpy(dst, dst_pitch, src, fb, clip);
-               return 0;
-       } else if (fb_format == (dst_format | DRM_FORMAT_BIG_ENDIAN)) {
-               drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state);
-               return 0;
-       } else if (fb_format == (dst_format & ~DRM_FORMAT_BIG_ENDIAN)) {
-               drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state);
-               return 0;
-       } else if (fb_format == DRM_FORMAT_XRGB8888) {
-               if (dst_format == DRM_FORMAT_RGB565) {
-                       drm_fb_xrgb8888_to_rgb565(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_XRGB1555) {
-                       drm_fb_xrgb8888_to_xrgb1555(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_ARGB1555) {
-                       drm_fb_xrgb8888_to_argb1555(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_RGBA5551) {
-                       drm_fb_xrgb8888_to_rgba5551(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_RGB888) {
-                       drm_fb_xrgb8888_to_rgb888(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_BGR888) {
-                       drm_fb_xrgb8888_to_bgr888(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_ARGB8888) {
-                       drm_fb_xrgb8888_to_argb8888(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_XBGR8888) {
-                       drm_fb_xrgb8888_to_xbgr8888(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_ABGR8888) {
-                       drm_fb_xrgb8888_to_abgr8888(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_XRGB2101010) {
-                       drm_fb_xrgb8888_to_xrgb2101010(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_ARGB2101010) {
-                       drm_fb_xrgb8888_to_argb2101010(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_BGRX8888) {
-                       drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state);
-                       return 0;
-               } else if (dst_format == DRM_FORMAT_RGB332) {
-                       drm_fb_xrgb8888_to_rgb332(dst, dst_pitch, src, fb, clip, state);
-                       return 0;
-               }
-       }
-
-       drm_warn_once(fb->dev, "No conversion helper from %p4cc to %p4cc found.\n",
-                     &fb_format, &dst_format);
-
-       return -EINVAL;
-}
-EXPORT_SYMBOL(drm_fb_blit);
-
 static void drm_fb_gray8_to_gray2_line(void *dbuf, const void *sbuf, unsigned int pixels)
 {
        u8 *dbuf8 = dbuf;
index 32d57d6c5327e12d99ce7acdb9cab4787cb0391d..2b5c1aef80b0ec07ea84a1be4ceeb71da51f66c2 100644 (file)
@@ -128,10 +128,6 @@ void drm_fb_argb8888_to_argb4444(struct iosys_map *dst, const unsigned int *dst_
                                 const struct iosys_map *src, const struct drm_framebuffer *fb,
                                 const struct drm_rect *clip, struct drm_format_conv_state *state);
 
-int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format,
-               const struct iosys_map *src, const struct drm_framebuffer *fb,
-               const struct drm_rect *clip, struct drm_format_conv_state *state);
-
 void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch,
                             const struct iosys_map *src, const struct drm_framebuffer *fb,
                             const struct drm_rect *clip, struct drm_format_conv_state *state);