From: Paulo Zanoni <przanoni@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH IGT 1/6] lib: detect PCH_LPT and PCH_NONE
Date: Fri, 1 Mar 2013 17:44:17 -0300 [thread overview]
Message-ID: <1362170662-651-1-git-send-email-przanoni@gmail.com> (raw)
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
So we don't assign PCH_IBX to anything that's not PCH_CPT nor PCH_LPT.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
lib/intel_gpu_tools.h | 4 ++++
lib/intel_pci.c | 21 ++++++++++++++++++---
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lib/intel_gpu_tools.h b/lib/intel_gpu_tools.h
index 245d1de..ced84c8 100644
--- a/lib/intel_gpu_tools.h
+++ b/lib/intel_gpu_tools.h
@@ -92,13 +92,17 @@ uint64_t intel_get_total_swap_mb(void);
void intel_map_file(char *);
enum pch_type {
+ PCH_NONE,
PCH_IBX,
PCH_CPT,
+ PCH_LPT,
};
extern enum pch_type pch;
void intel_check_pch(void);
+#define HAS_IBX (pch == PCH_IBX)
#define HAS_CPT (pch == PCH_CPT)
+#define HAS_LPT (pch == PCH_LPT)
#endif /* INTEL_GPU_TOOLS_H */
diff --git a/lib/intel_pci.c b/lib/intel_pci.c
index 704c87a..e60e0d3 100644
--- a/lib/intel_pci.c
+++ b/lib/intel_pci.c
@@ -100,9 +100,24 @@ intel_check_pch(void)
if (pch_dev == NULL)
return;
- if (pch_dev->vendor_id == 0x8086 &&
- (((pch_dev->device_id & 0xff00) == 0x1c00) ||
- (pch_dev->device_id & 0xff00) == 0x1e00))
+ if (pch_dev->vendor_id != 0x8086)
+ return;
+
+ switch (pch_dev->device_id & 0xff00) {
+ case 0x3b00:
+ pch = PCH_IBX;
+ break;
+ case 0x1c00:
+ case 0x1e00:
pch = PCH_CPT;
+ break;
+ case 0x8c00:
+ case 0x9c00:
+ pch = PCH_LPT;
+ break;
+ default:
+ pch = PCH_NONE;
+ return;
+ }
}
--
1.7.10.4
next reply other threads:[~2013-03-01 20:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-01 20:44 Paulo Zanoni [this message]
2013-03-01 20:44 ` [PATCH IGT 2/6] intel_reg_dumper: recognize LPT Paulo Zanoni
2013-03-05 11:50 ` Damien Lespiau
2013-03-05 16:05 ` Paulo Zanoni
2013-03-05 16:39 ` Damien Lespiau
2013-03-01 20:44 ` [PATCH IGT 3/6] intel_reg_dumper: make Haswell dump useful Paulo Zanoni
2013-03-01 20:44 ` [PATCH IGT 4/6] intel_reg_dumper: decode some useful Haswell registers Paulo Zanoni
2013-03-01 20:44 ` [PATCH IGT 5/6] intel_reg_dumper: dump HSW watermark registers Paulo Zanoni
2013-03-01 20:44 ` [PATCH IGT 6/6] lib: fix HAS_PCH_SPLIT check Paulo Zanoni
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=1362170662-651-1-git-send-email-przanoni@gmail.com \
--to=przanoni@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/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