.. | .. |
---|
124 | 124 | * Register/unregister for framebuffer events |
---|
125 | 125 | */ |
---|
126 | 126 | |
---|
127 | | -/* The resolution of the passed in fb_info about to change */ |
---|
| 127 | +/* The resolution of the passed in fb_info about to change */ |
---|
128 | 128 | #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 */ |
---|
140 | 132 | #define FB_EVENT_FB_REGISTERED 0x05 |
---|
141 | | -/* A driver unregistered itself */ |
---|
142 | 133 | #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 */ |
---|
148 | 137 | #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 |
---|
166 | 138 | |
---|
167 | 139 | struct fb_event { |
---|
168 | 140 | struct fb_info *info; |
---|
.. | .. |
---|
321 | 293 | /* called at KDB enter and leave time to prepare the console */ |
---|
322 | 294 | int (*fb_debug_enter)(struct fb_info *info); |
---|
323 | 295 | 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); |
---|
327 | 296 | }; |
---|
328 | 297 | |
---|
329 | 298 | #ifdef CONFIG_FB_TILEBLITTING |
---|
.. | .. |
---|
431 | 400 | #define FBINFO_HWACCEL_YPAN 0x2000 /* optional */ |
---|
432 | 401 | #define FBINFO_HWACCEL_YWRAP 0x4000 /* optional */ |
---|
433 | 402 | |
---|
434 | | -#define FBINFO_MISC_USEREVENT 0x10000 /* event request |
---|
435 | | - from userspace */ |
---|
436 | 403 | #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ |
---|
437 | 404 | |
---|
438 | 405 | /* A driver may set this flag to indicate that it does want a set_par to be |
---|
.. | .. |
---|
459 | 426 | * and host endianness. Drivers should not use this flag. |
---|
460 | 427 | */ |
---|
461 | 428 | #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 |
---|
462 | 435 | |
---|
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 |
---|
466 | 436 | |
---|
467 | 437 | struct fb_info { |
---|
468 | 438 | atomic_t count; |
---|
.. | .. |
---|
485 | 455 | struct list_head modelist; /* mode list */ |
---|
486 | 456 | struct fb_videomode *mode; /* current mode */ |
---|
487 | 457 | |
---|
488 | | -#ifdef CONFIG_FB_BACKLIGHT |
---|
| 458 | +#if IS_ENABLED(CONFIG_FB_BACKLIGHT) |
---|
489 | 459 | /* assigned backlight device */ |
---|
490 | | - /* set before framebuffer registration, |
---|
| 460 | + /* set before framebuffer registration, |
---|
491 | 461 | remove after unregister */ |
---|
492 | 462 | struct backlight_device *bl_dev; |
---|
493 | 463 | |
---|
494 | 464 | /* Backlight level curve */ |
---|
495 | | - struct mutex bl_curve_mutex; |
---|
| 465 | + struct mutex bl_curve_mutex; |
---|
496 | 466 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; |
---|
497 | 467 | #endif |
---|
498 | 468 | #ifdef CONFIG_FB_DEFERRED_IO |
---|
.. | .. |
---|
500 | 470 | struct fb_deferred_io *fbdefio; |
---|
501 | 471 | #endif |
---|
502 | 472 | |
---|
503 | | - struct fb_ops *fbops; |
---|
| 473 | + const struct fb_ops *fbops; |
---|
504 | 474 | struct device *device; /* This is the parent */ |
---|
505 | 475 | struct device *dev; /* This is this fb device */ |
---|
506 | 476 | int class_flag; /* private sysfs flags */ |
---|
.. | .. |
---|
511 | 481 | char __iomem *screen_base; /* Virtual address */ |
---|
512 | 482 | char *screen_buffer; |
---|
513 | 483 | }; |
---|
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 */ |
---|
516 | 486 | #define FBINFO_STATE_RUNNING 0 |
---|
517 | 487 | #define FBINFO_STATE_SUSPENDED 1 |
---|
518 | 488 | u32 state; /* Hardware state i.e suspend */ |
---|
.. | .. |
---|
534 | 504 | }; |
---|
535 | 505 | |
---|
536 | 506 | 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); |
---|
539 | 510 | if (!a) |
---|
540 | 511 | return NULL; |
---|
541 | 512 | a->count = max_num; |
---|
.. | .. |
---|
614 | 585 | * `Generic' versions of the frame buffer device operations |
---|
615 | 586 | */ |
---|
616 | 587 | |
---|
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); |
---|
619 | 590 | 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); |
---|
622 | 593 | extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); |
---|
623 | 594 | /* |
---|
624 | 595 | * Drawing operations where framebuffer is in system RAM |
---|
.. | .. |
---|
633 | 604 | |
---|
634 | 605 | /* drivers/video/fbmem.c */ |
---|
635 | 606 | 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); |
---|
638 | 610 | extern int remove_conflicting_framebuffers(struct apertures_struct *a, |
---|
639 | 611 | const char *name, bool primary); |
---|
640 | 612 | extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); |
---|
.. | .. |
---|
651 | 623 | |
---|
652 | 624 | extern struct fb_info *registered_fb[FB_MAX]; |
---|
653 | 625 | extern int num_registered_fb; |
---|
| 626 | +extern bool fb_center_logo; |
---|
| 627 | +extern int fb_logo_count; |
---|
654 | 628 | extern struct class *fb_class; |
---|
655 | 629 | |
---|
656 | 630 | #define for_each_registered_fb(i) \ |
---|
657 | 631 | for (i = 0; i < FB_MAX; i++) \ |
---|
658 | 632 | if (!registered_fb[i]) {} else |
---|
659 | 633 | |
---|
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 | +} |
---|
661 | 638 | |
---|
662 | 639 | static inline void unlock_fb_info(struct fb_info *info) |
---|
663 | 640 | { |
---|