From: Zhenyu Wang Date: Thu, 15 Apr 2010 14:57:02 +0000 (+0800) Subject: Add PCH chipset type check for Cougarpoint X-Git-Tag: 1.1~307 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b40fc83d130d2850761aa1409e0716ace6dfe0b;p=profile%2Fextras%2Fintel-gpu-tools.git Add PCH chipset type check for Cougarpoint Signed-off-by: Zhenyu Wang --- diff --git a/lib/intel_gpu_tools.h b/lib/intel_gpu_tools.h index 0251031..acee657 100644 --- a/lib/intel_gpu_tools.h +++ b/lib/intel_gpu_tools.h @@ -54,3 +54,13 @@ struct pci_device *intel_get_pci_device(void); uint32_t intel_get_drm_devid(int fd); void intel_map_file(char *); + +enum pch_type { + PCH_IBX, + PCH_CPT, +}; + +extern enum pch_type pch; +void intel_check_pch(void); + +#define HAS_CPT (pch == PCH_CPT) diff --git a/lib/intel_pci.c b/lib/intel_pci.c index 3bfacb5..db436be 100644 --- a/lib/intel_pci.c +++ b/lib/intel_pci.c @@ -39,6 +39,8 @@ #include "intel_gpu_tools.h" +enum pch_type pch; + struct pci_device * intel_get_pci_device(void) { @@ -69,3 +71,18 @@ intel_get_pci_device(void) return pci_dev; } + +void +intel_check_pch(void) +{ + struct pci_device *pch_dev; + + pch_dev = pci_device_find_by_slot(0, 0, 31, 0); + if (pch_dev == NULL) + return; + + if (pch_dev->vendor_id == 0x8086 && + (pch_dev->device_id & 0xff00) == 0x1c00) + pch = PCH_CPT; +} +