diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-08 16:01:51 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-08-09 12:29:21 -0400 |
commit | c96ea64ebbbe911becccb20dea1609017caad3c9 (patch) | |
tree | 0a5abbe3e3d058c3fd6866c4ba11fa385f62bbcf /drivers/gpu/drm | |
parent | 65bccb5c708bd9f00d24f041f4f7c45130359448 (diff) |
drm/i915: dump the device info
Handy for lazy people like me, or when people forget to add the output
of lspci -nn.
v2: Chris Wilson noticed that we have this duplicated already in the
i915_capabilites debugfs file. But there \n as separator looks better,
which would be a bit verbose in dmesg. Abuse the preprocessor to
extract this all.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 26 |
3 files changed, 48 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 1312b79c70b3..2e07cddd2313 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -61,28 +61,11 @@ static int i915_capabilities(struct seq_file *m, void *data) | |||
61 | 61 | ||
62 | seq_printf(m, "gen: %d\n", info->gen); | 62 | seq_printf(m, "gen: %d\n", info->gen); |
63 | seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev)); | 63 | seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(dev)); |
64 | #define B(x) seq_printf(m, #x ": %s\n", yesno(info->x)) | 64 | #define DEV_INFO_FLAG(x) seq_printf(m, #x ": %s\n", yesno(info->x)) |
65 | B(is_mobile); | 65 | #define DEV_INFO_SEP ; |
66 | B(is_i85x); | 66 | DEV_INFO_FLAGS; |
67 | B(is_i915g); | 67 | #undef DEV_INFO_FLAG |
68 | B(is_i945gm); | 68 | #undef DEV_INFO_SEP |
69 | B(is_g33); | ||
70 | B(need_gfx_hws); | ||
71 | B(is_g4x); | ||
72 | B(is_pineview); | ||
73 | B(is_broadwater); | ||
74 | B(is_crestline); | ||
75 | B(has_fbc); | ||
76 | B(has_pipe_cxsr); | ||
77 | B(has_hotplug); | ||
78 | B(cursor_needs_physical); | ||
79 | B(has_overlay); | ||
80 | B(overlay_needs_physical); | ||
81 | B(supports_tv); | ||
82 | B(has_bsd_ring); | ||
83 | B(has_blt_ring); | ||
84 | B(has_llc); | ||
85 | #undef B | ||
86 | 69 | ||
87 | return 0; | 70 | return 0; |
88 | } | 71 | } |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index d57ea1672134..a7a213cf06fb 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1428,6 +1428,21 @@ static void i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv) | |||
1428 | kfree(ap); | 1428 | kfree(ap); |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | static void i915_dump_device_info(struct drm_i915_private *dev_priv) | ||
1432 | { | ||
1433 | const struct intel_device_info *info = dev_priv->info; | ||
1434 | |||
1435 | #define DEV_INFO_FLAG(name) info->name ? #name "," : "" | ||
1436 | #define DEV_INFO_SEP , | ||
1437 | DRM_DEBUG_DRIVER("i915 device info: gen=%i, pciid=0x%04x flags=" | ||
1438 | "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", | ||
1439 | info->gen, | ||
1440 | dev_priv->dev->pdev->device, | ||
1441 | DEV_INFO_FLAGS); | ||
1442 | #undef DEV_INFO_FLAG | ||
1443 | #undef DEV_INFO_SEP | ||
1444 | } | ||
1445 | |||
1431 | /** | 1446 | /** |
1432 | * i915_driver_load - setup chip and create an initial config | 1447 | * i915_driver_load - setup chip and create an initial config |
1433 | * @dev: DRM device | 1448 | * @dev: DRM device |
@@ -1452,7 +1467,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1452 | if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) | 1467 | if (info->gen >= 6 && !drm_core_check_feature(dev, DRIVER_MODESET)) |
1453 | return -ENODEV; | 1468 | return -ENODEV; |
1454 | 1469 | ||
1455 | |||
1456 | /* i915 has 4 more counters */ | 1470 | /* i915 has 4 more counters */ |
1457 | dev->counters += 4; | 1471 | dev->counters += 4; |
1458 | dev->types[6] = _DRM_STAT_IRQ; | 1472 | dev->types[6] = _DRM_STAT_IRQ; |
@@ -1468,6 +1482,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1468 | dev_priv->dev = dev; | 1482 | dev_priv->dev = dev; |
1469 | dev_priv->info = info; | 1483 | dev_priv->info = info; |
1470 | 1484 | ||
1485 | i915_dump_device_info(dev_priv); | ||
1486 | |||
1471 | if (i915_get_bridge_dev(dev)) { | 1487 | if (i915_get_bridge_dev(dev)) { |
1472 | ret = -EIO; | 1488 | ret = -EIO; |
1473 | goto free_priv; | 1489 | goto free_priv; |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 0b2eb17fb381..26a2cf6da3a2 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -279,6 +279,32 @@ struct drm_i915_gt_funcs { | |||
279 | void (*force_wake_put)(struct drm_i915_private *dev_priv); | 279 | void (*force_wake_put)(struct drm_i915_private *dev_priv); |
280 | }; | 280 | }; |
281 | 281 | ||
282 | #define DEV_INFO_FLAGS \ | ||
283 | DEV_INFO_FLAG(is_mobile) DEV_INFO_SEP \ | ||
284 | DEV_INFO_FLAG(is_i85x) DEV_INFO_SEP \ | ||
285 | DEV_INFO_FLAG(is_i915g) DEV_INFO_SEP \ | ||
286 | DEV_INFO_FLAG(is_i945gm) DEV_INFO_SEP \ | ||
287 | DEV_INFO_FLAG(is_g33) DEV_INFO_SEP \ | ||
288 | DEV_INFO_FLAG(need_gfx_hws) DEV_INFO_SEP \ | ||
289 | DEV_INFO_FLAG(is_g4x) DEV_INFO_SEP \ | ||
290 | DEV_INFO_FLAG(is_pineview) DEV_INFO_SEP \ | ||
291 | DEV_INFO_FLAG(is_broadwater) DEV_INFO_SEP \ | ||
292 | DEV_INFO_FLAG(is_crestline) DEV_INFO_SEP \ | ||
293 | DEV_INFO_FLAG(is_ivybridge) DEV_INFO_SEP \ | ||
294 | DEV_INFO_FLAG(is_valleyview) DEV_INFO_SEP \ | ||
295 | DEV_INFO_FLAG(is_haswell) DEV_INFO_SEP \ | ||
296 | DEV_INFO_FLAG(has_force_wake) DEV_INFO_SEP \ | ||
297 | DEV_INFO_FLAG(has_fbc) DEV_INFO_SEP \ | ||
298 | DEV_INFO_FLAG(has_pipe_cxsr) DEV_INFO_SEP \ | ||
299 | DEV_INFO_FLAG(has_hotplug) DEV_INFO_SEP \ | ||
300 | DEV_INFO_FLAG(cursor_needs_physical) DEV_INFO_SEP \ | ||
301 | DEV_INFO_FLAG(has_overlay) DEV_INFO_SEP \ | ||
302 | DEV_INFO_FLAG(overlay_needs_physical) DEV_INFO_SEP \ | ||
303 | DEV_INFO_FLAG(supports_tv) DEV_INFO_SEP \ | ||
304 | DEV_INFO_FLAG(has_bsd_ring) DEV_INFO_SEP \ | ||
305 | DEV_INFO_FLAG(has_blt_ring) DEV_INFO_SEP \ | ||
306 | DEV_INFO_FLAG(has_llc) | ||
307 | |||
282 | struct intel_device_info { | 308 | struct intel_device_info { |
283 | u8 gen; | 309 | u8 gen; |
284 | u8 is_mobile:1; | 310 | u8 is_mobile:1; |