From patchwork Sat Jan 20 18:50:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 10176659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DF6D6056F for ; Sat, 20 Jan 2018 18:51:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F09F5212E8 for ; Sat, 20 Jan 2018 18:51:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF34F25F31; Sat, 20 Jan 2018 18:51:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF9FB24B5B for ; Sat, 20 Jan 2018 18:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=t2rL6uuDjRPUMOI0KvcmKfnqK+1YGLZcs7f6yCj1wUw=; b=P+/HkYXTigKOmKpCT54VScnSH6 2qcCtdDKWx1CHIvwkUDY0udda8mcuk2f53AYzERuLslEoEhwbwH++J0hklmozzivGyUGLlK+CQZQd djXuD39FQRlMVUSJWzIE4wLZpz7JxOh3KwoI8tukpFKhbKieoccIiI+5BXF6likuukPeIWamFepn5 RM8MMwjJNU9Jn4ZuUaN/vN0GogkwY0uaTBAXSvtM8O3Z//H4dsbe64KH4svdYzG5EgmQVC0pi0vxx D8BApAPT0T+mXDL8dN3k6LYj2tuD+6/gerM5tnpXxYqsdbi11f1fTJ7R9fO37y/7FGbJ8LXl0yMz2 ET55ONIA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecyEh-0001ei-1K; Sat, 20 Jan 2018 18:51:27 +0000 Received: from mail.micronovasrl.com ([212.103.203.10]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ecyEU-0001T0-6I for linux-arm-kernel@lists.infradead.org; Sat, 20 Jan 2018 18:51:15 +0000 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id CBC43B00990 for ; Sat, 20 Jan 2018 19:51:02 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1516474262; x=1517338263; bh=jr NHjbM++y9c//hZDMHw/A//1vYvddlfuqHT2oF+9IU=; b=OYNCD7lgaJv8DY1QNA 1ySqP7XAVDar23Q1Orq4zHN+B3tpWguu1L4pe0IAy0EOoCqfkkdz1YVTKsEWYKyO t3O+Dr8OsF7U6QzaxpcnZlOPNxdZO+sdb9G7X9a2KpbUfDWmucMebqMgHxiWLHBw 0WntXyjHZ5z+VLRK2x1iKrGmA= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4KS57z9bQQwL for ; Sat, 20 Jan 2018 19:51:02 +0100 (CET) Received: from localhost.localdomain (62-11-51-166.dialup.tiscali.it [62.11.51.166]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 40B02B00896; Sat, 20 Jan 2018 19:51:01 +0100 (CET) From: Giulio Benetti To: maxime.ripard@free-electrons.com Subject: [PATCH 2/2] drm/sun4i: Handle DRM_MODE_FLAG_**SYNC_POSITIVE correctly Date: Sat, 20 Jan 2018 19:50:21 +0100 Message-Id: <1516474221-114596-2-git-send-email-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516474221-114596-1-git-send-email-giulio.benetti@micronovasrl.com> References: <1516474221-114596-1-git-send-email-giulio.benetti@micronovasrl.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, wens@csie.org, Giulio Benetti , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On previous handling, if specified DRM_MODE_FLAG_N*SYNC, it was ignored, because only PHSYNC and PVSYNC were taken into account. DRM_MODE_FLAG_P*SYNC and DRM_MODE_FLAG_N*SYNC are not exclusive. If flags contains PVSYNC, it doesn't mean it is NVSYNC. And it's true also the contrary. Also, as I've checked with scope on A20, if (flags & PVSYNC) then SUN4I_TCON0_IO_POL_VSYNC_POSITIVE must be set, as name suggests. It seems all display io polarities starts inverted if 0. Signed-off-by: Giulio Benetti PVSYNC and PHSYNC only Signed-off-by: Giulio Benetti --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 6121210..e873a37 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -224,10 +224,10 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, SUN4I_TCON0_BASIC3_H_SYNC(hsync)); /* Setup the polarity of the various signals */ - if (!(mode->flags & DRM_MODE_FLAG_PHSYNC)) + if (mode->flags & DRM_MODE_FLAG_PHSYNC) val |= SUN4I_TCON0_IO_POL_HSYNC_POSITIVE; - if (!(mode->flags & DRM_MODE_FLAG_PVSYNC)) + if (mode->flags & DRM_MODE_FLAG_PVSYNC) val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE; if(display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)