All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 03/15] vga_switcheroo: Set active attribute to false for audio clients
Date: Thu, 27 Aug 2015 16:43:43 +0200	[thread overview]
Message-ID: <a5c2f125f6eaa47c4aa6d8801de31d1301c8a542.1442497843.git.lukas@wunner.de> (raw)
In-Reply-To: <37cbdedaac83c189ae35b9627a403e0e25b07bb0.1442497843.git.lukas@wunner.de>

The active attribute in struct vga_switcheroo_client denotes whether
the outputs are currently switched to this client. The attribute is
only meaningful for vga clients. It is never used for audio clients.

The function vga_switcheroo_register_audio_client() misuses this
attribute to store whether the audio device is fully initialized.
Most likely there was a misunderstanding about the meaning of
"active" when this was added.

Set the active attribute to false for audio clients. Remove the
active parameter from vga_switcheroo_register_audio_client() and
its sole caller, hda_intel.c:register_vga_switcheroo().

vga_switcheroo_register_audio_client() was introduced by 3e9e63dbd374
("vga_switcheroo: Add the support for audio clients"). Its use in
hda_intel.c was introduced by a82d51ed24bb ("ALSA: hda - Support
VGA-switcheroo").

Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
---
 drivers/gpu/vga/vga_switcheroo.c | 5 ++---
 include/linux/vga_switcheroo.h   | 4 ++--
 sound/pci/hda/hda_intel.c        | 3 +--
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index b19a72f..fe32536 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -290,7 +290,6 @@ EXPORT_SYMBOL(vga_switcheroo_register_client);
  * @pdev: client pci device
  * @ops: client callbacks
  * @id: client identifier, see enum vga_switcheroo_client_id
- * @active: whether the audio device is fully initialized
  *
  * Register audio client (audio device on a GPU). The power state of the
  * client is assumed to be ON.
@@ -299,9 +298,9 @@ EXPORT_SYMBOL(vga_switcheroo_register_client);
  */
 int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
 					 const struct vga_switcheroo_client_ops *ops,
-					 int id, bool active)
+					 int id)
 {
-	return register_client(pdev, ops, id | ID_BIT_AUDIO, active, false);
+	return register_client(pdev, ops, id | ID_BIT_AUDIO, false, false);
 }
 EXPORT_SYMBOL(vga_switcheroo_register_audio_client);
 
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index fe90bfc..3764991 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -128,7 +128,7 @@ int vga_switcheroo_register_client(struct pci_dev *dev,
 				   bool driver_power_control);
 int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
 					 const struct vga_switcheroo_client_ops *ops,
-					 int id, bool active);
+					 int id);
 
 void vga_switcheroo_client_fb_set(struct pci_dev *dev,
 				  struct fb_info *info);
@@ -154,7 +154,7 @@ static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_i
 static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
 static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
 	const struct vga_switcheroo_client_ops *ops,
-	int id, bool active) { return 0; }
+	int id) { return 0; }
 static inline void vga_switcheroo_unregister_handler(void) {}
 static inline int vga_switcheroo_process_delayed_switch(void) { return 0; }
 static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c38c68f..e819013 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1143,8 +1143,7 @@ static int register_vga_switcheroo(struct azx *chip)
 	 * is there any machine with two switchable HDMI audio controllers?
 	 */
 	err = vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops,
-						    VGA_SWITCHEROO_DIS,
-						    hda->probe_continued);
+						   VGA_SWITCHEROO_DIS);
 	if (err < 0)
 		return err;
 	hda->vga_switcheroo_registered = 1;
-- 
1.8.5.2 (Apple Git-48)

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-09-17 15:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23 13:18 [PATCH 01/15] vga_switcheroo: Document _ALL_ the things! Lukas Wunner
2015-08-29 12:29 ` [PATCH 02/15] DocBook: Add vga_switcheroo Subsystem Guide Lukas Wunner
2015-08-27 14:43   ` Lukas Wunner [this message]
2015-08-23 21:23     ` [PATCH 04/15] vga_switcheroo: Add missing locking Lukas Wunner
2015-09-08 12:17       ` [PATCH 05/15] vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT Lukas Wunner
2015-08-28  9:56         ` [PATCH 06/15] vga_switcheroo: Use enum vga_switcheroo_state instead of int Lukas Wunner
2015-08-28 11:30           ` [PATCH 07/15] vga_switcheroo: Use VGA_SWITCHEROO_UNKNOWN_ID instead of -1 Lukas Wunner
2015-08-28 10:54             ` [PATCH 08/15] vga_switcheroo: Use enum vga_switcheroo_client_id instead of int Lukas Wunner
2015-09-05 11:40               ` [PATCH 09/15] vga_switcheroo: Sort headers alphabetically Lukas Wunner
2015-09-04 18:49                 ` [PATCH 10/15] ALSA: hda - Spell vga_switcheroo consistently Lukas Wunner
2015-09-04 19:06                   ` [PATCH 11/15] drm/i915: " Lukas Wunner
2015-09-05  9:09                     ` [PATCH 12/15] drm/nouveau: " Lukas Wunner
2015-09-05  9:14                       ` [PATCH 13/15] drm/radeon: " Lukas Wunner
2015-09-05  9:17                         ` [PATCH 14/15] drm/amdgpu: " Lukas Wunner
2015-09-05  9:22                           ` [PATCH 15/15] drm: " Lukas Wunner
2015-09-22  9:20                             ` Daniel Vetter
2015-09-23 21:45                           ` [PATCH 14/15] drm/amdgpu: " Alex Deucher
2015-09-22  9:20                     ` [PATCH 11/15] drm/i915: " Daniel Vetter
2015-10-02  7:35           ` [PATCH 06/15] vga_switcheroo: Use enum vga_switcheroo_state instead of int Jani Nikula
2015-10-02  8:22         ` [PATCH 05/15] vga_switcheroo: Drop client power state VGA_SWITCHEROO_INIT Daniel Vetter
2015-10-25 18:19           ` Lukas Wunner
2015-10-26  7:24             ` Takashi Iwai
2015-08-27 14:43     ` [PATCH v1.1 03/15] vga_switcheroo: Set active attribute to false for audio clients Lukas Wunner
2015-09-23  7:13       ` Daniel Vetter
2015-09-24  9:40         ` Takashi Iwai
2015-09-24 15:13           ` Daniel Vetter
2015-10-01 16:19             ` Lukas Wunner
2015-09-24  9:37       ` Takashi Iwai
2015-09-17 17:15     ` [PATCH " Lukas Wunner
2015-09-22  9:17       ` Daniel Vetter
2015-09-19 16:44     ` Takashi Iwai
2015-09-19 17:50       ` Lukas Wunner
2015-09-24  9:39         ` Takashi Iwai
2015-09-22  8:38   ` [PATCH 02/15] DocBook: Add vga_switcheroo Subsystem Guide Daniel Vetter
2015-09-17 16:34 ` [PATCH 01/15] vga_switcheroo: Document _ALL_ the things! Danilo Cesar Lemes de Paula
2015-09-17 17:31   ` Lukas Wunner
2015-09-17 17:56     ` Danilo Cesar Lemes de Paula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5c2f125f6eaa47c4aa6d8801de31d1301c8a542.1442497843.git.lukas@wunner.de \
    --to=lukas@wunner.de \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.