From patchwork Tue May 3 15:05:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Prosyak X-Patchwork-Id: 9006231 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 368F69F372 for ; Tue, 3 May 2016 16:39:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50B8F20114 for ; Tue, 3 May 2016 16:39:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EB32F2010F for ; Tue, 3 May 2016 16:39:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BB7B6E958; Tue, 3 May 2016 16:39:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 3657 seconds by postgrey-1.35 at gabe; Tue, 03 May 2016 16:39:33 UTC Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0067.outbound.protection.outlook.com [157.56.111.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id E80EB6E958 for ; Tue, 3 May 2016 16:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=guXMHt5HAfJRn0JhKaPEcAot8mgRvP8SiSEcYKNtI5U=; b=O0uoU1gBXUVz2vo/JtXI6WSbKgw0+CTS9EPBGvkIkQbq/ncKv61DRHjh9vB39Lpx/oK9r8kk5KEhODF4x45AVDuY9oW/SZXHUiwZxzgLtVmOUs01/xYhkmR11bBUF5FX7wTQOinWW+uzpprBQFUeiHQhyY87F3eEchVACCD1PaI= Received: from BY2PR12CA0009.namprd12.prod.outlook.com (10.160.121.19) by BY2PR12MB0712.namprd12.prod.outlook.com (10.163.113.22) with Microsoft SMTP Server (TLS) id 15.1.485.9; Tue, 3 May 2016 15:05:52 +0000 Received: from BY2NAM03FT010.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::205) by BY2PR12CA0009.outlook.office365.com (2a01:111:e400:2c84::19) with Microsoft SMTP Server (TLS) id 15.1.485.9 via Frontend Transport; Tue, 3 May 2016 15:05:52 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.22) 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; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.22) by BY2NAM03FT010.mail.protection.outlook.com (10.152.84.122) with Microsoft SMTP Server (TLS) id 15.1.492.8 via Frontend Transport; Tue, 3 May 2016 15:05:52 +0000 Received: from SATLEXDAG02.amd.com (10.181.40.5) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 3 May 2016 10:05:46 -0500 Received: from STOREXDAG04.amd.com (10.1.13.13) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 3 May 2016 11:05:46 -0400 Received: from cnvprosyaklinux.amd.com (172.29.225.31) by storexdag04.amd.com (10.1.13.13) with Microsoft SMTP Server id 14.3.266.1; Tue, 3 May 2016 11:05:45 -0400 From: Vitaly Prosyak To: Subject: [PATCH] drm/edid : calculate vsync and hsync from range limits block according to the EDID 1.4 Date: Tue, 3 May 2016 11:05:25 -0400 Message-ID: <1462287925-2668-2-git-send-email-vitaly.prosyak@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1462287925-2668-1-git-send-email-vitaly.prosyak@amd.com> References: <1462287925-2668-1-git-send-email-vitaly.prosyak@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.22; IPV:CAL; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(6806005)(2950100001)(105586002)(106466001)(229853001)(19580395003)(101416001)(2351001)(110136002)(5003600100002)(50466002)(19580405001)(87936001)(450100001)(53416004)(48376002)(77096005)(189998001)(11100500001)(586003)(47776003)(33646002)(5008740100001)(92566002)(86362001)(575784001)(36756003)(50986999)(50226002)(5003940100001)(8936002)(1220700001)(76176999)(4326007); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0712; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; MLV:sfv; MX:1; A:1; LANG:en; X-MS-Office365-Filtering-Correlation-Id: a102c750-d01f-4640-4d40-08d373646b8a X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0712; 2:RQwsiIcyPPY/cyiQDOY9NkRoZj1rKkp/CV/ef1mJuBXX6gcwzJZxgCKG6tm10OZ150WRKN530zmTqysUyZo+NP8DcFUSC5nh1zfV6QP3UP7RWZLMbGuqtpHwAT9psvS2BBe2ltzNT7M37Zh6kz6Kyw9Uw++x1nMrPlt6NTX+pE9yrEWX729+M8yKXFmXuz0m; 3:lKAKkbaklr0ESEx/xUbQmzISHrf5nIxu38WGFeHK/XABrp8MIhoXZ1uomx6P/2r88VFm4vwZmst1efbU2WYuRK0GiQ4pWGuWQfyo1sESJHdx/2PkVr1LbczxtEL14fnun6V6iT5JzBsN3P83o3uk8blZdgFrlZU5+J6vXDhQcQWReIY0B6g1RKdy9FPY3fndVQu8EZOZywt8dSm5P++MZ8XvHjwrKe1DK3zDboXiyDA= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR12MB0712; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0712; 25:qJUMmadGZLx24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MwTcFrykuR3Ff6uZUuCj3R7ghcloYh8bg5v6VXzNeek/+uSZVHtWOXuQ9dbTjSrt7ON201jIMccemWu358jgUjSFMMmjEvQHNNotk1OeYkGKPwQKt1vXR8DXiolidt2HNKDGAYLiOTObD4HYAED9uoCz338W94CJSrREUbBCPiyAoUDNIDDlN0GCHeStdxkcrMflENPDJ15FC9iFQAyOlMOvFIjaUMv0m2n2xfBrj9Wu4kQhm5xp/ZhuJ+4YeeV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521096)(601004)(2401047)(13021025)(13023025)(5005006)(8121501046)(13013025)(3002001)(10201501046)(6055026); SRVR:BY2PR12MB0712; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0712; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0712; 4:++19YOQEzP3pbwuCsH8QZgQFSiM4KH7TySEBmC6EttrHZoUTgXkIbG7iVP0nOnmH8KKfvJGgWce1NDMiZy5rC6HeloWFiQTQLe/xH+lIVwopeQPkteCJcFcTHZdgc9Ky+rJsloll91L8FljyM/RD2EXfx2nSBUbKGqaAP1CQ6PPs2zi9yQnYkzLVWgQCp3+J2tOJms1wM2AZWQif9vypqJj+jG/2OnOV7aoH9J2ourXdkwb839WHb1KastBUGzAMhhzAq4rkh129EQ2Ifd3iln44+I4Ja71zOC9/tNuy5aorMHrUO2ZqOrnEiTVvQZl6WDvXAc3TpJrf7BvQzC2Nmv7o2UbL919RW23x2pOS8d3HFWt8S5m3W7yJZT6R8DqglSIUT1rwXFH+eusmMsqZeQCBv72t9if7ndkx3cG0J44lTQgar5y5FLZWaPWWo8WvbLryKfkQ4fY9pCbTIYJTZg== X-Forefront-PRVS: 0931CB1479 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0712; 23:BsuQR74G6Ae9idl7X/cHXzqLk9cUpj0j//MCzolsm?= =?us-ascii?Q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cbVe7B9FJZxMyURirCm4miEp?= =?us-ascii?Q?LzLaYY5oQZsfnEPjQCn4okozXj8sGUg+maDPMgTCAiDdMhxsVOfLSbkIG2Xw?= =?us-ascii?Q?1UJ71SuHI7pJCwoag4xT5O5wUfWVVnK90E4lbKEguWlEA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0712; 5:dg5wux8llm9JMcc58rTaznqaJ2+Sup2dd0gdpzs/p5dR45V7BpYn8Qdg5uco3DLDeNzy/UczoKjXWS5M625HV8oLIrvz3x2lvXkPyVYL8wicH/HfwkHSq3A5mzy5xrabVrAvIFMLREWbXNI1dYGubw==; 24:K0/rWjakzb8pN3QpiAd61gz6BGsXYR9DNYO/aouxfZHMVGN0wXJay9QKCIkHY74ZHnYNn1I7py7drXHF2JqvgnwCQns2Zf4V6SAO0j0S37o=; 7:DZSwBDMvECKSw7N0eNO/Pip2KjcVgTUF8e5EB18sTcfuYkPR9ZG2gBjKnz6+mZMOailfTsa2mth5yuqikPAbJDFX6j8I7Lr2L24zOmoGcxxG4+w+8cQEGn7swSDg3cBnZEnuVdBfrv1dDXC2Ti2UGuZ0f6YwWeZS5JSxF9jHuE6uAriI2NBYA6IOKzn3P/jk; 20:akVHuDBxYv37zD2ulvp52Zobaj9I0mBPJXMzd7bJZQld4ASJmliRilAt0HbX7I0xSPRFVh/lMErTf5UuZ0IvAKtFcnAJ3azQZFJM9psLZz/06fH5ABVINMCRDhB8zlrdrBZ4HdL6KSpK5AXaStvx5BmVRLiruEokMjHSkGpYEbN4a4L3szTQndmpW/ZSAJ4+bKjEKlArxeo8j4TJyoaYfcZIl3kx472G620MDmKM08zO4K54MBv1Pgu+wvJiJOB+ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2016 15:05:52.5959 (UTC) 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.22]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0712 Cc: Vitaly Prosyak X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.1 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do calculation of vsync and hsync from range limits EDID block according to the spec. EDID 1.4. Signed-off-by: Vitaly Prosyak --- drivers/gpu/drm/drm_edid.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 7e49962..601152b 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1977,11 +1977,11 @@ mode_in_hsync_range(const struct drm_display_mode *mode, int hsync, hmin, hmax; hmin = t[7]; - if (edid->revision >= 4) - hmin += ((t[4] & 0x04) ? 255 : 0); + if (edid->revision >= 4 && ((t[4] & 0x0c) == 0x0c)) + hmin += 255 ; hmax = t[8]; - if (edid->revision >= 4) - hmax += ((t[4] & 0x08) ? 255 : 0); + if (edid->revision >= 4 && (t[4] & 0x08)) + hmax += 255; hsync = drm_mode_hsync(mode); return (hsync <= hmax && hsync >= hmin); @@ -1994,11 +1994,11 @@ mode_in_vsync_range(const struct drm_display_mode *mode, int vsync, vmin, vmax; vmin = t[5]; - if (edid->revision >= 4) - vmin += ((t[4] & 0x01) ? 255 : 0); + if (edid->revision >= 4 && ((t[4] & 0x03) == 0x03)) + vmin += 255; vmax = t[6]; - if (edid->revision >= 4) - vmax += ((t[4] & 0x02) ? 255 : 0); + if (edid->revision >= 4 && (t[4] & 0x02)) + vmax += 255; vsync = drm_mode_vrefresh(mode); return (vsync <= vmax && vsync >= vmin);