Lines Matching +full:itu +full:- +full:r
1 // SPDX-License-Identifier: GPL-2.0 or MIT
12 #include <linux/iosys-map.h>
25 return clip->y1 * pitch + clip->x1 * cpp; in clip_offset()
29 * drm_fb_clip_offset - Returns the clipping rectangles byte-offset in a framebuffer
35 * The byte offset of the clip rectangle's top-left corner within the framebuffer.
40 return clip_offset(clip, pitch, format->cpp[0]); in drm_fb_clip_offset()
44 /* TODO: Make this function work with multi-plane formats. */
52 size_t sbuf_len = linepixels * fb->format->cpp[0]; in __drm_fb_xfrm()
58 * Some source buffers, such as DMA memory, use write-combine in __drm_fb_xfrm()
65 return -ENOMEM; in __drm_fb_xfrm()
70 vaddr += clip_offset(clip, fb->pitches[0], fb->format->cpp[0]); in __drm_fb_xfrm()
78 vaddr += fb->pitches[0]; in __drm_fb_xfrm()
87 /* TODO: Make this function work with multi-plane formats. */
97 size_t sbuf_len = linepixels * fb->format->cpp[0]; in __drm_fb_xfrm_toio()
110 return -ENOMEM; in __drm_fb_xfrm_toio()
114 vaddr += clip_offset(clip, fb->pitches[0], fb->format->cpp[0]); in __drm_fb_xfrm_toio()
123 vaddr += fb->pitches[0]; in __drm_fb_xfrm_toio()
132 /* TODO: Make this function work with multi-plane formats. */
156 * drm_fb_memcpy - Copy clip buffer
171 * top-left corner).
181 const struct drm_format_info *format = fb->format; in drm_fb_memcpy()
187 for (i = 0; i < format->num_planes; ++i) { in drm_fb_memcpy()
198 iosys_map_incr(&src_i, clip_offset(clip, fb->pitches[i], cpp_i)); in drm_fb_memcpy()
202 iosys_map_incr(&src_i, fb->pitches[i]); in drm_fb_memcpy()
230 * drm_fb_swab - Swap bytes into clip buffer
237 * @cached: Source buffer is mapped cached (eg. not write-combined)
239 * This function copies parts of a framebuffer to display memory and swaps per-pixel
248 * top-left corner).
254 const struct drm_format_info *format = fb->format; in drm_fb_swab()
266 drm_warn_once(fb->dev, "Format %p4cc has unsupported pixel size.\n", in drm_fb_swab()
267 &format->format); in drm_fb_swab()
291 * drm_fb_xrgb8888_to_rgb332 - Convert XRGB8888 to RGB332 clip buffer
306 * top-left corner).
359 * drm_fb_xrgb8888_to_rgb565 - Convert XRGB8888 to RGB565 clip buffer
375 * top-left corner).
414 * drm_fb_xrgb8888_to_rgb888 - Convert XRGB8888 to RGB888 clip buffer
429 * top-left corner).
485 u8 r = *sbuf8++; in drm_fb_rgb888_to_xrgb8888_line() local
488 u32 pix = 0xff000000 | (r << 16) | (g << 8) | b; in drm_fb_rgb888_to_xrgb8888_line()
525 * drm_fb_xrgb8888_to_xrgb2101010 - Convert XRGB8888 to XRGB2101010 clip buffer
540 * top-left corner).
566 u8 r = (pix & 0x00ff0000) >> 16; in drm_fb_xrgb8888_to_gray8_line() local
570 /* ITU BT.601: Y = 0.299 R + 0.587 G + 0.114 B */ in drm_fb_xrgb8888_to_gray8_line()
571 *dbuf8++ = (3 * r + 6 * g + b) / 10; in drm_fb_xrgb8888_to_gray8_line()
576 * drm_fb_xrgb8888_to_gray8 - Convert XRGB8888 to grayscale
577 * @dst: Array of 8-bit grayscale destination buffers
591 * top-left corner).
598 * ITU BT.601 is being used for the RGB -> luma (brightness) conversion.
614 * drm_fb_blit - Copy parts of a framebuffer to display memory
615 * @dst: Array of display-memory addresses to copy to
631 * top-left corner).
635 * -EINVAL if the color-format conversion failed, or
642 uint32_t fb_format = fb->format->format; in drm_fb_blit()
683 drm_warn_once(fb->dev, "No conversion helper from %p4cc to %p4cc found.\n", in drm_fb_blit()
686 return -EINVAL; in drm_fb_blit()
699 for (i = 0; i < bits; i++, pixels--) { in drm_fb_gray8_to_mono_line()
708 * drm_fb_xrgb8888_to_mono - Convert XRGB8888 to monochrome
723 * top-left corner). The first pixel (upper left corner of the clip rectangle) will
726 * be located at an x-coordinate that is a multiple of 8, then the caller must take
746 unsigned int cpp = fb->format->cpp[0]; in drm_fb_xrgb8888_to_mono()
748 struct drm_device *dev = fb->dev; in drm_fb_xrgb8888_to_mono()
755 if (drm_WARN_ON(dev, fb->format->format != DRM_FORMAT_XRGB8888)) in drm_fb_xrgb8888_to_mono()
769 * The dma memory is write-combined so reads are uncached. in drm_fb_xrgb8888_to_mono()
773 * line-by-line but are converted to 8-bit grayscale as an in drm_fb_xrgb8888_to_mono()
785 vaddr += clip_offset(clip, fb->pitches[0], cpp); in drm_fb_xrgb8888_to_mono()
790 vaddr += fb->pitches[0]; in drm_fb_xrgb8888_to_mono()
843 * drm_fb_build_fourcc_list - Filters a list of supported color formats against
848 * @driver_fourccs: 4CC codes of all driver-supported color formats
867 * The number of color-formats 4CC codes returned in @fourccs_out.
886 if (is_listed_fourcc(fourccs_out, fourccs - fourccs_out, fourcc)) { in drm_fb_build_fourcc_list()
914 if (is_listed_fourcc(fourccs_out, fourccs - fourccs_out, fourcc)) { in drm_fb_build_fourcc_list()
930 return fourccs - fourccs_out; in drm_fb_build_fourcc_list()