Chris Wilson complained that this adds a lot of noise to the test
startup when full debugging is enabled, so let's cache it. We can do
that since there's only ever one intel gpu in a given system.

Cc: Chris Wilson <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
---
 lib/intel_chipset.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c
index fafd232f89c0..64d66eb29bae 100644
--- a/lib/intel_chipset.c
+++ b/lib/intel_chipset.c
@@ -125,9 +125,12 @@ intel_get_pci_device(void)
 uint32_t
 intel_get_drm_devid(int fd)
 {
-       uint32_t devid = 0;
+       static uint32_t devid = 0;
        const char *override;
 
+       if (devid)
+               return devid;
+
        override = getenv("INTEL_DEVID_OVERRIDE");
        if (override) {
                devid = strtod(override, NULL);
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to