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/amd/display/dc: add support for oem i2c in atom_firmware_info_v3_1

The fields are marked as reserved in atom_firmware_info_v3_1,
but thet contain valid data in all of the vbios images I've
looked at so add parse these fields as per
atom_firmware_info_v3_2. The offsets are the same and the
reset of the structure is the same.

v2: squash in NULL checks

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+13 -2
+13 -2
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
··· 1778 1778 struct dc_firmware_info *info) 1779 1779 { 1780 1780 struct atom_firmware_info_v3_1 *firmware_info; 1781 + struct atom_firmware_info_v3_2 *firmware_info32; 1781 1782 struct atom_display_controller_info_v4_1 *dce_info = NULL; 1782 1783 1783 1784 if (!info) ··· 1786 1785 1787 1786 firmware_info = GET_IMAGE(struct atom_firmware_info_v3_1, 1788 1787 DATA_TABLES(firmwareinfo)); 1788 + firmware_info32 = GET_IMAGE(struct atom_firmware_info_v3_2, 1789 + DATA_TABLES(firmwareinfo)); 1789 1790 1790 1791 dce_info = GET_IMAGE(struct atom_display_controller_info_v4_1, 1791 1792 DATA_TABLES(dce_info)); 1792 1793 1793 - if (!firmware_info || !dce_info) 1794 + if (!firmware_info || !firmware_info32 || !dce_info) 1794 1795 return BP_RESULT_BADBIOSTABLE; 1795 1796 1796 1797 memset(info, 0, sizeof(*info)); ··· 1820 1817 bp->cmd_tbl.get_smu_clock_info(bp, SMU9_SYSPLL0_ID) * 10; 1821 1818 } 1822 1819 1823 - info->oem_i2c_present = false; 1820 + /* These fields are marked as reserved in v3_1, but they appear to be populated 1821 + * properly. 1822 + */ 1823 + if (firmware_info32 && firmware_info32->board_i2c_feature_id == 0x2) { 1824 + info->oem_i2c_present = true; 1825 + info->oem_i2c_obj_id = firmware_info32->board_i2c_feature_gpio_id; 1826 + } else { 1827 + info->oem_i2c_present = false; 1828 + } 1824 1829 1825 1830 return BP_RESULT_OK; 1826 1831 }