From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/5] nouveau: Add interface to detect optimus support
Date: Mon, 10 Sep 2012 14:31:53 +1000 [thread overview]
Message-ID: <1347251515-10136-4-git-send-email-airlied@gmail.com> (raw)
In-Reply-To: <1347251515-10136-1-git-send-email-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
This is required for later patches.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/nouveau/nouveau_acpi.c | 4 ++++
drivers/gpu/drm/nouveau/nouveau_acpi.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index e7369c8..b92833e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -35,6 +35,10 @@ static struct nouveau_dsm_priv {
acpi_handle rom_handle;
} nouveau_dsm_priv;
+bool nouveau_is_optimus(void) {
+ return nouveau_dsm_priv.optimus_detected;
+}
+
#define NOUVEAU_DSM_HAS_MUX 0x1
#define NOUVEAU_DSM_HAS_OPT 0x2
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.h b/drivers/gpu/drm/nouveau/nouveau_acpi.h
index 08af677..c70b4d1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.h
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.h
@@ -4,6 +4,7 @@
#define ROM_BIOS_PAGE 4096
#if defined(CONFIG_ACPI)
+bool nouveau_is_optimus(void);
void nouveau_register_dsm_handler(void);
void nouveau_unregister_dsm_handler(void);
void nouveau_switcheroo_optimus_dsm(void);
@@ -11,6 +12,7 @@ int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len);
bool nouveau_acpi_rom_supported(struct pci_dev *pdev);
void *nouveau_acpi_edid(struct drm_device *, struct drm_connector *);
#else
+static inline bool nouveau_is_optimus(void) { return false; };
static inline void nouveau_register_dsm_handler(void) {}
static inline void nouveau_unregister_dsm_handler(void) {}
static inline void nouveau_switcheroo_optimus_dsm(void) {}
--
1.7.12
next prev parent reply other threads:[~2012-09-10 4:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 4:31 [RFC] drm dynamic power off support Dave Airlie
2012-09-10 4:31 ` [PATCH 1/5] gpu/vga_switcheroo: add driver control power feature Dave Airlie
2012-09-10 4:31 ` [PATCH 2/5] drm: Add initial dnyamic power off feature Dave Airlie
2012-09-10 7:18 ` Daniel Vetter
2012-09-10 8:23 ` Dave Airlie
2012-09-10 8:36 ` Chris Wilson
2012-09-10 10:55 ` Alan Cox
2012-09-10 9:00 ` Daniel Vetter
2012-09-10 11:07 ` Alan Cox
2012-09-10 11:16 ` Dave Airlie
2012-09-10 4:31 ` Dave Airlie [this message]
2012-09-10 16:25 ` [PATCH 3/5] nouveau: Add interface to detect optimus support Lekensteyn
2012-09-10 20:24 ` Dave Airlie
2012-09-10 4:31 ` [PATCH 4/5] nouveau: add dynamic gpu power off support Dave Airlie
2012-09-10 16:30 ` Peter Wu
2012-09-10 4:31 ` [PATCH 5/5] radeon: add dynamic " Dave Airlie
2012-09-10 5:04 ` [RFC] drm " Dave Airlie
2012-09-10 8:47 ` Takashi Iwai
2012-09-10 8:50 ` Dave Airlie
2012-09-11 13:32 ` Takashi Iwai
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=1347251515-10136-4-git-send-email-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/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