[PATCH] libpciaccess/vgaarb: add function to get default vga device and it's decodes.

Julien Cristau jcristau at debian.org
Sun Apr 24 15:17:48 UTC 2016


On Thu, Apr 21, 2016 at 15:22:36 +0200, Stefan Dirsch wrote:

> From: Egbert Eich <eich at freedesktop.org>
> 
> Reenable default device when shutting down VGA arbitration.
> https://bugzilla.opensuse.org/show_bug.cgi?id=714677
> ---
>  src/common_vgaarb.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
I don't understand how the patch description relates to the patch.  This
doesn't seem to add a function...

Cheers,
Julien

> diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c
> index 7a7d204..2c0686e 100644
> --- a/src/common_vgaarb.c
> +++ b/src/common_vgaarb.c
> @@ -156,6 +156,11 @@ pci_device_vgaarb_fini(void)
>  {
>      if (!pci_sys)
>          return;
> +    if (pci_device_vgaarb_set_target(NULL) < 0 ||
> +	pci_device_vgaarb_lock() < 0 ||
> +	pci_device_vgaarb_unlock() < 0) {
> +	fprintf(stderr, "VGA Arbitration: Cannot restore default device.\n");
> +    }
>  
>      close(pci_sys->vgaarb_fd);
>  }
> @@ -334,6 +339,10 @@ pci_device_vgaarb_unlock(void)
>  int pci_device_vgaarb_get_info(struct pci_device *dev, int *vga_count, int *rsrc_decodes)
>  {
>      *vga_count = pci_sys->vga_count;
> +    if (!rsrc_decodes)
> +        return 0;
> +    if (!dev)
> +        dev = pci_sys->vga_default_dev;
>      if (!dev)
>          return 0;
>  
> -- 
> 2.6.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list