lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Mar 2010 14:50:14 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	James Simmons <jsimmons@...radead.org>,
	Luca Tettamanti <kronos.it@...il.com>,
	Matthew Garrett <mjg59@...f.ucam.org>,
	Linux PCI <linux-pci@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	pm list <linux-pm@...ts.linux-foundation.org>,
	dri-devel@...ts.sourceforge.net
Subject: Re: [Q] How to tell we're using the KMS (during suspend/resume) outside the graphics driver

On Tue, Mar 09, 2010 at 10:08:28PM +0100, Rafael J. Wysocki wrote:
> On Tuesday 09 March 2010, James Simmons wrote:
> > 
> > > > > Second, in the KMS case, we'd be able to skip the kernel VT switch, because
> > > > > the KMS driver uses its own framebuffer anyway.
> > > > >
> > > > > So, is there any reasonable way to check that from the outside of the graphics
> > > > > driver?  It should be general enough to cover the cases when there are two
> > > > > graphics adapters with different drivers in the system and so forth.
> > > > 
> > > > Inside the kernel? If you have a struct pci_dev you can get the
> > > > associated struct drm_device with pci_get_drvdata and then check the
> > > > KMS feature: drm_core_check_feature(dev, DRIVER_MODESET).
> > > 
> > > Yeah, I know that.
> > > 
> > > > I'm note sure how to check that a device is graphic card though :|
> > > 
> > > Well, that's the "outside of the graphics driver" part of my question. :-)
> > 
> > if ((pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
> > 	....
> 
> I'm not sure if searching through all PCI devices really is an option.
> 
Why not? The VGA arbitration code tracks a list of VGA class devices, so
could easily be queried. It looks like it might need a bit more work for
PCI hotplug, but it should already have all of the infrastructure you
need for getting at the pdev for the suspend/resume case.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