summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-05-11 07:51:17 +0200
committerTakashi Iwai <tiwai@suse.de>2012-05-13 11:24:09 +0200
commit26ec685ff9d9c16525d8ec4c97e52fcdb187b302 (patch)
tree2536e4fd8fc9b41736c481822fb032a4e4efc81a /drivers/gpu/drm/i915/i915_dma.c
parent79721e0a91b5e8f662f12eeb50ea205c761e6bf8 (diff)
downloadlinux-26ec685ff9d9c16525d8ec4c97e52fcdb187b302.tar.gz
linux-26ec685ff9d9c16525d8ec4c97e52fcdb187b302.tar.bz2
linux-26ec685ff9d9c16525d8ec4c97e52fcdb187b302.zip
vga_switcheroo: Introduce struct vga_switcheroo_client_ops
This changes the API as a clean-up. Instead of passing multiple function pointers at each time, introduce a new struct holding the whole callback functions and pass it to the registration. The same struct will be used for the upcoming audio client registration, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 006ea473b57d..42d91e841629 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1271,6 +1271,12 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
return can_switch;
}
+static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
+ .set_gpu_state = i915_switcheroo_set_state,
+ .reprobe = NULL,
+ .can_switch = i915_switcheroo_can_switch,
+};
+
static int i915_load_modeset_init(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1293,10 +1299,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
intel_register_dsm_handler();
- ret = vga_switcheroo_register_client(dev->pdev,
- i915_switcheroo_set_state,
- NULL,
- i915_switcheroo_can_switch);
+ ret = vga_switcheroo_register_client(dev->pdev, &i915_switcheroo_ops);
if (ret)
goto cleanup_vga_client;