lkml.org 
[lkml]   [2010]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] pci: Update pci_set_vga_state to call arch functions
On Mon, 18 Jan 2010 12:34:13 -0600
Mike Travis <travis@sgi.com> wrote:

> Update pci_set_vga_state to call arch dependent functions to enable
> Legacy VGA I/O transactions to be redirected to correct target.
>

Changelog doesn't explain the reason for doing this, but it looks like
that becomes clearer in later patches.

>
> +/* Some architectures require additional programming to enable VGA */
> +static arch_set_vga_state_t arch_set_vga_state;
> +
> +void pci_register_set_vga_state(arch_set_vga_state_t func)
> +{
> + arch_set_vga_state = func; /* NULL disables */
> +}
> +
> +static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
> + unsigned int command_bits, bool change_bridge)
> +{
> + if (arch_set_vga_state)
> + return arch_set_vga_state(dev, decode, command_bits,
> + change_bridge);
> + return 0;
> +}

hm, that's not terribly elegant. It's racy too, although it seems
unlikely that an arch will call pci_set_vga_state_arch() more than
once.

Still, a neater solution might be

int arch_pci_set_vga_state(...) __weak
{
return 0;
}

and then resolve it at linkage time?




\
 
 \ /
  Last update: 2010-01-26 00:57    [W:0.045 / U:3.544 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site