diff options
| author | Dave Airlie <airlied@linux.ie> | 2009-08-19 01:21:57 -0400 |
|---|---|---|
| committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-09 16:29:41 -0400 |
| commit | 6ac3bd527007eeecb148b67ca47b21731fd8a503 (patch) | |
| tree | bce4a885075a26bf0980956017f9ff2c79c2703b | |
| parent | 6e19314cc98ab9ccc22c30d1c414984ac6de5ce2 (diff) | |
PCI/vgaarb: cleanup some warnings + cleanup some comments.
Fix some warnings reported in linux-next + also cleanup some
comment errors noticed by Pekka Paalanen.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
| -rw-r--r-- | drivers/gpu/vga/vgaarb.c | 11 | ||||
| -rw-r--r-- | include/linux/vgaarb.h | 49 |
2 files changed, 32 insertions, 28 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 199138f241e..1ac0c93603c 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
| @@ -609,7 +609,6 @@ void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes) | |||
| 609 | } | 609 | } |
| 610 | EXPORT_SYMBOL(vga_set_legacy_decoding); | 610 | EXPORT_SYMBOL(vga_set_legacy_decoding); |
| 611 | 611 | ||
| 612 | /* return number of active VGA devices */ | ||
| 613 | /* call with NULL to unregister */ | 612 | /* call with NULL to unregister */ |
| 614 | int vga_client_register(struct pci_dev *pdev, void *cookie, | 613 | int vga_client_register(struct pci_dev *pdev, void *cookie, |
| 615 | void (*irq_set_state)(void *cookie, bool state), | 614 | void (*irq_set_state)(void *cookie, bool state), |
| @@ -831,7 +830,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 831 | curr_pos += 5; | 830 | curr_pos += 5; |
| 832 | remaining -= 5; | 831 | remaining -= 5; |
| 833 | 832 | ||
| 834 | pr_devel("client 0x%X called 'lock'\n", (int)priv); | 833 | pr_devel("client 0x%p called 'lock'\n", priv); |
| 835 | 834 | ||
| 836 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { | 835 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { |
| 837 | ret_val = -EPROTO; | 836 | ret_val = -EPROTO; |
| @@ -867,7 +866,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 867 | curr_pos += 7; | 866 | curr_pos += 7; |
| 868 | remaining -= 7; | 867 | remaining -= 7; |
| 869 | 868 | ||
| 870 | pr_devel("client 0x%X called 'unlock'\n", (int)priv); | 869 | pr_devel("client 0x%p called 'unlock'\n", priv); |
| 871 | 870 | ||
| 872 | if (strncmp(curr_pos, "all", 3) == 0) | 871 | if (strncmp(curr_pos, "all", 3) == 0) |
| 873 | io_state = VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM; | 872 | io_state = VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM; |
| @@ -917,7 +916,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 917 | curr_pos += 8; | 916 | curr_pos += 8; |
| 918 | remaining -= 8; | 917 | remaining -= 8; |
| 919 | 918 | ||
| 920 | pr_devel("client 0x%X called 'trylock'\n", (int)priv); | 919 | pr_devel("client 0x%p called 'trylock'\n", priv); |
| 921 | 920 | ||
| 922 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { | 921 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { |
| 923 | ret_val = -EPROTO; | 922 | ret_val = -EPROTO; |
| @@ -960,7 +959,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 960 | 959 | ||
| 961 | curr_pos += 7; | 960 | curr_pos += 7; |
| 962 | remaining -= 7; | 961 | remaining -= 7; |
| 963 | pr_devel("client 0x%X called 'target'\n", (int)priv); | 962 | pr_devel("client 0x%p called 'target'\n", priv); |
| 964 | /* if target is default */ | 963 | /* if target is default */ |
| 965 | if (!strncmp(buf, "default", 7)) | 964 | if (!strncmp(buf, "default", 7)) |
| 966 | pdev = pci_dev_get(vga_default_device()); | 965 | pdev = pci_dev_get(vga_default_device()); |
| @@ -1014,7 +1013,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 1014 | } else if (strncmp(curr_pos, "decodes ", 8) == 0) { | 1013 | } else if (strncmp(curr_pos, "decodes ", 8) == 0) { |
| 1015 | curr_pos += 8; | 1014 | curr_pos += 8; |
| 1016 | remaining -= 8; | 1015 | remaining -= 8; |
| 1017 | pr_devel("vgaarb: client 0x%X called 'decodes'\n", (int)priv); | 1016 | pr_devel("vgaarb: client 0x%p called 'decodes'\n", priv); |
| 1018 | 1017 | ||
| 1019 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { | 1018 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { |
| 1020 | ret_val = -EPROTO; | 1019 | ret_val = -EPROTO; |
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h index 68229ce80fd..e81c64af80c 100644 --- a/include/linux/vgaarb.h +++ b/include/linux/vgaarb.h | |||
| @@ -46,9 +46,9 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev, | |||
| 46 | /** | 46 | /** |
| 47 | * vga_get - acquire & locks VGA resources | 47 | * vga_get - acquire & locks VGA resources |
| 48 | * | 48 | * |
| 49 | * pdev: pci device of the VGA card or NULL for the system default | 49 | * @pdev: pci device of the VGA card or NULL for the system default |
| 50 | * rsrc: bit mask of resources to acquire and lock | 50 | * @rsrc: bit mask of resources to acquire and lock |
| 51 | * interruptible: blocking should be interruptible by signals ? | 51 | * @interruptible: blocking should be interruptible by signals ? |
| 52 | * | 52 | * |
| 53 | * This function acquires VGA resources for the given | 53 | * This function acquires VGA resources for the given |
| 54 | * card and mark those resources locked. If the resource requested | 54 | * card and mark those resources locked. If the resource requested |
| @@ -81,19 +81,19 @@ extern int vga_get(struct pci_dev *pdev, unsigned int rsrc, | |||
| 81 | */ | 81 | */ |
| 82 | 82 | ||
| 83 | static inline int vga_get_interruptible(struct pci_dev *pdev, | 83 | static inline int vga_get_interruptible(struct pci_dev *pdev, |
| 84 | unsigned int rsrc) | 84 | unsigned int rsrc) |
| 85 | { | 85 | { |
| 86 | return vga_get(pdev, rsrc, 1); | 86 | return vga_get(pdev, rsrc, 1); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | /** | 89 | /** |
| 90 | * vga_get_interruptible | 90 | * vga_get_uninterruptible |
| 91 | * | 91 | * |
| 92 | * Shortcut to vga_get | 92 | * Shortcut to vga_get |
| 93 | */ | 93 | */ |
| 94 | 94 | ||
| 95 | static inline int vga_get_uninterruptible(struct pci_dev *pdev, | 95 | static inline int vga_get_uninterruptible(struct pci_dev *pdev, |
| 96 | unsigned int rsrc) | 96 | unsigned int rsrc) |
| 97 | { | 97 | { |
| 98 | return vga_get(pdev, rsrc, 0); | 98 | return vga_get(pdev, rsrc, 0); |
| 99 | } | 99 | } |
| @@ -165,28 +165,33 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2) | |||
| 165 | } | 165 | } |
| 166 | #endif | 166 | #endif |
| 167 | 167 | ||
| 168 | /* | 168 | /** |
| 169 | * Register a client with the VGA arbitration logic | 169 | * vga_client_register |
| 170 | * return value: number of VGA devices in system. | 170 | * |
| 171 | * | 171 | * @pdev: pci device of the VGA client |
| 172 | * Clients have two callback mechanisms they can use. | 172 | * @cookie: client cookie to be used in callbacks |
| 173 | * irq enable/disable callback - | 173 | * @irq_set_state: irq state change callback |
| 174 | * If a client can't disable its GPUs VGA resources, then we | 174 | * @set_vga_decode: vga decode change callback |
| 175 | * need to be able to ask it to turn off its irqs when we | 175 | * |
| 176 | * turn off its mem and io decoding. | 176 | * return value: 0 on success, -1 on failure |
| 177 | * set_vga_decode | 177 | * Register a client with the VGA arbitration logic |
| 178 | * If a client can disable its GPU VGA resource, it will | 178 | * |
| 179 | * get a callback from this to set the encode/decode state | 179 | * Clients have two callback mechanisms they can use. |
| 180 | * | 180 | * irq enable/disable callback - |
| 181 | * Clients with disable abilities should check the return value | 181 | * If a client can't disable its GPUs VGA resources, then we |
| 182 | * of this function and if the VGA device count is > 1, should | 182 | * need to be able to ask it to turn off its irqs when we |
| 183 | * disable VGA decoding resources. | 183 | * turn off its mem and io decoding. |
| 184 | * set_vga_decode | ||
| 185 | * If a client can disable its GPU VGA resource, it will | ||
| 186 | * get a callback from this to set the encode/decode state | ||
| 184 | * | 187 | * |
| 185 | * Rationale: we cannot disable VGA decode resources unconditionally | 188 | * Rationale: we cannot disable VGA decode resources unconditionally |
| 186 | * some single GPU laptops seem to require ACPI or BIOS access to the | 189 | * some single GPU laptops seem to require ACPI or BIOS access to the |
| 187 | * VGA registers to control things like backlights etc. | 190 | * VGA registers to control things like backlights etc. |
| 188 | * Hopefully newer multi-GPU laptops do something saner, and desktops | 191 | * Hopefully newer multi-GPU laptops do something saner, and desktops |
| 189 | * won't have any special ACPI for this. | 192 | * won't have any special ACPI for this. |
| 193 | * They driver will get a callback when VGA arbitration is first used | ||
| 194 | * by userspace since we some older X servers have issues. | ||
| 190 | */ | 195 | */ |
| 191 | int vga_client_register(struct pci_dev *pdev, void *cookie, | 196 | int vga_client_register(struct pci_dev *pdev, void *cookie, |
| 192 | void (*irq_set_state)(void *cookie, bool state), | 197 | void (*irq_set_state)(void *cookie, bool state), |
