Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/display: add step name in display runtime info

Initialize the stepping name in display runtime info. This avoids having
to use intel_step_name().

For display device info print at boot, debugfs and snapshot this changes
the unknown step name from ** to N/A, which is more user friendly
anyway.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://patch.msgid.link/aab445dedb8235d9fdddfe2ee5bb624cdf453a18.1773663208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+26 -3
+25 -3
drivers/gpu/drm/i915/display/intel_display_device.c
··· 1653 1653 bitmap_or(dst->bitmap, dst->bitmap, src->bitmap, display_platforms_num_bits()); 1654 1654 } 1655 1655 1656 + #define __STEP_NAME(name) [STEP_##name] = #name, 1657 + 1658 + static void initialize_step(struct intel_display *display, enum intel_step step) 1659 + { 1660 + static const char step_names[][3] = { 1661 + STEP_NAME_LIST(__STEP_NAME) 1662 + }; 1663 + 1664 + DISPLAY_RUNTIME_INFO(display)->step = step; 1665 + 1666 + /* Step name will remain an empty string if not applicable */ 1667 + if (step >= 0 && step < ARRAY_SIZE(step_names)) 1668 + strscpy(DISPLAY_RUNTIME_INFO(display)->step_name, step_names[step]); 1669 + } 1670 + 1671 + #undef __STEP_NAME 1672 + 1673 + static const char *step_name(const struct intel_display_runtime_info *runtime) 1674 + { 1675 + return strlen(runtime->step_name) ? runtime->step_name : "N/A"; 1676 + } 1677 + 1656 1678 struct intel_display *intel_display_device_probe(struct pci_dev *pdev, 1657 1679 const struct intel_display_parent_interface *parent) 1658 1680 { ··· 1752 1730 subdesc ? &subdesc->step_info : NULL); 1753 1731 } 1754 1732 1755 - DISPLAY_RUNTIME_INFO(display)->step = step; 1733 + initialize_step(display, step); 1756 1734 1757 1735 drm_info(display->drm, "Found %s%s%s (device ID %04x) %s display version %u.%02u stepping %s\n", 1758 1736 desc->name, subdesc ? "/" : "", subdesc ? subdesc->name : "", 1759 1737 pdev->device, display->platform.dgfx ? "discrete" : "integrated", 1760 1738 DISPLAY_RUNTIME_INFO(display)->ip.ver, 1761 1739 DISPLAY_RUNTIME_INFO(display)->ip.rel, 1762 - step != STEP_NONE ? intel_step_name(step) : "N/A"); 1740 + step_name(DISPLAY_RUNTIME_INFO(display))); 1763 1741 1764 1742 return display; 1765 1743 ··· 1975 1953 drm_printf(p, "display version: %u\n", 1976 1954 runtime->ip.ver); 1977 1955 1978 - drm_printf(p, "display stepping: %s\n", intel_step_name(runtime->step)); 1956 + drm_printf(p, "display stepping: %s\n", step_name(runtime)); 1979 1957 1980 1958 #define PRINT_FLAG(name) drm_printf(p, "%s: %s\n", #name, str_yes_no(info->name)) 1981 1959 DEV_INFO_DISPLAY_FOR_EACH_FLAG(PRINT_FLAG);
+1
drivers/gpu/drm/i915/display/intel_display_device.h
··· 287 287 u16 step; /* hardware */ 288 288 } ip; 289 289 int step; /* symbolic */ 290 + char step_name[3]; /* empty string if not applicable */ 290 291 291 292 u32 rawclk_freq; 292 293