hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/fb.h
....@@ -124,45 +124,17 @@
124124 * Register/unregister for framebuffer events
125125 */
126126
127
-/* The resolution of the passed in fb_info about to change */
127
+/* The resolution of the passed in fb_info about to change */
128128 #define FB_EVENT_MODE_CHANGE 0x01
129
-/* The display on this fb_info is being suspended, no access to the
130
- * framebuffer is allowed any more after that call returns
131
- */
132
-#define FB_EVENT_SUSPEND 0x02
133
-/* The display on this fb_info was resumed, you can restore the display
134
- * if you own it
135
- */
136
-#define FB_EVENT_RESUME 0x03
137
-/* An entry from the modelist was removed */
138
-#define FB_EVENT_MODE_DELETE 0x04
139
-/* A driver registered itself */
129
+
130
+#ifdef CONFIG_GUMSTIX_AM200EPD
131
+/* only used by mach-pxa/am200epd.c */
140132 #define FB_EVENT_FB_REGISTERED 0x05
141
-/* A driver unregistered itself */
142133 #define FB_EVENT_FB_UNREGISTERED 0x06
143
-/* CONSOLE-SPECIFIC: get console to framebuffer mapping */
144
-#define FB_EVENT_GET_CONSOLE_MAP 0x07
145
-/* CONSOLE-SPECIFIC: set console to framebuffer mapping */
146
-#define FB_EVENT_SET_CONSOLE_MAP 0x08
147
-/* A hardware display blank change occurred */
134
+#endif
135
+
136
+/* A display blank is requested */
148137 #define FB_EVENT_BLANK 0x09
149
-/* Private modelist is to be replaced */
150
-#define FB_EVENT_NEW_MODELIST 0x0A
151
-/* The resolution of the passed in fb_info about to change and
152
- all vc's should be changed */
153
-#define FB_EVENT_MODE_CHANGE_ALL 0x0B
154
-/* A software display blank change occurred */
155
-#define FB_EVENT_CONBLANK 0x0C
156
-/* Get drawing requirements */
157
-#define FB_EVENT_GET_REQ 0x0D
158
-/* Unbind from the console if possible */
159
-#define FB_EVENT_FB_UNBIND 0x0E
160
-/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga_switcheroo */
161
-#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
162
-/* A hardware display blank early change occurred */
163
-#define FB_EARLY_EVENT_BLANK 0x10
164
-/* A hardware display blank revert early change occurred */
165
-#define FB_R_EARLY_EVENT_BLANK 0x11
166138
167139 struct fb_event {
168140 struct fb_info *info;
....@@ -321,9 +293,6 @@
321293 /* called at KDB enter and leave time to prepare the console */
322294 int (*fb_debug_enter)(struct fb_info *info);
323295 int (*fb_debug_leave)(struct fb_info *info);
324
-
325
- /* Export the frame buffer as a dmabuf object */
326
- struct dma_buf *(*fb_dmabuf_export)(struct fb_info *info);
327296 };
328297
329298 #ifdef CONFIG_FB_TILEBLITTING
....@@ -431,8 +400,6 @@
431400 #define FBINFO_HWACCEL_YPAN 0x2000 /* optional */
432401 #define FBINFO_HWACCEL_YWRAP 0x4000 /* optional */
433402
434
-#define FBINFO_MISC_USEREVENT 0x10000 /* event request
435
- from userspace */
436403 #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */
437404
438405 /* A driver may set this flag to indicate that it does want a set_par to be
....@@ -459,10 +426,13 @@
459426 * and host endianness. Drivers should not use this flag.
460427 */
461428 #define FBINFO_BE_MATH 0x100000
429
+/*
430
+ * Hide smem_start in the FBIOGET_FSCREENINFO IOCTL. This is used by modern DRM
431
+ * drivers to stop userspace from trying to share buffers behind the kernel's
432
+ * back. Instead dma-buf based buffer sharing should be used.
433
+ */
434
+#define FBINFO_HIDE_SMEM_START 0x200000
462435
463
-/* report to the VT layer that this fb driver can accept forced console
464
- output like oopses */
465
-#define FBINFO_CAN_FORCE_OUTPUT 0x200000
466436
467437 struct fb_info {
468438 atomic_t count;
....@@ -485,14 +455,14 @@
485455 struct list_head modelist; /* mode list */
486456 struct fb_videomode *mode; /* current mode */
487457
488
-#ifdef CONFIG_FB_BACKLIGHT
458
+#if IS_ENABLED(CONFIG_FB_BACKLIGHT)
489459 /* assigned backlight device */
490
- /* set before framebuffer registration,
460
+ /* set before framebuffer registration,
491461 remove after unregister */
492462 struct backlight_device *bl_dev;
493463
494464 /* Backlight level curve */
495
- struct mutex bl_curve_mutex;
465
+ struct mutex bl_curve_mutex;
496466 u8 bl_curve[FB_BACKLIGHT_LEVELS];
497467 #endif
498468 #ifdef CONFIG_FB_DEFERRED_IO
....@@ -500,7 +470,7 @@
500470 struct fb_deferred_io *fbdefio;
501471 #endif
502472
503
- struct fb_ops *fbops;
473
+ const struct fb_ops *fbops;
504474 struct device *device; /* This is the parent */
505475 struct device *dev; /* This is this fb device */
506476 int class_flag; /* private sysfs flags */
....@@ -511,8 +481,8 @@
511481 char __iomem *screen_base; /* Virtual address */
512482 char *screen_buffer;
513483 };
514
- unsigned long screen_size; /* Amount of ioremapped VRAM or 0 */
515
- void *pseudo_palette; /* Fake palette of 16 colors */
484
+ unsigned long screen_size; /* Amount of ioremapped VRAM or 0 */
485
+ void *pseudo_palette; /* Fake palette of 16 colors */
516486 #define FBINFO_STATE_RUNNING 0
517487 #define FBINFO_STATE_SUSPENDED 1
518488 u32 state; /* Hardware state i.e suspend */
....@@ -534,8 +504,9 @@
534504 };
535505
536506 static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
537
- struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
538
- + max_num * sizeof(struct aperture), GFP_KERNEL);
507
+ struct apertures_struct *a;
508
+
509
+ a = kzalloc(struct_size(a, ranges, max_num), GFP_KERNEL);
539510 if (!a)
540511 return NULL;
541512 a->count = max_num;
....@@ -614,11 +585,11 @@
614585 * `Generic' versions of the frame buffer device operations
615586 */
616587
617
-extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
618
-extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
588
+extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
589
+extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
619590 extern int fb_blank(struct fb_info *info, int blank);
620
-extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
621
-extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
591
+extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
592
+extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
622593 extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
623594 /*
624595 * Drawing operations where framebuffer is in system RAM
....@@ -633,8 +604,9 @@
633604
634605 /* drivers/video/fbmem.c */
635606 extern int register_framebuffer(struct fb_info *fb_info);
636
-extern int unregister_framebuffer(struct fb_info *fb_info);
637
-extern int unlink_framebuffer(struct fb_info *fb_info);
607
+extern void unregister_framebuffer(struct fb_info *fb_info);
608
+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
609
+ const char *name);
638610 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
639611 const char *name, bool primary);
640612 extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
....@@ -651,13 +623,18 @@
651623
652624 extern struct fb_info *registered_fb[FB_MAX];
653625 extern int num_registered_fb;
626
+extern bool fb_center_logo;
627
+extern int fb_logo_count;
654628 extern struct class *fb_class;
655629
656630 #define for_each_registered_fb(i) \
657631 for (i = 0; i < FB_MAX; i++) \
658632 if (!registered_fb[i]) {} else
659633
660
-extern int lock_fb_info(struct fb_info *info);
634
+static inline void lock_fb_info(struct fb_info *info)
635
+{
636
+ mutex_lock(&info->lock);
637
+}
661638
662639 static inline void unlock_fb_info(struct fb_info *info)
663640 {