summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-10-02 17:13:06 +0300
committerLionel Landwerlin <[email protected]>2019-10-02 22:25:44 +0000
commit1c6fdbc83cf1094c735b964902da421978005cb3 (patch)
treec3daba05ebde54067f092818e2f438b19cbecc7b /src/intel
parentfaf98be290a9b6fa4d6a11f279f12c11e867c5c7 (diff)
intel: fix topology query
i915 will report ENODEV on generations prior to Haswell because there is no point in reporting values on those. This is prior any fusing could happen on parts with identical PCI ids. This query call was previously only triggered on generations that support performance queries, which happens to match generation for which i915 reports topology, but the commit pointed below started using it on all generations. Signed-off-by: Lionel Landwerlin <[email protected]> Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1860 Cc: <[email protected]> Fixes: 96e1c945f2 ("i965: Move device info initialization to common code") Reviewed-by: Mark Janes <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/dev/gen_device_info.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/intel/dev/gen_device_info.c b/src/intel/dev/gen_device_info.c
index 3953a1f4af3..85fa978f9c1 100644
--- a/src/intel/dev/gen_device_info.c
+++ b/src/intel/dev/gen_device_info.c
@@ -1320,6 +1320,9 @@ query_topology(struct gen_device_info *devinfo, int fd)
if (gen_ioctl(fd, DRM_IOCTL_I915_QUERY, &query))
return false;
+ if (item.length < 0)
+ return false;
+
struct drm_i915_query_topology_info *topo_info =
(struct drm_i915_query_topology_info *) calloc(1, item.length);
item.data_ptr = (uintptr_t) topo_info;