Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/format-helper: Remove drm_fb_blit()

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

-95
-91
drivers/gpu/drm/drm_format_helper.c
··· 1165 1165 } 1166 1166 EXPORT_SYMBOL(drm_fb_argb8888_to_argb4444); 1167 1167 1168 - /** 1169 - * drm_fb_blit - Copy parts of a framebuffer to display memory 1170 - * @dst: Array of display-memory addresses to copy to 1171 - * @dst_pitch: Array of numbers of bytes between the start of two consecutive scanlines 1172 - * within @dst; can be NULL if scanlines are stored next to each other. 1173 - * @dst_format: FOURCC code of the display's color format 1174 - * @src: The framebuffer memory to copy from 1175 - * @fb: The framebuffer to copy from 1176 - * @clip: Clip rectangle area to copy 1177 - * @state: Transform and conversion state 1178 - * 1179 - * This function copies parts of a framebuffer to display memory. If the 1180 - * formats of the display and the framebuffer mismatch, the blit function 1181 - * will attempt to convert between them during the process. The parameters @dst, 1182 - * @dst_pitch and @src refer to arrays. Each array must have at least as many 1183 - * entries as there are planes in @dst_format's format. Each entry stores the 1184 - * value for the format's respective color plane at the same index. 1185 - * 1186 - * This function does not apply clipping on @dst (i.e. the destination is at the 1187 - * top-left corner). 1188 - * 1189 - * Returns: 1190 - * 0 on success, or 1191 - * -EINVAL if the color-format conversion failed, or 1192 - * a negative error code otherwise. 1193 - */ 1194 - int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format, 1195 - const struct iosys_map *src, const struct drm_framebuffer *fb, 1196 - const struct drm_rect *clip, struct drm_format_conv_state *state) 1197 - { 1198 - uint32_t fb_format = fb->format->format; 1199 - 1200 - if (fb_format == dst_format) { 1201 - drm_fb_memcpy(dst, dst_pitch, src, fb, clip); 1202 - return 0; 1203 - } else if (fb_format == (dst_format | DRM_FORMAT_BIG_ENDIAN)) { 1204 - drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state); 1205 - return 0; 1206 - } else if (fb_format == (dst_format & ~DRM_FORMAT_BIG_ENDIAN)) { 1207 - drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state); 1208 - return 0; 1209 - } else if (fb_format == DRM_FORMAT_XRGB8888) { 1210 - if (dst_format == DRM_FORMAT_RGB565) { 1211 - drm_fb_xrgb8888_to_rgb565(dst, dst_pitch, src, fb, clip, state); 1212 - return 0; 1213 - } else if (dst_format == DRM_FORMAT_XRGB1555) { 1214 - drm_fb_xrgb8888_to_xrgb1555(dst, dst_pitch, src, fb, clip, state); 1215 - return 0; 1216 - } else if (dst_format == DRM_FORMAT_ARGB1555) { 1217 - drm_fb_xrgb8888_to_argb1555(dst, dst_pitch, src, fb, clip, state); 1218 - return 0; 1219 - } else if (dst_format == DRM_FORMAT_RGBA5551) { 1220 - drm_fb_xrgb8888_to_rgba5551(dst, dst_pitch, src, fb, clip, state); 1221 - return 0; 1222 - } else if (dst_format == DRM_FORMAT_RGB888) { 1223 - drm_fb_xrgb8888_to_rgb888(dst, dst_pitch, src, fb, clip, state); 1224 - return 0; 1225 - } else if (dst_format == DRM_FORMAT_BGR888) { 1226 - drm_fb_xrgb8888_to_bgr888(dst, dst_pitch, src, fb, clip, state); 1227 - return 0; 1228 - } else if (dst_format == DRM_FORMAT_ARGB8888) { 1229 - drm_fb_xrgb8888_to_argb8888(dst, dst_pitch, src, fb, clip, state); 1230 - return 0; 1231 - } else if (dst_format == DRM_FORMAT_XBGR8888) { 1232 - drm_fb_xrgb8888_to_xbgr8888(dst, dst_pitch, src, fb, clip, state); 1233 - return 0; 1234 - } else if (dst_format == DRM_FORMAT_ABGR8888) { 1235 - drm_fb_xrgb8888_to_abgr8888(dst, dst_pitch, src, fb, clip, state); 1236 - return 0; 1237 - } else if (dst_format == DRM_FORMAT_XRGB2101010) { 1238 - drm_fb_xrgb8888_to_xrgb2101010(dst, dst_pitch, src, fb, clip, state); 1239 - return 0; 1240 - } else if (dst_format == DRM_FORMAT_ARGB2101010) { 1241 - drm_fb_xrgb8888_to_argb2101010(dst, dst_pitch, src, fb, clip, state); 1242 - return 0; 1243 - } else if (dst_format == DRM_FORMAT_BGRX8888) { 1244 - drm_fb_swab(dst, dst_pitch, src, fb, clip, false, state); 1245 - return 0; 1246 - } else if (dst_format == DRM_FORMAT_RGB332) { 1247 - drm_fb_xrgb8888_to_rgb332(dst, dst_pitch, src, fb, clip, state); 1248 - return 0; 1249 - } 1250 - } 1251 - 1252 - drm_warn_once(fb->dev, "No conversion helper from %p4cc to %p4cc found.\n", 1253 - &fb_format, &dst_format); 1254 - 1255 - return -EINVAL; 1256 - } 1257 - EXPORT_SYMBOL(drm_fb_blit); 1258 - 1259 1168 static void drm_fb_gray8_to_gray2_line(void *dbuf, const void *sbuf, unsigned int pixels) 1260 1169 { 1261 1170 u8 *dbuf8 = dbuf;
-4
include/drm/drm_format_helper.h
··· 128 128 const struct iosys_map *src, const struct drm_framebuffer *fb, 129 129 const struct drm_rect *clip, struct drm_format_conv_state *state); 130 130 131 - int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format, 132 - const struct iosys_map *src, const struct drm_framebuffer *fb, 133 - const struct drm_rect *clip, struct drm_format_conv_state *state); 134 - 135 131 void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch, 136 132 const struct iosys_map *src, const struct drm_framebuffer *fb, 137 133 const struct drm_rect *clip, struct drm_format_conv_state *state);