From patchwork Wed Oct 30 21:08:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zuo, Jerry" X-Patchwork-Id: 11220073 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 396EA913 for ; Wed, 30 Oct 2019 21:09:32 +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 1FE5C20856 for ; Wed, 30 Oct 2019 21:09:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FE5C20856 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 01DC26EB40; Wed, 30 Oct 2019 21:09:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700089.outbound.protection.outlook.com [40.107.70.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id D06956EB40; Wed, 30 Oct 2019 21:09:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zg2X+3Ebd2yBZd4Lcq6imfJ2YlstiaxaYow2jN5D3zQzYjbzo5WudyGu5mNyR7MC7sGQWNj+DgPfT2bXYF7Yh3TxVAi2xOFzQB7KPKVLI/pVONt3Pi3eopW04IGIwnPgkLCri6FnkqX6EUTtva5DanYoXcu9e491lBm5H5+qJ46xkZ1f/V+xsWBupkr6lw1+MddvFhAhjMXx+BpjUEfZaw84JVpaX2u/+0HoV+O0yko8SI7fGBYjfgD9oVbe25TZPkM2ldoUJzUQ0j3Fhr2ddl8FcqYCkiAIUMYhHq19SJKIeHwC3j869TNMew6CSkZZzF2dQaOxF8D/IpsDjXE/dQ== 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=yDN9iovwnkV3d972qVszi7+N3rEpDxY7LqteNEUGM10=; b=oRa0kfuO/3zvBYnATc0iuB0OL9/KXkKtL7WwnD3JX58FLgRuadvMP3wDoBOUOcuwBm5Kje5y6glGG6fj8rSv37mu5Re3+LFu8R/LHHFmw2+0WclQ88dcpia5yDdndhpC8CrzudslPoOd09Cea7DskSlC8QlA1hKSsdDXXfblFTRLudpI39qwbxXciolI8jnjRK8zloyQyWO9M87fd0uEJ5pMxSpE++wyP1+7Rqvl1gyeDSOlKlHIDTalhrhmztQId8O4qh2OhuInSTqpTLvlllqco01tzqFBbsfodcIGwA88LV8h3a6fIwDm6rXPFlFq67jl2fXaFpXvaao55yBemg== 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 DM3PR12CA0101.namprd12.prod.outlook.com (2603:10b6:0:55::21) by BN6PR1201MB0131.namprd12.prod.outlook.com (2603:10b6:405:5b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.24; Wed, 30 Oct 2019 21:09:27 +0000 Received: from CO1NAM03FT042.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by DM3PR12CA0101.outlook.office365.com (2603:10b6:0:55::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2408.19 via Frontend Transport; Wed, 30 Oct 2019 21:09:27 +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 CO1NAM03FT042.mail.protection.outlook.com (10.152.81.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2387.20 via Frontend Transport; Wed, 30 Oct 2019 21:09:26 +0000 Received: from SATLEXMB01.amd.com (10.181.40.142) 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; Wed, 30 Oct 2019 16:09:25 -0500 Received: from jzuo-linux.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 30 Oct 2019 16:09:25 -0500 From: "Jerry (Fangzhi) Zuo" To: , Subject: [PATCH 1/2] drm: Add support for DP 1.4 Compliance edid corruption test 4.2.2.6 Date: Wed, 30 Oct 2019 17:08:43 -0400 Message-ID: <20191030210844.19803-2-Jerry.Zuo@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20191030210844.19803-1-Jerry.Zuo@amd.com> References: <20191030210844.19803-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)(136003)(39860400002)(346002)(376002)(428003)(189003)(199004)(50466002)(11346002)(48376002)(446003)(126002)(6666004)(356004)(2616005)(2906002)(476003)(5660300002)(316002)(54906003)(47776003)(16586007)(86362001)(110136005)(478600001)(1076003)(50226002)(4326008)(186003)(81156014)(81166006)(8676002)(76176011)(305945005)(26005)(8936002)(36756003)(486006)(53416004)(14444005)(336012)(426003)(7696005)(51416003)(70586007)(70206006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0131; 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: 5b8b70bb-c835-467a-fad6-08d75d7d7245 X-MS-TrafficTypeDiagnostic: BN6PR1201MB0131: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-Forefront-PRVS: 02065A9E77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DCKhXa+QJXmpGTRDgJpR13y0IbdzGKbw3AJ4wWi0UcPq9jxJJV6b4oIa+YqbShKhcwKq5qWSBBYYwy4uDHDDfhDXnFftQWYYSP3B9iXyVIhpvvilKNMrCqBa95bhX7mRVWx3kUxhkMfFnYpL1AfSuc9sMtBx9BFnhUe/EyBlyd86gQ6KZRhmNOTgJHQ9dAhFTKmqDLwF+RF8ZOw7sXyQdgiBPRtV8UjJMwQ/haGYhrNdylu75ZACfya4O9o8D7tcwFyO4rS6c3n6Pq+GJN6AFuB855rQGFH8KKNoxwkaDcWxDIPp/jJGXWvPIQbSW+Lzb/RCG4i0AmjT3zLeaIs+D8nWB5G14KY7ZzCANAxlSC8s94Bl4pddXUomYtGcTIw/zmu5LbfxN/oqjUJBdpyHUGdcXkDVXn4Vm+rKhv4JcWRdhoqD+TP2NLZamBxRuJSB X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2019 21:09:26.4077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b8b70bb-c835-467a-fad6-08d75d7d7245 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: BN6PR1201MB0131 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=yDN9iovwnkV3d972qVszi7+N3rEpDxY7LqteNEUGM10=; b=XqrHUfBP17mWJjVvVtVJHi4dfvq2cHJiZ4LDp2s0J7hrUdFq21ptV9WYJyem9FNBJBMb8K4pIYqTu/zlhcJDUEStPryKuUV4aUmQe8lG/WWnjIENna46/1WdSr9cldP89RR2B9Vw7DW/E9o3a3EHghGe3Psq4EYolLOXkLzgMLM= 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: manasi.d.navare@intel.com, Jerry.Zuo@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. Signed-off-by: Jerry (Fangzhi) Zuo --- drivers/gpu/drm/drm_dp_helper.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_edid.c | 15 ++++++++++++--- include/drm/drm_connector.h | 7 +++++++ include/drm/drm_dp_helper.h | 3 +++ 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..75dbd30c62a7 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_bad_edid_checksum() - send back real edid checksum value + * @aux: DisplayPort AUX channel + * @bad_edid_checksum: real edid checksum for the last block + * + * Returns true on success + */ +bool drm_dp_send_bad_edid_checksum(struct drm_dp_aux *aux, + u8 bad_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, &bad_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_bad_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..400064dcc010 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1344,13 +1344,19 @@ static void drm_get_displayid(struct drm_connector *connector, struct edid *edid); static int validate_displayid(u8 *displayid, int length, int idx); -static int drm_edid_block_checksum(const u8 *raw_edid) +static int drm_edid_block_checksum(const u8 *raw_edid, bool c) { int i; u8 csum = 0; - for (i = 0; i < EDID_LENGTH; i++) + u8 len; + + len = c ? EDID_LENGTH : (EDID_LENGTH - 1); + + for (i = 0; i < len; i++) csum += raw_edid[i]; + csum = c ? csum : (0x100 - csum); + return csum; } @@ -1408,7 +1414,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, } } - csum = drm_edid_block_checksum(raw_edid); + csum = drm_edid_block_checksum(raw_edid, true); if (csum) { if (edid_corrupt) *edid_corrupt = true; @@ -1572,6 +1578,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->bad_edid_checksum = drm_edid_block_checksum(edid + edid[0x7e] * EDID_LENGTH, false); } /* Get override or firmware EDID */ diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 681cb590f952..8442461542b9 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; + /** + * @bad_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 bad_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..2a7e54bebb18 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_bad_edid_checksum(struct drm_dp_aux *aux, + u8 bad_edid_checksum); + /* * DisplayPort link */ From patchwork Wed Oct 30 21:08:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zuo, Jerry" X-Patchwork-Id: 11220075 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 19D00913 for ; Wed, 30 Oct 2019 21:09:36 +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 0121B20856 for ; Wed, 30 Oct 2019 21:09:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0121B20856 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 985776EB8E; Wed, 30 Oct 2019 21:09:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800045.outbound.protection.outlook.com [40.107.80.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BDEA6EB89; Wed, 30 Oct 2019 21:09:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMgc8UMnet7AcpQXDbfMV2qSbobQT42oNT3vEioU7n66KNAWn3yaGUvbOdQA+pQ8MZF/OiorLbejACo0X8dICKGsRd8fasgXnzzg1aO9bez5tS3AmO79DoaFSuOpc+xLN3Ss10KMw4EBbTPsVlJBaZ525QsSi/Q+GOe9ooUbghVMjRGu0BtOnFoz9dwSYAFzwf4IRsp8Czgw6/iAjh5cU7xa0yQgNL1cnqL0M+TdzT3/RDOjsKoxiJu5Mcc5PEmyJMLLmyXdZyEDqzwpLC6vk2pFdNl3Y2pGAnO4v5fwB+DtndjBA0F8iwM3i+3Ep7T1120mdZAuzuuRRgLtQ8MPYg== 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=NuQQMeKn2RUSx0KxWL852P5/QUkHc6cjq2GT90VUpKQ=; b=jQ8oKahR+hOlsPElCtHBzOtmPCw/BFsWKx8UeGlTBprvbdviIY2QqZIaZDMjOIoydUyIh+jmSVccdteNXfQv/n36e7KwZKB00KeXcMNpi3R6eOPm6Oa+e9n9sdAe7iu6XR6DBZKa72AxczsR5dREWQKpR9C4kbtBCThUDaUNIQ/o1eFEW3wMolPb8gszdSZXUzPZTBq798mDLBby1KgdoU1/bbK+xc31WOVUNFpS8hgCPB192GxIeRNPd30OJ9tFfOYEATEWlWPsXytDEK73cBQvPuUTc06RWe61M7n3cG0YEraHelVqiBUaUMM9RapgAVMVf4jog/BeSvliF7UkDg== 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 MN2PR12CA0029.namprd12.prod.outlook.com (2603:10b6:208:a8::42) by MWHPR12MB1166.namprd12.prod.outlook.com (2603:10b6:300:7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.23; Wed, 30 Oct 2019 21:09:31 +0000 Received: from CO1NAM03FT043.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::206) by MN2PR12CA0029.outlook.office365.com (2603:10b6:208:a8::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2387.25 via Frontend Transport; Wed, 30 Oct 2019 21:09:31 +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 CO1NAM03FT043.mail.protection.outlook.com (10.152.81.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2387.20 via Frontend Transport; Wed, 30 Oct 2019 21:09:29 +0000 Received: from SATLEXMB01.amd.com (10.181.40.142) 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; Wed, 30 Oct 2019 16:09:28 -0500 Received: from jzuo-linux.amd.com (10.180.168.240) by SATLEXMB01.amd.com (10.181.40.142) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 30 Oct 2019 16:09:28 -0500 From: "Jerry (Fangzhi) Zuo" To: , Subject: [PATCH 2/2] drm/amd/display: Hook up drm interface for DP 1.4 edid corruption test Date: Wed, 30 Oct 2019 17:08:44 -0400 Message-ID: <20191030210844.19803-3-Jerry.Zuo@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20191030210844.19803-1-Jerry.Zuo@amd.com> References: <20191030210844.19803-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)(376002)(136003)(39860400002)(346002)(428003)(199004)(189003)(51416003)(426003)(76176011)(2906002)(26005)(8936002)(186003)(446003)(486006)(356004)(6666004)(336012)(50226002)(14444005)(5660300002)(7696005)(4326008)(70586007)(70206006)(316002)(50466002)(54906003)(48376002)(16586007)(110136005)(47776003)(81156014)(8676002)(1076003)(53416004)(478600001)(2616005)(126002)(476003)(305945005)(36756003)(86362001)(11346002)(81166006)(52103002)(158003001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1166; H:SATLEXMB02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 735d11ca-dfc8-475c-2e4f-08d75d7d742f X-MS-TrafficTypeDiagnostic: MWHPR12MB1166: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:389; X-Forefront-PRVS: 02065A9E77 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JUICprthAQiohG18FAnpNCRMNTRrep2evEIDdGz6wfpRip1mLsNdJCgWi8RPHpAi933YZs/NE27En/0070OmLjwAs5fitgxrvLNS8vjUj9d9elZ5ueb8pwR7O5TMcX+YCgCXQUj8MPLaW7V88+ZPcJzaBPUYqqRtfa/AtdeNX0/VMcdebKAQHwmdhNajErYBeOUL45YwX/ySugg45l/WUatQUr/B8F4zqPmRJmEJu6tA98hxUnGVDFwjnpi6JCGamdUGAv28cqHOpR8qffIIjdoOKy+uBoDgKJ7/Np4/iokSWP1uQmwLbaU2N9p1j0KXWHcgTLbOd80P3l2vLwYTF3UKRIhpeviThLCoQ1S/ji5UtASCQL6iRr6gizT52D/i2J8pomH8u0mFvLTV709XgSrDCg1rshlxaIDZJOsNmvsW1o/N27am6PAAV6WeUx5D X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2019 21:09:29.6157 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 735d11ca-dfc8-475c-2e4f-08d75d7d742f 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: MWHPR12MB1166 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=NuQQMeKn2RUSx0KxWL852P5/QUkHc6cjq2GT90VUpKQ=; b=pBcZmIPb4iqK3AjoOviP1g/7fykCOa9dz6ByeTfCGZIlcARx7DoQh+GtIlnzIeIR/kbIvfkQQ0y8wDrGirTsgYTd/QibCFCN1PKCai/pi1qTzyFGORwRosCrwpXIE0X9z5F8KJ7QtuNjLgiwFToChjkIRvuKHXHQOljRg1G774o= 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: manasi.d.navare@intel.com, Jerry.Zuo@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Jerry (Fangzhi) Zuo --- .../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..c430890085f6 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_bad_edid_checksum(&aconnector->dm_dp_aux.aux, connector->bad_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; }