From patchwork Mon Dec 2 19:04:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zuo, Jerry" X-Patchwork-Id: 11269493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 072A3112B for ; Mon, 2 Dec 2019 19:05:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2BB321823 for ; Mon, 2 Dec 2019 19:05:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2BB321823 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E98E6E128; Mon, 2 Dec 2019 19:05:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-eopbgr760080.outbound.protection.outlook.com [40.107.76.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DB0C6E128; Mon, 2 Dec 2019 19:05:03 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RpEOwRL4v1TGetrhGxA2i+XFc610mbln/rW/kx9Hjwoo//70BS3L8z1IaVCsqYPxwsepxNbxO6CpQ88bi3/T4esqZRpe/NPab6NxU6BzvH4gfCMpMANnUb60+9ipqejMh5DA8wpl8mFyHVvHqpetIc7tNRq2nU64efgCZOI61MtszX0EvhT1xSrOH6YfB4dA9HOWY+CtUMPhcIJq2JLjJdCDKb76gEoRilto982GbnYz0l6mz4bR67A777ptdFP0Aq8e0oaaJ02qGddN8UNW+poEKRAihlRM697eR8cob7wmH6pcJ4y1jis8b+UniAsMy4/HCkzldK91ESsXrz8WZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2aWJGRSwQ5vJq2KfMboSu7jgBMW4tOjWyjhXfLglI2M=; b=gxmVSd2fN0QnS1kOvEKDhPRwIpYeSxrKlpch8ufxfMJqEpOjTObtbO50ZltderIeY3eZuxqnwuopn4pyvbPV0rie2JD/c7efCVvW9tJ0IiGIkHrPpb2XvKWOxTEPmlYybhSWZaJebUwsNVRjHjoIwTr4QImzh3jHcUrvKbw+qDg9++eOpORcf28ng0co5p1E8k+2WhtaYrpVu2ajhCTBT7t+G61WWh0cA+oM4oB2xaBesuRnKVkYwWbtVq8mtZv4o0S5w6Xa4TiPxIIoP5jnabHsw4LfoFdWVsGYQSMUXej2bFgfXmTQKo1EAVgG67+ah5GahoNwnf3skcjzHtUU/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from DM3PR12CA0062.namprd12.prod.outlook.com (2603:10b6:0:56::30) by MN2PR12MB3391.namprd12.prod.outlook.com (2603:10b6:208:c3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.17; Mon, 2 Dec 2019 19:05:00 +0000 Received: from BN8NAM11FT045.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eae::201) by DM3PR12CA0062.outlook.office365.com (2603:10b6:0:56::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.20 via Frontend Transport; Mon, 2 Dec 2019 19:05:00 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT045.mail.protection.outlook.com (10.13.177.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2451.23 via Frontend Transport; Mon, 2 Dec 2019 19:04:59 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Dec 2019 13:04:59 -0600 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Dec 2019 13:04:58 -0600 Received: from jzuo-linux.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 2 Dec 2019 13:04:58 -0600 From: "Jerry (Fangzhi) Zuo" To: , , Subject: [RESEND 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6 Date: Mon, 2 Dec 2019 14:04:48 -0500 Message-ID: <20191202190449.2864-2-Jerry.Zuo@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20191202190449.2864-1-Jerry.Zuo@amd.com> References: <20191202190449.2864-1-Jerry.Zuo@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(376002)(136003)(39860400002)(428003)(189003)(199004)(48376002)(54906003)(1076003)(2616005)(70586007)(478600001)(26005)(426003)(305945005)(50226002)(86362001)(8936002)(81156014)(81166006)(70206006)(36756003)(336012)(8676002)(4326008)(2201001)(16586007)(6666004)(186003)(356004)(5660300002)(11346002)(7696005)(50466002)(2906002)(316002)(446003)(51416003)(110136005)(47776003)(76176011)(53416004)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3391; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62322f1b-aa40-4603-84d2-08d7775a8769 X-MS-TrafficTypeDiagnostic: MN2PR12MB3391: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-Forefront-PRVS: 0239D46DB6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QDWFep+QOTkCum2pHCybE94cPjOv7CkctarwfOObFIYFFemffzf4NK9dy86Za+Osc3Xn7si48uCe41Ju8UT4QoIeJLZC4Za++22cIZ4Dldh+nHMCpWpLbyHUsRTN4/H6baq/C0bVqmVhWdK/6GGebIZmyWni2Al7Z7x2pqBj0++8w7yO+pnTfu4vluTHT2bPQVA4I9x3C/S6ICKnlsbth68v90sq7coxvnVJK+dBja/jh+mJg3iCaW/y0cPLAdTK/OEUVPRleHRhz9Ln5TLFZ/O8Ee7l6LgbSsK5H5CKrBjNrg6o0K68DV11txM8XwSpP/OtyoBuFeDbLf0tNEROMIdjvzXhazQzNJ/35XB9oD1+MhKlNRrejOYsSUs8hvh685uBgniDfwMUupcg5nZ/fi+Vxy6BwdCdhzjAZMUO1mN+PYdm66IYCi5eZLbARk1m X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2019 19:04:59.8395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62322f1b-aa40-4603-84d2-08d7775a8769 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3391 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2aWJGRSwQ5vJq2KfMboSu7jgBMW4tOjWyjhXfLglI2M=; b=onKN8LhvgKFqclEufbrAhC0RdNWEjkNDILW1/lDqFtTrzts2oCf5DJR/wy2X3eQlBHA0/ifcWqnCr8U2PxccwJUe5jVGe1rZQJiDIT72qxUDtFM2JQrR3cuL7rf1whpPS0zqod8IRIcv2Eks9HNcNUdY14l9PR2Jr9O2HOGkI70= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rodrigo.siqueira@amd.com, manasi.d.navare@intel.com, Jerry.Zuo@amd.com, Alexander.Deucher@amd.com, nicholas.kazlauskas@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" DP 1.4 edid corruption test requires source DUT to write calculated CRC, not the corrupted CRC from reference sink. Return the calculated CRC back, and initiate the required sequence. -v2: Have separate routine for returning real CRC -v3: Rewrite checksum computation routine to avoid duplicated code. Rename to avoid confusion -v4: Fix a minor typo. Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Harry Wentland --- drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_edid.c | 18 +++++++++++++++--- include/drm/drm_connector.h | 7 +++++++ include/drm/drm_dp_helper.h | 3 +++ 4 files changed, 61 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..22a0e966ea9f 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -336,6 +336,42 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_dpcd_read_link_status); +/** + * drm_dp_send_real_edid_checksum() - send back real edid checksum value + * @aux: DisplayPort AUX channel + * @real_edid_checksum: real edid checksum for the last block + * + * Returns true on success + */ +bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, + u8 real_edid_checksum) +{ + u8 link_edid_read = 0, auto_test_req = 0; + u8 test_resp = 0; + + drm_dp_dpcd_read(aux, DP_DEVICE_SERVICE_IRQ_VECTOR, &auto_test_req, 1); + auto_test_req &= DP_AUTOMATED_TEST_REQUEST; + + drm_dp_dpcd_read(aux, DP_TEST_REQUEST, &link_edid_read, 1); + link_edid_read &= DP_TEST_LINK_EDID_READ; + + if (!auto_test_req || !link_edid_read) { + DRM_DEBUG_KMS("Source DUT does not support TEST_EDID_READ\n"); + return false; + } + + drm_dp_dpcd_write(aux, DP_DEVICE_SERVICE_IRQ_VECTOR, &auto_test_req, 1); + + /* send back checksum for the last edid extension block data */ + drm_dp_dpcd_write(aux, DP_TEST_EDID_CHECKSUM, &real_edid_checksum, 1); + + test_resp |= DP_TEST_EDID_CHECKSUM_WRITE; + drm_dp_dpcd_write(aux, DP_TEST_RESPONSE, &test_resp, 1); + + return true; +} +EXPORT_SYMBOL(drm_dp_send_real_edid_checksum); + /** * drm_dp_link_probe() - probe a DisplayPort link for capabilities * @aux: DisplayPort AUX channel diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 82a4ceed3fcf..ff64e5f1feb6 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1348,10 +1348,19 @@ static int drm_edid_block_checksum(const u8 *raw_edid) { int i; u8 csum = 0; - for (i = 0; i < EDID_LENGTH; i++) + + for (i = 0; i < EDID_LENGTH - 1; i++) csum += raw_edid[i]; - return csum; + return (0x100 - csum); +} + +static bool drm_edid_block_checksum_diff(const u8 *raw_edid, u8 real_checksum) +{ + if (raw_edid[EDID_LENGTH - 1] != real_checksum) + return true; + else + return false; } static bool drm_edid_is_zero(const u8 *in_edid, int length) @@ -1409,7 +1418,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, } csum = drm_edid_block_checksum(raw_edid); - if (csum) { + if (drm_edid_block_checksum_diff(raw_edid, csum)) { if (edid_corrupt) *edid_corrupt = true; @@ -1572,6 +1581,9 @@ static void connector_bad_edid(struct drm_connector *connector, prefix, DUMP_PREFIX_NONE, 16, 1, block, EDID_LENGTH, false); } + + /* Calculate real checksum for the last edid extension block data */ + connector->real_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH); } /* Get override or firmware EDID */ diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..eb0d8c7b35fd 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1345,6 +1345,13 @@ struct drm_connector { * rev1.1 4.2.2.6 */ bool edid_corrupt; + /** + * @real_edid_checksum: real edid checksum value for corrupted edid block. + * Required in Displayport 1.4 compliance testing + * rev1.1 4.2.2.6 + */ + uint8_t real_edid_checksum; + /** @debugfs_entry: debugfs directory for this connector */ struct dentry *debugfs_entry; diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 5a795075d5da..84709d7810f8 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1383,6 +1383,9 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux, int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, u8 status[DP_LINK_STATUS_SIZE]); +bool drm_dp_send_real_edid_checksum(struct drm_dp_aux *aux, + u8 real_edid_checksum); + /* * DisplayPort link */ From patchwork Mon Dec 2 19:04:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zuo, Jerry" X-Patchwork-Id: 11269495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94941930 for ; Mon, 2 Dec 2019 19:05:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B2A92464F for ; Mon, 2 Dec 2019 19:05:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B2A92464F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 202486E2B0; Mon, 2 Dec 2019 19:05:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790071.outbound.protection.outlook.com [40.107.79.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id A255D6E2B4; Mon, 2 Dec 2019 19:05:05 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q422w5No+jxwuMHMBBvY9VHxAphtXmVw1JCqhlTdYTjwM0/pxRq/VCpUHvj8QmqlIdZY9dUdqtmksfYW0otEuegZ6hqX9wORrRQdEaxcOxShFsyQw8NQCFDOlgrfO8VsPTEGeBy96hmh46pSyuTJ16BzaJwF27/4edqCXhbxdfAK5NChkkGPkCpWRV9wdv15ATljU9W1Hu9x5ubtDsFS/gi6E3QQ0o+NfwEohWcNR4lkpUCNKt1IHbbp+Fjw9aIoWEdp5HXEa7I455k9hTTd6SOThQptbSIOdaTNdxbwV2yKnP5OdZ5AjwX4IRFU28M9nQN23vu4b8Xp1Q+SSBz+RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jCt1pXlgudQ96j4QNDVi6RsgGMvcnCDMDyOQlkw5Uo0=; b=j3nkpYVPKvPvJBzq01p4c4GcPB5hXv678THKHTPDTwYM/3KsWe5U4mWDZDF8hytk+ykyoE4cjiqQQ018X2jhfa55yLWW6ZlZ4Gcki9otZT/486X4I4iw08AWLoQpYt1bLNtc/Ic/KYogveR2IGjJ8uoNNFVVFmACIFATeLZ8MmcXLHQ/7CtVum5BU2kQGcohLYFzVQ6vvdzVBCKQ4w8TUHFrfSbbk2rxJLgFw8JKommJhBUSuSb7jEdVPBRuZ67OxqzGA97h5aIfQajm7uBcfs++QH5Ey/frx4Xi+aominp6Rxs090MmzhrsxmYU06T2O+7qdqkCaWQ8/fTBMw7cNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=permerror action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from SN1PR12CA0089.namprd12.prod.outlook.com (2603:10b6:802:21::24) by BN8PR12MB2964.namprd12.prod.outlook.com (2603:10b6:408:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.22; Mon, 2 Dec 2019 19:05:03 +0000 Received: from BN8NAM11FT056.eop-nam11.prod.protection.outlook.com (2a01:111:f400:7eae::208) by SN1PR12CA0089.outlook.office365.com (2603:10b6:802:21::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2495.18 via Frontend Transport; Mon, 2 Dec 2019 19:05:03 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXMB02.amd.com (165.204.84.17) by BN8NAM11FT056.mail.protection.outlook.com (10.13.177.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2451.23 via Frontend Transport; Mon, 2 Dec 2019 19:05:02 +0000 Received: from SATLEXMB02.amd.com (10.181.40.143) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Dec 2019 13:05:02 -0600 Received: from jzuo-linux.amd.com (10.180.168.240) by SATLEXMB02.amd.com (10.181.40.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 2 Dec 2019 13:05:01 -0600 From: "Jerry (Fangzhi) Zuo" To: , , Subject: [RESEND 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test Date: Mon, 2 Dec 2019 14:04:49 -0500 Message-ID: <20191202190449.2864-3-Jerry.Zuo@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20191202190449.2864-1-Jerry.Zuo@amd.com> References: <20191202190449.2864-1-Jerry.Zuo@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(376002)(346002)(396003)(428003)(189003)(199004)(4326008)(2616005)(478600001)(426003)(50466002)(11346002)(305945005)(51416003)(7696005)(76176011)(26005)(14444005)(336012)(186003)(53416004)(2906002)(110136005)(54906003)(316002)(16586007)(36756003)(446003)(48376002)(47776003)(50226002)(81166006)(81156014)(8676002)(8936002)(70206006)(70586007)(86362001)(6666004)(356004)(5660300002)(1076003)(2201001)(52103002)(158003001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2964; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6988624f-f267-456b-da7c-08d7775a893a X-MS-TrafficTypeDiagnostic: BN8PR12MB2964: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:489; X-Forefront-PRVS: 0239D46DB6 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zr4PHsI3D1hb+0t7NgQoEeOm1Zp4LZ8pMB2wcYe3ie86RPDoMqfQWmJqg/pjkk63S0XLf9W8NmwZ15VxIcbUeaDsLaURipfy3hJNoFq/ctWu1+VknesLziWdREX022I2JtPN7y65/TQJQoCb3oOnZwY23LQ/Lr/bd4oHCU7LbKfnDtkEN1USucRJ0JAoSFKXLSNYpnaurO7nMGUUzQCSJ3vidLmsuyfeW2+mfmGsqIGmg5aDpTIYLylagYeh2ABsuPiKMBtJwZZBXM30ZizVy13ZdeMWByyk+cMFkaGtDdD9Jzq2cV8bTrkhjyn1ZFeUt4uD9H7b5noupeyYXBKI9AblEJR8pHSl3oxc8z2oCoHGFizeS380lFcCXcekOSGC75IPt81VXrczlFZ8Sbtien+r8tvYpxMp1PJgn6zZPbzGBVmeIxlMDVpp1ECsSOLQ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2019 19:05:02.8881 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6988624f-f267-456b-da7c-08d7775a893a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2964 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jCt1pXlgudQ96j4QNDVi6RsgGMvcnCDMDyOQlkw5Uo0=; b=Gihyi/mQlH4264+CSwlKpR6KIDqCGAnzdbZKmp6S02/Pe+VASXQtlFmRZNar6b3i4xUHxCvAHFWoauyI9CsiinbJp1pF+0PWg+UQOFe5oxxc1WVWQ17UvP7lc4sT88d3MtGl31xUL1SZdvlr5MJnQUEbszeswA7/yIROeyM7SjA= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rodrigo.siqueira@amd.com, manasi.d.navare@intel.com, Jerry.Zuo@amd.com, Alexander.Deucher@amd.com, nicholas.kazlauskas@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" -v3: Rename to avoid confusion Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Harry Wentland --- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 35 +++++----------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index 11e5784aa62a..927fdac77b6f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -575,6 +575,7 @@ enum dc_edid_status dm_helpers_read_local_edid( struct dc_sink *sink) { struct amdgpu_dm_connector *aconnector = link->priv; + struct drm_connector *connector = &aconnector->base; struct i2c_adapter *ddc; int retry = 3; enum dc_edid_status edid_status; @@ -592,6 +593,12 @@ enum dc_edid_status dm_helpers_read_local_edid( edid = drm_get_edid(&aconnector->base, ddc); + if (link->aux_mode && connector->edid_corrupt) + drm_dp_send_real_edid_checksum(&aconnector->dm_dp_aux.aux, connector->real_edid_checksum); + + if (!edid && connector->edid_corrupt) + return EDID_BAD_CHECKSUM; + if (!edid) return EDID_NO_RESPONSE; @@ -612,34 +619,6 @@ enum dc_edid_status dm_helpers_read_local_edid( DRM_ERROR("EDID err: %d, on connector: %s", edid_status, aconnector->base.name); - if (link->aux_mode) { - union test_request test_request = { {0} }; - union test_response test_response = { {0} }; - - dm_helpers_dp_read_dpcd(ctx, - link, - DP_TEST_REQUEST, - &test_request.raw, - sizeof(union test_request)); - - if (!test_request.bits.EDID_READ) - return edid_status; - - test_response.bits.EDID_CHECKSUM_WRITE = 1; - - dm_helpers_dp_write_dpcd(ctx, - link, - DP_TEST_EDID_CHECKSUM, - &sink->dc_edid.raw_edid[sink->dc_edid.length-1], - 1); - - dm_helpers_dp_write_dpcd(ctx, - link, - DP_TEST_RESPONSE, - &test_response.raw, - sizeof(test_response)); - - } return edid_status; }