| 1 |
|
| 2 | #ifndef _LINUX_SYSFB_H
|
| 3 | #define _LINUX_SYSFB_H
|
| 4 |
|
| 5 | |
| 6 | * Generic System Framebuffers on x86
|
| 7 | * Copyright (c) 2012-2013 David Herrmann <[email protected]>
|
| 8 |
|
| 9 |
|
| 10 | #include <linux/err.h>
|
| 11 | #include <linux/platform_data/simplefb.h>
|
| 12 | #include <linux/screen_info.h>
|
| 13 | #include <linux/types.h>
|
| 14 |
|
| 15 | #include <video/edid.h>
|
| 16 |
|
| 17 | struct device;
|
| 18 | struct platform_device;
|
| 19 | struct screen_info;
|
| 20 |
|
| 21 | enum {
|
| 22 | M_I17,
|
| 23 | M_I20,
|
| 24 | M_I20_SR,
|
| 25 | M_I24,
|
| 26 | M_I24_8_1,
|
| 27 | M_I24_10_1,
|
| 28 | M_I27_11_1,
|
| 29 | M_MINI,
|
| 30 | M_MINI_3_1,
|
| 31 | M_MINI_4_1,
|
| 32 | M_MB,
|
| 33 | M_MB_2,
|
| 34 | M_MB_3,
|
| 35 | M_MB_5_1,
|
| 36 | M_MB_6_1,
|
| 37 | M_MB_7_1,
|
| 38 | M_MB_SR,
|
| 39 | M_MBA,
|
| 40 | M_MBA_3,
|
| 41 | M_MBP,
|
| 42 | M_MBP_2,
|
| 43 | M_MBP_2_2,
|
| 44 | M_MBP_SR,
|
| 45 | M_MBP_4,
|
| 46 | M_MBP_5_1,
|
| 47 | M_MBP_5_2,
|
| 48 | M_MBP_5_3,
|
| 49 | M_MBP_6_1,
|
| 50 | M_MBP_6_2,
|
| 51 | M_MBP_7_1,
|
| 52 | M_MBP_8_2,
|
| 53 | M_UNKNOWN
|
| 54 | };
|
| 55 |
|
| 56 | struct efifb_dmi_info {
|
| 57 | char *optname;
|
| 58 | unsigned long base;
|
| 59 | int stride;
|
| 60 | int width;
|
| 61 | int height;
|
| 62 | int flags;
|
| 63 | };
|
| 64 |
|
| 65 | struct sysfb_display_info {
|
| 66 | struct screen_info screen;
|
| 67 |
|
| 68 | #if defined(CONFIG_FIRMWARE_EDID)
|
| 69 | struct edid_info edid;
|
| 70 | #endif
|
| 71 | };
|
| 72 |
|
| 73 | extern struct sysfb_display_info sysfb_primary_display;
|
| 74 |
|
| 75 | #ifdef CONFIG_SYSFB
|
| 76 |
|
| 77 | void sysfb_disable(struct device *dev);
|
| 78 |
|
| 79 | bool sysfb_handles_screen_info(void);
|
| 80 |
|
| 81 | #else
|
| 82 |
|
| 83 | static inline void sysfb_disable(struct device *dev)
|
| 84 | {
|
| 85 | }
|
| 86 |
|
| 87 | static inline bool sysfb_handles_screen_info(void)
|
| 88 | {
|
| 89 | return false;
|
| 90 | }
|
| 91 |
|
| 92 | #endif
|
| 93 |
|
| 94 | #ifdef CONFIG_EFI
|
| 95 |
|
| 96 | extern struct efifb_dmi_info efifb_dmi_list[];
|
| 97 | void sysfb_apply_efi_quirks(struct screen_info *si);
|
| 98 | void sysfb_set_efifb_fwnode(const struct screen_info *si, struct platform_device *pd);
|
| 99 |
|
| 100 | #else
|
| 101 |
|
| 102 | static inline void sysfb_apply_efi_quirks(struct screen_info *si)
|
| 103 | {
|
| 104 | }
|
| 105 |
|
| 106 | static inline void sysfb_set_efifb_fwnode(const struct screen_info *si,
|
| 107 | struct platform_device *pd)
|
| 108 | {
|
| 109 | }
|
| 110 |
|
| 111 | #endif
|
| 112 |
|
| 113 | #ifdef CONFIG_SYSFB_SIMPLEFB
|
| 114 |
|
| 115 | bool sysfb_parse_mode(const struct screen_info *si,
|
| 116 | struct simplefb_platform_data *mode);
|
| 117 | struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
|
| 118 | const struct simplefb_platform_data *mode,
|
| 119 | struct device *parent);
|
| 120 |
|
| 121 | #else
|
| 122 |
|
| 123 | static inline bool sysfb_parse_mode(const struct screen_info *si,
|
| 124 | struct simplefb_platform_data *mode)
|
| 125 | {
|
| 126 | return false;
|
| 127 | }
|
| 128 |
|
| 129 | static inline struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
|
| 130 | const struct simplefb_platform_data *mode,
|
| 131 | struct device *parent)
|
| 132 | {
|
| 133 | return ERR_PTR(-EINVAL);
|
| 134 | }
|
| 135 |
|
| 136 | #endif
|
| 137 |
|
| 138 | #endif
|