From: Paul Mundt <lethal@linux-sh.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: James Simmons <jsimmons@infradead.org>,
Luca Tettamanti <kronos.it@gmail.com>,
Matthew Garrett <mjg59@srcf.ucam.org>,
Linux PCI <linux-pci@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
pm list <linux-pm@lists.linux-foundation.org>,
dri-devel@lists.sourceforge.net
Subject: Re: [Q] How to tell we're using the KMS (during suspend/resume) outside the graphics driver
Date: Wed, 10 Mar 2010 14:50:14 +0900 [thread overview]
Message-ID: <20100310055013.GC19518@linux-sh.org> (raw)
In-Reply-To: <201003092208.28175.rjw@sisk.pl>
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.
next prev parent reply other threads:[~2010-03-10 5:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-06 21:36 [Q] How to tell we're using the KMS (during suspend/resume) outside the graphics driver Rafael J. Wysocki
2010-03-09 11:01 ` Luca Tettamanti
2010-03-09 11:34 ` Rafael J. Wysocki
2010-03-09 11:38 ` Rafał Miłecki
2010-03-09 16:16 ` James Simmons
2010-03-09 21:08 ` Rafael J. Wysocki
2010-03-10 5:50 ` Paul Mundt [this message]
2010-03-10 10:54 ` Pauli Nieminen
2010-03-10 20:56 ` Matthew Garrett
2010-03-10 21:15 ` Rafael J. Wysocki
2010-03-10 21:17 ` Matthew Garrett
2010-04-06 7:47 ` Rafał Miłecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100310055013.GC19518@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=dri-devel@lists.sourceforge.net \
--cc=jbarnes@virtuousgeek.org \
--cc=jsimmons@infradead.org \
--cc=kronos.it@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mjg59@srcf.ucam.org \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox