From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E169C433DF for ; Mon, 8 Jun 2020 19:57:15 +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 6796C206A4 for ; Mon, 8 Jun 2020 19:57:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6796C206A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.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 090E089ED6; Mon, 8 Jun 2020 19:57:14 +0000 (UTC) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FDB789ED6 for ; Mon, 8 Jun 2020 19:57:12 +0000 (UTC) Received: from 118-166-128-180.dynamic-ip.hinet.net ([118.166.128.180] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jiNtL-0005uT-4T; Mon, 08 Jun 2020 19:57:07 +0000 From: Cyrus Lien To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/edid: add support for min horizontal rate equal to max horizontal rate Date: Tue, 9 Jun 2020 03:57:04 +0800 Message-Id: <20200608195704.29841-1-cyrus.lien@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" According to EDID spec, table 3.26, byte #6 and #8, which said "Minimum rate value shall be less than or equal to maximum rate value". The minimum horizontal/vertical rate value is able to be equal to maximum horizontal/ veritcal rate value. This change check if h/v-sync excess maximum horizontal/vertical rate if hmin equal to hmax or vmin equal to vmax. Signed-off-by: Cyrus Lien --- drivers/gpu/drm/drm_edid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index fed653f13c26..23878320eabd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2674,6 +2674,9 @@ mode_in_hsync_range(const struct drm_display_mode *mode, hmax += ((t[4] & 0x08) ? 255 : 0); hsync = drm_mode_hsync(mode); + if (hmax == hmin) + return (hsync <= hmax); + return (hsync <= hmax && hsync >= hmin); } @@ -2691,6 +2694,9 @@ mode_in_vsync_range(const struct drm_display_mode *mode, vmax += ((t[4] & 0x02) ? 255 : 0); vsync = drm_mode_vrefresh(mode); + if (vmax == vmin) + return (vsync <= vmax); + return (vsync <= vmax && vsync >= vmin); } -- 2.25.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel