Skip to content

Commit

Permalink
Merge tag 'fbdev-v4.19' of https://github.com/bzolnier/linux
Browse files Browse the repository at this point in the history
Pull fbdev updates from Bartlomiej Zolnierkiewicz:
 "Mostly small fixes and cleanups for fb drivers (the biggest updates
  are for udlfb and pxafb drivers). This also adds deferred console
  takeover support to the console code and efifb driver.

  Summary:

   - add support for deferred console takeover, when enabled defers
     fbcon taking over the console from the dummy console until the
     first text is displayed on the console - together with the "quiet"
     kernel commandline option this allows fbcon to still be used
     together with a smooth graphical bootup (Hans de Goede)

   - improve console locking debugging code (Thomas Zimmermann)

   - copy the ACPI BGRT boot graphics to the framebuffer when deferred
     console takeover support is used in efifb driver (Hans de Goede)

   - update udlfb driver - fix lost console when the user unplugs a USB
     adapter, fix the screen corruption issue, fix locking and add some
     performance optimizations (Mikulas Patocka)

   - update pxafb driver - fix using uninitialized memory, switch to
     devm_* API, handle initialization errors and add support for
     lcd-supply regulator (Daniel Mack)

   - add support for boards booted with a DeviceTree in pxa3xx_gcu
     driver (Daniel Mack)

   - rename omap2 module to omap2fb.ko to avoid conflicts with omap1
     driver (Arnd Bergmann)

   - enable ACPI-based enumeration for goldfishfb driver (Yu Ning)

   - fix goldfishfb driver to make user space Android code use 60 fps
     (Christoffer Dall)

   - print big fat warning when nomodeset kernel parameter is used in
     vgacon driver (Lyude Paul)

   - remove VLA usage from fsl-diu-fb driver (Kees Cook)

   - misc fixes (Julia Lawall, Geert Uytterhoeven, Fredrik Noring,
     Yisheng Xie, Dan Carpenter, Daniel Vetter, Anton Vasilyev, Randy
     Dunlap, Gustavo A. R. Silva, Colin Ian King, Fengguang Wu)

   - misc cleanups (Roman Kiryanov, Yisheng Xie, Colin Ian King)"

* tag 'fbdev-v4.19' of https://github.com/bzolnier/linux: (54 commits)
  Documentation/fb: corrections for fbcon.txt
  fbcon: Do not takeover the console from atomic context
  dummycon: Stop exporting dummycon_[un]register_output_notifier
  fbcon: Only defer console takeover if the current console driver is the dummycon
  fbcon: Only allow FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER if fbdev is builtin
  fbdev: omap2: omapfb: fix ifnullfree.cocci warnings
  fbdev: omap2: omapfb: fix bugon.cocci warnings
  fbdev: omap2: omapfb: fix boolreturn.cocci warnings
  fb: amifb: fix build warnings when not builtin
  fbdev/core: Disable console-lock warnings when fb.lockless_register_fb is set
  console: Replace #if 0 with atomic var 'ignore_console_lock_warning'
  udlfb: use spin_lock_irq instead of spin_lock_irqsave
  udlfb: avoid prefetch
  udlfb: optimization - test the backing buffer
  udlfb: allow reallocating the framebuffer
  udlfb: set line_length in dlfb_ops_set_par
  udlfb: handle allocation failure
  udlfb: set optimal write delay
  udlfb: make a local copy of fb_ops
  udlfb: don't switch if we are switching to the same videomode
  ...
  • Loading branch information
torvalds committed Aug 23, 2018
2 parents 99897b1 + f396845 commit 06e386a
Show file tree
Hide file tree
Showing 35 changed files with 637 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Required properties:
- interrupts : framebuffer controller interrupt.
- clocks: phandle to input clocks

Optional properties:
- lcd-supply: A phandle to a power regulator that controls the LCD voltage.

Required nodes:
- port: connection to the LCD panel (see video-interfaces.txt)
This node must have its properties bus-width and remote-endpoint set.
Expand Down
17 changes: 17 additions & 0 deletions Documentation/devicetree/bindings/display/marvell,pxa300-gcu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
PXA3xx GCU Controller
---------------------

Required properties:
- compatible : "marvell,pxa300-gcu"
- reg : should contain the register range (address and length).
- interrupts : Controller interrupt.
- clocks: phandle to the PXA specific input clock.

Example for PXA300:

display-controller@54000000 {
compatible = "marvell,pxa300-gcu";
reg = <0x54000000 0x1000>;
interrupts = <39>;
clocks = <&clks CLK_PXA300_GCU>;
};
29 changes: 15 additions & 14 deletions Documentation/fb/fbcon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ made available by the underlying graphics card are also possible.
A. Configuration

The framebuffer console can be enabled by using your favorite kernel
configuration tool. It is under Device Drivers->Graphics Support->Support for
framebuffer devices->Framebuffer Console Support. Select 'y' to compile
support statically, or 'm' for module support. The module will be fbcon.
configuration tool. It is under Device Drivers->Graphics Support->Frame
buffer Devices->Console display driver support->Framebuffer Console Support.
Select 'y' to compile support statically or 'm' for module support. The
module will be fbcon.

In order for fbcon to activate, at least one framebuffer driver is
required, so choose from any of the numerous drivers available. For x86
Expand All @@ -29,10 +30,10 @@ always be available. However, using a chipset-specific driver will give you
more speed and features, such as the ability to change the video mode
dynamically.

To display the penguin logo, choose any logo available in Logo
Configuration->Boot up logo.
To display the penguin logo, choose any logo available in Graphics
support->Bootup logo.

Also, you will need to select at least one compiled-in fonts, but if
Also, you will need to select at least one compiled-in font, but if
you don't do anything, the kernel configuration tool will select one for you,
usually an 8x16 font.

Expand Down Expand Up @@ -135,16 +136,16 @@ C. Boot options

The angle can be changed anytime afterwards by 'echoing' the same
numbers to any one of the 2 attributes found in
/sys/class/graphics/fbcon
/sys/class/graphics/fbcon:

rotate - rotate the display of the active console
rotate_all - rotate the display of all consoles

Console rotation will only become available if Console Rotation
Support is compiled in your kernel.
Console rotation will only become available if Framebuffer Console
Rotation support is compiled in your kernel.

NOTE: This is purely console rotation. Any other applications that
use the framebuffer will remain at their 'normal'orientation.
use the framebuffer will remain at their 'normal' orientation.
Actually, the underlying fb driver is totally ignorant of console
rotation.

Expand All @@ -164,7 +165,7 @@ C. Boot options

C. Attaching, Detaching and Unloading

Before going on how to attach, detach and unload the framebuffer console, an
Before going on to how to attach, detach and unload the framebuffer console, an
illustration of the dependencies may help.

The console layer, as with most subsystems, needs a driver that interfaces with
Expand All @@ -182,7 +183,7 @@ because fbcon is an intermediate layer between the console and the drivers:

console ---> fbcon ---> fbdev drivers ---> hardware

The fbdev drivers cannot be unloaded if it's bound to fbcon, and fbcon cannot
The fbdev drivers cannot be unloaded if bound to fbcon, and fbcon cannot
be unloaded if it's bound to the console layer.

So to unload the fbdev drivers, one must first unbind fbcon from the console,
Expand Down Expand Up @@ -232,7 +233,7 @@ restored properly. The following is one of the several methods that you can do:
echo 0 > /sys/class/vtconsole/vtcon1/bind

6. That's it, you're back to VGA mode. And if you compiled fbcon as a module,
you can unload it by 'rmmod fbcon'
you can unload it by 'rmmod fbcon'.

7. To reattach fbcon:

Expand Down Expand Up @@ -290,7 +291,7 @@ Samples:
========

Here are 2 sample bash scripts that you can use to bind or unbind the
framebuffer console driver if you are in an X86 box:
framebuffer console driver if you are on an X86 box:

---------------------------------------------------------------------------
#!/bin/bash
Expand Down
2 changes: 1 addition & 1 deletion drivers/firmware/efi/efi-bgrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/efi-bgrt.h>

struct acpi_table_bgrt bgrt_tab;
size_t __initdata bgrt_image_size;
size_t bgrt_image_size;

struct bmp_header {
u16 id;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/console/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ config FRAMEBUFFER_CONSOLE_ROTATION

config FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
bool "Framebuffer Console Deferred Takeover"
depends on FRAMEBUFFER_CONSOLE=y && DUMMY_CONSOLE=y
depends on FB=y && FRAMEBUFFER_CONSOLE && DUMMY_CONSOLE
help
If enabled this defers the framebuffer console taking over the
console from the dummy console until the first text is displayed on
Expand Down
2 changes: 0 additions & 2 deletions drivers/video/console/dummycon.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ void dummycon_register_output_notifier(struct notifier_block *nb)
if (dummycon_putc_called)
nb->notifier_call(nb, 0, NULL);
}
EXPORT_SYMBOL_GPL(dummycon_register_output_notifier);

void dummycon_unregister_output_notifier(struct notifier_block *nb)
{
raw_notifier_chain_unregister(&dummycon_output_nh, nb);
}
EXPORT_SYMBOL_GPL(dummycon_unregister_output_notifier);

