diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-11 07:51:17 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-13 11:24:09 +0200 |
commit | 26ec685ff9d9c16525d8ec4c97e52fcdb187b302 (patch) | |
tree | 2536e4fd8fc9b41736c481822fb032a4e4efc81a /drivers/gpu/drm/nouveau | |
parent | 79721e0a91b5e8f662f12eeb50ea205c761e6bf8 (diff) | |
download | op-kernel-dev-26ec685ff9d9c16525d8ec4c97e52fcdb187b302.zip op-kernel-dev-26ec685ff9d9c16525d8ec4c97e52fcdb187b302.tar.gz |
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/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index c2a8511..298c09b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -662,6 +662,12 @@ error: return ret; } +static const struct vga_switcheroo_client_ops nouveau_switcheroo_ops = { + .set_gpu_state = nouveau_switcheroo_set_state, + .reprobe = nouveau_switcheroo_reprobe, + .can_switch = nouveau_switcheroo_can_switch, +}; + int nouveau_card_init(struct drm_device *dev) { @@ -670,9 +676,7 @@ nouveau_card_init(struct drm_device *dev) int ret, e = 0; vga_client_register(dev->pdev, dev, NULL, nouveau_vga_set_decode); - vga_switcheroo_register_client(dev->pdev, nouveau_switcheroo_set_state, - nouveau_switcheroo_reprobe, - nouveau_switcheroo_can_switch); + vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops); /* Initialise internal driver API hooks */ ret = nouveau_init_engine_ptrs(dev); |