mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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>
This commit is contained in:
parent
6e19314cc9
commit
6ac3bd5270
2 changed files with 30 additions and 26 deletions
|
@ -609,7 +609,6 @@ void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(vga_set_legacy_decoding);
|
EXPORT_SYMBOL(vga_set_legacy_decoding);
|
||||||
|
|
||||||
/* return number of active VGA devices */
|
|
||||||
/* call with NULL to unregister */
|
/* call with NULL to unregister */
|
||||||
int vga_client_register(struct pci_dev *pdev, void *cookie,
|
int vga_client_register(struct pci_dev *pdev, void *cookie,
|
||||||
void (*irq_set_state)(void *cookie, bool state),
|
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,
|
||||||
curr_pos += 5;
|
curr_pos += 5;
|
||||||
remaining -= 5;
|
remaining -= 5;
|
||||||
|
|
||||||
pr_devel("client 0x%X called 'lock'\n", (int)priv);
|
pr_devel("client 0x%p called 'lock'\n", priv);
|
||||||
|
|
||||||
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
||||||
ret_val = -EPROTO;
|
ret_val = -EPROTO;
|
||||||
|
@ -867,7 +866,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
|
||||||
curr_pos += 7;
|
curr_pos += 7;
|
||||||
remaining -= 7;
|
remaining -= 7;
|
||||||
|
|
||||||
pr_devel("client 0x%X called 'unlock'\n", (int)priv);
|
pr_devel("client 0x%p called 'unlock'\n", priv);
|
||||||
|
|
||||||
if (strncmp(curr_pos, "all", 3) == 0)
|
if (strncmp(curr_pos, "all", 3) == 0)
|
||||||
io_state = VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM;
|
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,
|
||||||
curr_pos += 8;
|
curr_pos += 8;
|
||||||
remaining -= 8;
|
remaining -= 8;
|
||||||
|
|
||||||
pr_devel("client 0x%X called 'trylock'\n", (int)priv);
|
pr_devel("client 0x%p called 'trylock'\n", priv);
|
||||||
|
|
||||||
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
||||||
ret_val = -EPROTO;
|
ret_val = -EPROTO;
|
||||||
|
@ -960,7 +959,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
|
||||||
|
|
||||||
curr_pos += 7;
|
curr_pos += 7;
|
||||||
remaining -= 7;
|
remaining -= 7;
|
||||||
pr_devel("client 0x%X called 'target'\n", (int)priv);
|
pr_devel("client 0x%p called 'target'\n", priv);
|
||||||
/* if target is default */
|
/* if target is default */
|
||||||
if (!strncmp(buf, "default", 7))
|
if (!strncmp(buf, "default", 7))
|
||||||
pdev = pci_dev_get(vga_default_device());
|
pdev = pci_dev_get(vga_default_device());
|
||||||
|
@ -1014,7 +1013,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
|
||||||
} else if (strncmp(curr_pos, "decodes ", 8) == 0) {
|
} else if (strncmp(curr_pos, "decodes ", 8) == 0) {
|
||||||
curr_pos += 8;
|
curr_pos += 8;
|
||||||
remaining -= 8;
|
remaining -= 8;
|
||||||
pr_devel("vgaarb: client 0x%X called 'decodes'\n", (int)priv);
|
pr_devel("vgaarb: client 0x%p called 'decodes'\n", priv);
|
||||||
|
|
||||||
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) {
|
||||||
ret_val = -EPROTO;
|
ret_val = -EPROTO;
|
||||||
|
|
|
@ -46,9 +46,9 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
|
||||||
/**
|
/**
|
||||||
* vga_get - acquire & locks VGA resources
|
* vga_get - acquire & locks VGA resources
|
||||||
*
|
*
|
||||||
* pdev: pci device of the VGA card or NULL for the system default
|
* @pdev: pci device of the VGA card or NULL for the system default
|
||||||
* rsrc: bit mask of resources to acquire and lock
|
* @rsrc: bit mask of resources to acquire and lock
|
||||||
* interruptible: blocking should be interruptible by signals ?
|
* @interruptible: blocking should be interruptible by signals ?
|
||||||
*
|
*
|
||||||
* This function acquires VGA resources for the given
|
* This function acquires VGA resources for the given
|
||||||
* card and mark those resources locked. If the resource requested
|
* 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,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int vga_get_interruptible(struct pci_dev *pdev,
|
static inline int vga_get_interruptible(struct pci_dev *pdev,
|
||||||
unsigned int rsrc)
|
unsigned int rsrc)
|
||||||
{
|
{
|
||||||
return vga_get(pdev, rsrc, 1);
|
return vga_get(pdev, rsrc, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vga_get_interruptible
|
* vga_get_uninterruptible
|
||||||
*
|
*
|
||||||
* Shortcut to vga_get
|
* Shortcut to vga_get
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int vga_get_uninterruptible(struct pci_dev *pdev,
|
static inline int vga_get_uninterruptible(struct pci_dev *pdev,
|
||||||
unsigned int rsrc)
|
unsigned int rsrc)
|
||||||
{
|
{
|
||||||
return vga_get(pdev, rsrc, 0);
|
return vga_get(pdev, rsrc, 0);
|
||||||
}
|
}
|
||||||
|
@ -165,28 +165,33 @@ static inline int vga_conflicts(struct pci_dev *p1, struct pci_dev *p2)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Register a client with the VGA arbitration logic
|
* vga_client_register
|
||||||
* return value: number of VGA devices in system.
|
|
||||||
*
|
*
|
||||||
* Clients have two callback mechanisms they can use.
|
* @pdev: pci device of the VGA client
|
||||||
* irq enable/disable callback -
|
* @cookie: client cookie to be used in callbacks
|
||||||
* If a client can't disable its GPUs VGA resources, then we
|
* @irq_set_state: irq state change callback
|
||||||
* need to be able to ask it to turn off its irqs when we
|
* @set_vga_decode: vga decode change callback
|
||||||
* turn off its mem and io decoding.
|
|
||||||
* set_vga_decode
|
|
||||||
* If a client can disable its GPU VGA resource, it will
|
|
||||||
* get a callback from this to set the encode/decode state
|
|
||||||
*
|
*
|
||||||
* Clients with disable abilities should check the return value
|
* return value: 0 on success, -1 on failure
|
||||||
* of this function and if the VGA device count is > 1, should
|
* Register a client with the VGA arbitration logic
|
||||||
* disable VGA decoding resources.
|
*
|
||||||
|
* Clients have two callback mechanisms they can use.
|
||||||
|
* irq enable/disable callback -
|
||||||
|
* If a client can't disable its GPUs VGA resources, then we
|
||||||
|
* need to be able to ask it to turn off its irqs when we
|
||||||
|
* turn off its mem and io decoding.
|
||||||
|
* set_vga_decode
|
||||||
|
* If a client can disable its GPU VGA resource, it will
|
||||||
|
* get a callback from this to set the encode/decode state
|
||||||
*
|
*
|
||||||
* Rationale: we cannot disable VGA decode resources unconditionally
|
* Rationale: we cannot disable VGA decode resources unconditionally
|
||||||
* some single GPU laptops seem to require ACPI or BIOS access to the
|
* some single GPU laptops seem to require ACPI or BIOS access to the
|
||||||
* VGA registers to control things like backlights etc.
|
* VGA registers to control things like backlights etc.
|
||||||
* Hopefully newer multi-GPU laptops do something saner, and desktops
|
* Hopefully newer multi-GPU laptops do something saner, and desktops
|
||||||
* won't have any special ACPI for this.
|
* won't have any special ACPI for this.
|
||||||
|
* They driver will get a callback when VGA arbitration is first used
|
||||||
|
* by userspace since we some older X servers have issues.
|
||||||
*/
|
*/
|
||||||
int vga_client_register(struct pci_dev *pdev, void *cookie,
|
int vga_client_register(struct pci_dev *pdev, void *cookie,
|
||||||
void (*irq_set_state)(void *cookie, bool state),
|
void (*irq_set_state)(void *cookie, bool state),
|
||||||
|
|
Loading…
Reference in a new issue