diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-11 01:51:17 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-13 05:24:09 -0400 |
commit | 26ec685ff9d9c16525d8ec4c97e52fcdb187b302 (patch) | |
tree | 2536e4fd8fc9b41736c481822fb032a4e4efc81a /drivers/gpu/drm/radeon | |
parent | 79721e0a91b5e8f662f12eeb50ea205c761e6bf8 (diff) |
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/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index e1bc7e96f29c..3d41525c1bcf 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -697,6 +697,11 @@ static bool radeon_switcheroo_can_switch(struct pci_dev *pdev) | |||
697 | return can_switch; | 697 | return can_switch; |
698 | } | 698 | } |
699 | 699 | ||
700 | static const struct vga_switcheroo_client_ops radeon_switcheroo_ops = { | ||
701 | .set_gpu_state = radeon_switcheroo_set_state, | ||
702 | .reprobe = NULL, | ||
703 | .can_switch = radeon_switcheroo_can_switch, | ||
704 | }; | ||
700 | 705 | ||
701 | int radeon_device_init(struct radeon_device *rdev, | 706 | int radeon_device_init(struct radeon_device *rdev, |
702 | struct drm_device *ddev, | 707 | struct drm_device *ddev, |
@@ -809,10 +814,7 @@ int radeon_device_init(struct radeon_device *rdev, | |||
809 | /* this will fail for cards that aren't VGA class devices, just | 814 | /* this will fail for cards that aren't VGA class devices, just |
810 | * ignore it */ | 815 | * ignore it */ |
811 | vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); | 816 | vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode); |
812 | vga_switcheroo_register_client(rdev->pdev, | 817 | vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops); |
813 | radeon_switcheroo_set_state, | ||
814 | NULL, | ||
815 | radeon_switcheroo_can_switch); | ||
816 | 818 | ||
817 | r = radeon_init(rdev); | 819 | r = radeon_init(rdev); |
818 | if (r) | 820 | if (r) |