static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos)
{
Expand Down
5 changes: 5 additions & 0 deletions drivers/video/console/vgacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ EXPORT_SYMBOL(vgacon_text_force);
static int __init text_mode(char *str)
{
vgacon_text_mode_force = true;

pr_warning("You have booted with nomodeset. This means your GPU drivers are DISABLED\n");
pr_warning("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n");
pr_warning("Unless you actually understand what nomodeset does, you should reboot without enabling it\n");

return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/video/fbdev/amifb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2303,7 +2303,7 @@ static void ami_build_copper(struct fb_info *info)
ami_rebuild_copper(info->par);
}


#ifndef MODULE
static void __init amifb_setup_mcap(char *spec)
{
char *p;
Expand Down Expand Up @@ -2368,7 +2368,7 @@ static int __init amifb_setup(char *options)

return 0;
}

#endif

static int amifb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
Expand Down
70 changes: 34 additions & 36 deletions drivers/video/fbdev/core/fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,8 +2234,8 @@ static int fbcon_switch(struct vc_data *vc)
*
* info->currcon = vc->vc_num;
*/
for (i = 0; i < FB_MAX; i++) {
if (registered_fb[i] != NULL && registered_fb[i]->fbcon_par) {
for_each_registered_fb(i) {
if (registered_fb[i]->fbcon_par) {
struct fbcon_ops *o = registered_fb[i]->fbcon_par;

o->currcon = vc->vc_num;
Expand Down Expand Up @@ -3124,11 +3124,9 @@ static int fbcon_fb_unregistered(struct fb_info *info)
if (idx == info_idx) {
info_idx = -1;

for (i = 0; i < FB_MAX; i++) {
if (registered_fb[i] != NULL) {
info_idx = i;
break;
}
for_each_registered_fb(i) {
info_idx = i;
break;
}
}

Expand Down Expand Up @@ -3594,13 +3592,24 @@ static int fbcon_init_device(void)
}

#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
static void fbcon_register_existing_fbs(struct work_struct *work)
{
int i;

console_lock();

for_each_registered_fb(i)
fbcon_fb_registered(registered_fb[i]);

console_unlock();
}

static struct notifier_block fbcon_output_nb;
static DECLARE_WORK(fbcon_deferred_takeover_work, fbcon_register_existing_fbs);

static int fbcon_output_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{
int i;

WARN_CONSOLE_UNLOCKED();

pr_info("fbcon: Taking over console\n");
Expand All @@ -3609,45 +3618,37 @@ static int fbcon_output_notifier(struct notifier_block *nb,
deferred_takeover = false;
logo_shown = FBCON_LOGO_DONTSHOW;

for (i = 0; i < FB_MAX; i++) {
if (registered_fb[i])
fbcon_fb_registered(registered_fb[i]);
}
/* We may get called in atomic context */
schedule_work(&fbcon_deferred_takeover_work);

return NOTIFY_OK;
}

static void fbcon_register_output_notifier(void)
{
fbcon_output_nb.notifier_call = fbcon_output_notifier;
dummycon_register_output_notifier(&fbcon_output_nb);
}
#else
static inline void fbcon_register_output_notifier(void) {}
#endif

static void fbcon_start(void)
{
WARN_CONSOLE_UNLOCKED();

#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
if (conswitchp != &dummy_con)
deferred_takeover = false;

if (deferred_takeover) {
fbcon_register_output_notifier();
fbcon_output_nb.notifier_call = fbcon_output_notifier;
dummycon_register_output_notifier(&fbcon_output_nb);
return;
}
#endif

if (num_registered_fb) {
int i;

console_lock();

for (i = 0; i < FB_MAX; i++) {
if (registered_fb[i] != NULL) {
info_idx = i;
break;
}
for_each_registered_fb(i) {
info_idx = i;
break;
}

do_fbcon_takeover(0);
console_unlock();

}
}

Expand All @@ -3669,15 +3670,12 @@ static void fbcon_exit(void)
kfree((void *)softback_buf);
softback_buf = 0UL;

for (i = 0; i < FB_MAX; i++) {
for_each_registered_fb(i) {
int pending = 0;

mapped = 0;
info = registered_fb[i];

if (info == NULL)
continue;

if (info->queue.func)
pending = cancel_work_sync(&info->queue);
DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
Expand Down Expand Up @@ -3733,8 +3731,8 @@ void __init fb_console_init(void)
for (i = 0; i < MAX_NR_CONSOLES; i++)
con2fb_map[i] = -1;

console_unlock();
fbcon_start();
console_unlock();
}

#ifdef MODULE
Expand Down
Loading

0 comments on commit 06e386a

Please sign in to comment.