Skip to content

Commit b5f7242

Browse files
knowuselessalexdeucher
authored andcommitted
drm/amd/display: add a quirk to enable eDP0 on DP1
[why] some board designs have eDP0 connected to DP1, need a way to enable support_edp0_on_dp1 flag, otherwise edp related features cannot work [how] do a dmi check during dm initialization to identify systems that require support_edp0_on_dp1. Optimize quirk table with callback functions to set quirk entries, retrieve_dmi_info can set quirks according to quirk entries Cc: Mario Limonciello <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Yilin Chen <[email protected]> Signed-off-by: Zaeem Mohamed <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit f6d1727) Cc: [email protected]
1 parent e8863f8 commit b5f7242

File tree

1 file changed

+62
-7
lines changed

1 file changed

+62
-7
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,75 +1618,130 @@ static bool dm_should_disable_stutter(struct pci_dev *pdev)
16181618
return false;
16191619
}
16201620

1621-
static const struct dmi_system_id hpd_disconnect_quirk_table[] = {
1621+
struct amdgpu_dm_quirks {
1622+
bool aux_hpd_discon;
1623+
bool support_edp0_on_dp1;
1624+
};
1625+
1626+
static struct amdgpu_dm_quirks quirk_entries = {
1627+
.aux_hpd_discon = false,
1628+
.support_edp0_on_dp1 = false
1629+
};
1630+
1631+
static int edp0_on_dp1_callback(const struct dmi_system_id *id)
1632+
{
1633+
quirk_entries.support_edp0_on_dp1 = true;
1634+
return 0;
1635+
}
1636+
1637+
static int aux_hpd_discon_callback(const struct dmi_system_id *id)
1638+
{
1639+
quirk_entries.aux_hpd_discon = true;
1640+
return 0;
1641+
}
1642+
1643+
static const struct dmi_system_id dmi_quirk_table[] = {
16221644
{
1645+
.callback = aux_hpd_discon_callback,
16231646
.matches = {
16241647
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16251648
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3660"),
16261649
},
16271650
},
16281651
{
1652+
.callback = aux_hpd_discon_callback,
16291653
.matches = {
16301654
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16311655
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3260"),
16321656
},
16331657
},
16341658
{
1659+
.callback = aux_hpd_discon_callback,
16351660
.matches = {
16361661
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16371662
DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3460"),
16381663
},
16391664
},
16401665
{
1666+
.callback = aux_hpd_discon_callback,
16411667
.matches = {
16421668
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16431669
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Tower Plus 7010"),
16441670
},
16451671
},
16461672
{
1673+
.callback = aux_hpd_discon_callback,
16471674
.matches = {
16481675
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16491676
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Tower 7010"),
16501677
},
16511678
},
16521679
{
1680+
.callback = aux_hpd_discon_callback,
16531681
.matches = {
16541682
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16551683
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex SFF Plus 7010"),
16561684
},
16571685
},
16581686
{
1687+
.callback = aux_hpd_discon_callback,
16591688
.matches = {
16601689
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16611690
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex SFF 7010"),
16621691
},
16631692
},
16641693
{
1694+
.callback = aux_hpd_discon_callback,
16651695
.matches = {
16661696
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16671697
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Micro Plus 7010"),
16681698
},
16691699
},
16701700
{
1701+
.callback = aux_hpd_discon_callback,
16711702
.matches = {
16721703
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
16731704
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex Micro 7010"),
16741705
},
16751706
},
1707+
{
1708+
.callback = edp0_on_dp1_callback,
1709+
.matches = {
1710+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1711+
DMI_MATCH(DMI_PRODUCT_NAME, "HP Elite mt645 G8 Mobile Thin Client"),
1712+
},
1713+
},
1714+
{
1715+
.callback = edp0_on_dp1_callback,
1716+
.matches = {
1717+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1718+
DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 665 16 inch G11 Notebook PC"),
1719+
},
1720+
},
16761721
{}
16771722
/* TODO: refactor this from a fixed table to a dynamic option */
16781723
};
16791724

1680-
static void retrieve_dmi_info(struct amdgpu_display_manager *dm)
1725+
static void retrieve_dmi_info(struct amdgpu_display_manager *dm, struct dc_init_data *init_data)
16811726
{
1682-
const struct dmi_system_id *dmi_id;
1727+
int dmi_id;
1728+
struct drm_device *dev = dm->ddev;
16831729

16841730
dm->aux_hpd_discon_quirk = false;
1731+
init_data->flags.support_edp0_on_dp1 = false;
1732+
1733+
dmi_id = dmi_check_system(dmi_quirk_table);
16851734

1686-
dmi_id = dmi_first_match(hpd_disconnect_quirk_table);
1687-
if (dmi_id) {
1735+
if (!dmi_id)
1736+
return;
1737+
1738+
if (quirk_entries.aux_hpd_discon) {
16881739
dm->aux_hpd_discon_quirk = true;
1689-
DRM_INFO("aux_hpd_discon_quirk attached\n");
1740+
drm_info(dev, "aux_hpd_discon_quirk attached\n");
1741+
}
1742+
if (quirk_entries.support_edp0_on_dp1) {
1743+
init_data->flags.support_edp0_on_dp1 = true;
1744+
drm_info(dev, "aux_hpd_discon_quirk attached\n");
16901745
}
16911746
}
16921747

@@ -1994,7 +2049,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
19942049
if (amdgpu_ip_version(adev, DCE_HWIP, 0) >= IP_VERSION(3, 0, 0))
19952050
init_data.num_virtual_links = 1;
19962051

1997-
retrieve_dmi_info(&adev->dm);
2052+
retrieve_dmi_info(&adev->dm, &init_data);
19982053

19992054
if (adev->dm.bb_from_dmub)
20002055
init_data.bb_from_dmub = adev->dm.bb_from_dmub;

0 commit comments

Comments
 (0)