Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * simplefb.h - Simple Framebuffer Device
0004  *
0005  * Copyright (C) 2013 David Herrmann <dh.herrmann@gmail.com>
0006  */
0007 
0008 #ifndef __PLATFORM_DATA_SIMPLEFB_H__
0009 #define __PLATFORM_DATA_SIMPLEFB_H__
0010 
0011 #include <drm/drm_fourcc.h>
0012 #include <linux/fb.h>
0013 #include <linux/types.h>
0014 
0015 /* format array, use it to initialize a "struct simplefb_format" array */
0016 #define SIMPLEFB_FORMATS \
0017 { \
0018     { "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 }, \
0019     { "r5g5b5a1", 16, {11, 5}, {6, 5}, {1, 5}, {0, 1}, DRM_FORMAT_RGBA5551 }, \
0020     { "x1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {0, 0}, DRM_FORMAT_XRGB1555 }, \
0021     { "a1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {15, 1}, DRM_FORMAT_ARGB1555 }, \
0022     { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \
0023     { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \
0024     { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \
0025     { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \
0026     { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \
0027     { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \
0028 }
0029 
0030 /*
0031  * Data-Format for Simple-Framebuffers
0032  * @name: unique 0-terminated name that can be used to identify the mode
0033  * @red,green,blue: Offsets and sizes of the single RGB parts
0034  * @transp: Offset and size of the alpha bits. length=0 means no alpha
0035  * @fourcc: 32bit DRM four-CC code (see drm_fourcc.h)
0036  */
0037 struct simplefb_format {
0038     const char *name;
0039     u32 bits_per_pixel;
0040     struct fb_bitfield red;
0041     struct fb_bitfield green;
0042     struct fb_bitfield blue;
0043     struct fb_bitfield transp;
0044     u32 fourcc;
0045 };
0046 
0047 /*
0048  * Simple-Framebuffer description
0049  * If the arch-boot code creates simple-framebuffers without DT support, it
0050  * can pass the width, height, stride and format via this platform-data object.
0051  * The framebuffer location must be given as IORESOURCE_MEM resource.
0052  * @format must be a format as described in "struct simplefb_format" above.
0053  */
0054 struct simplefb_platform_data {
0055     u32 width;
0056     u32 height;
0057     u32 stride;
0058     const char *format;
0059 };
0060 
0061 #endif /* __PLATFORM_DATA_SIMPLEFB_H__ */