]> Git Repo - linux.git/commitdiff
Merge branch 'topic/remove-fbcon-notifiers' into drm-misc-next
authorMaarten Lankhorst <[email protected]>
Wed, 19 Jun 2019 10:33:05 +0000 (12:33 +0200)
committerMaarten Lankhorst <[email protected]>
Wed, 19 Jun 2019 10:33:05 +0000 (12:33 +0200)
topic/remove-fbcon-notifiers:
- remove fbdev notifier usage for fbcon, as prep work to clean up the fbcon locking
- assorted locking checks in vt/console code
- assorted notifier and cleanups in fbdev and backlight code

This is the pull request that was sent out, plus the compile fix for
sh4 reported by kbuild.

Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Maarten Lankhorst <[email protected]>
1  2 
drivers/gpu/vga/vga_switcheroo.c

index a48d810d6ccb040fc4e8775049cd30b2f2e323f5,65d7541c413a201c4d32bbb8fbf8f93cbd72022b..087304b1a5d71bcca55c4ba3b079d5d2b88bcfc6
@@@ -35,6 -35,7 +35,7 @@@
  #include <linux/debugfs.h>
  #include <linux/fb.h>
  #include <linux/fs.h>
+ #include <linux/fbcon.h>
  #include <linux/module.h>
  #include <linux/pci.h>
  #include <linux/pm_domain.h>
@@@ -133,6 -134,7 +134,6 @@@ static DEFINE_MUTEX(vgasr_mutex)
   * @delayed_switch_active: whether a delayed switch is pending
   * @delayed_client_id: client to which a delayed switch is pending
   * @debugfs_root: directory for vga_switcheroo debugfs interface
 - * @switch_file: file for vga_switcheroo debugfs interface
   * @registered_clients: number of registered GPUs
   *    (counting only vga clients, not audio clients)
   * @clients: list of registered clients
@@@ -151,6 -153,7 +152,6 @@@ struct vgasr_priv 
        enum vga_switcheroo_client_id delayed_client_id;
  
        struct dentry *debugfs_root;
 -      struct dentry *switch_file;
  
        int registered_clients;
        struct list_head clients;
  #define client_is_vga(c)              (!client_is_audio(c))
  #define client_id(c)          ((c)->id & ~ID_BIT_AUDIO)
  
 -static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv);
 +static void vga_switcheroo_debugfs_init(struct vgasr_priv *priv);
  static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv);
  
  /* only one switcheroo per system */
@@@ -734,14 -737,8 +735,8 @@@ static int vga_switchto_stage2(struct v
        if (!active->driver_power_control)
                set_audio_state(active->id, VGA_SWITCHEROO_OFF);
  
-       if (new_client->fb_info) {
-               struct fb_event event;
-               console_lock();
-               event.info = new_client->fb_info;
-               fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
-               console_unlock();
-       }
+       if (new_client->fb_info)
+               fbcon_remap_all(new_client->fb_info);
  
        mutex_lock(&vgasr_priv.mux_hw_lock);
        ret = vgasr_priv.handler->switchto(new_client->id);
@@@ -912,20 -909,38 +907,20 @@@ static const struct file_operations vga
  
  static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv)
  {
 -      debugfs_remove(priv->switch_file);
 -      priv->switch_file = NULL;
 -
 -      debugfs_remove(priv->debugfs_root);
 +      debugfs_remove_recursive(priv->debugfs_root);
        priv->debugfs_root = NULL;
  }
  
 -static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
 +static void vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
  {
 -      static const char mp[] = "/sys/kernel/debug";
 -
        /* already initialised */
        if (priv->debugfs_root)
 -              return 0;
 -      priv->debugfs_root = debugfs_create_dir("vgaswitcheroo", NULL);
 +              return;
  
 -      if (!priv->debugfs_root) {
 -              pr_err("Cannot create %s/vgaswitcheroo\n", mp);
 -              goto fail;
 -      }
 +      priv->debugfs_root = debugfs_create_dir("vgaswitcheroo", NULL);
  
 -      priv->switch_file = debugfs_create_file("switch", 0644,
 -                                              priv->debugfs_root, NULL,
 -                                              &vga_switcheroo_debugfs_fops);
 -      if (!priv->switch_file) {
 -              pr_err("cannot create %s/vgaswitcheroo/switch\n", mp);
 -              goto fail;
 -      }
 -      return 0;
 -fail:
 -      vga_switcheroo_debugfs_fini(priv);
 -      return -1;
 +      debugfs_create_file("switch", 0644, priv->debugfs_root, NULL,
 +                          &vga_switcheroo_debugfs_fops);
  }
  
  /**
This page took 0.072243 seconds and 4 git commands to generate.