Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp752111ybt; Wed, 8 Jul 2020 10:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY6/iQtKFnnpqrY1DnnkqKt10x0KJl+cvKUzF3p7QAD86kdN4RUcXNRb+acEKEen5ljZY8 X-Received: by 2002:a50:fc97:: with SMTP id f23mr58165555edq.255.1594230345429; Wed, 08 Jul 2020 10:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594230345; cv=none; d=google.com; s=arc-20160816; b=jta3085JxKXtE9T/nl32unCw8uRfUSFj250sYFO4o23Ub41FweVM7Qk+ra53OTj5qt 8qLd+2s5/aBNv7AQfvqXeD28LfvzbN/k8w+ciUHGW6PMDKXxKrYGQMvF7wUEG5sJ7JNF RMGCPHASmt23JrnQlW0GGdRW10YvDN14RtH0bZqly9I/Bdup3v2wGMQ/REF1hYGVrwyD xcgoNxDclH/qbdNe3HurFDxWBvq5kVZyAQRgjMGkGaYp8AyQKiuQEemhThawjrmk7Cmu BWPjI3UnN6xyJMTp8wuC1kEInSaihATFq8VBkigyhbd4NOSnrhJ7wUlWq+O50WslV5LL QeBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=1mEX+3++0BewVJPrut0JzEcRQwhjaEVpe1Cyf0r7/ro=; b=XzIrwhYiOPrZ3gSiYyeKu3iN6FGQXEJxth6uU7F8ZxWwt1tHJJnyQu69Yl6eN3gW8i /T07Z/06U/leSH8X42avlBETnCk3wE8uHxxnX+1pBQyfids2ldcLow7sOQAQO1+qIYv+ WC9oMw+pVVvMCeQapiJO1sa630gebPqcLqkvPMHkTHdpKJ6FNgvM3zxnBVDgBvpIM4df uotg/4Ql2GnkMmRXV94D7GphMOoG8e621HG6ZrJf02htJUbPpVs9/uLsznZ+imVKai81 eP9YaC1HAvstxdas3C56JeZfBG5KELi9Jro80WJtI/N/IQ5HhWxoEk3HnUEorKrPa9yV KCnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=cNb0scoy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fGlsB1WP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw6si291515ejb.506.2020.07.08.10.45.22; Wed, 08 Jul 2020 10:45:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=cNb0scoy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fGlsB1WP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbgGHRoU (ORCPT + 99 others); Wed, 8 Jul 2020 13:44:20 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:60545 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728055AbgGHRoQ (ORCPT ); Wed, 8 Jul 2020 13:44:16 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 7CEE1102D; Wed, 8 Jul 2020 13:44:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 08 Jul 2020 13:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=1mEX+3++0BewV JPrut0JzEcRQwhjaEVpe1Cyf0r7/ro=; b=cNb0scoyYyNACCyd9DH6nq4YpK1td AaLkYyXpdgNbV1f5WteZy/buxOsf7Zfxnqa+5q8msRKhbvUrr1YFA6fGPavJ918O k2J6r5b80VmJNax9fRmjKW6S0Js3U96INLwL9BgnGmOEGmHf3x+RrWimfrkv6QTg wn1fnUfcJpiQi4YGR0MBsBppHh3iFMy6vj3BZWqLBLorVuK1KJDUh+/qSdZfZ9Jp rqKEBpw8GHKKCq64F1LdsqnuyK4rBkG2jN672QVc4FidrZTdGS3nrxruETYJuU1I WR6olJ3F9E58/gdLXgnEJ6cqeEuMSp3N3092fdoEYTkhEcIcSmkvFP4nQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=1mEX+3++0BewVJPrut0JzEcRQwhjaEVpe1Cyf0r7/ro=; b=fGlsB1WP B0TKVh0GpmRgREEj7HFfH00RpKvJt97hmeqxTlC4M5u/mkMGe1OSKTPWWiDoor5v tLyDoF7OfAn3s+OmuhetjxRqvDnD5uvEwgoviAEQImV59p/oOsKzKeh71kX4FsTe 4xjI87dvy5YouBTAae20tIONy/2d11vGIa4cZHgZIChfYVbhenntw+u5u2Y5p5ta H9a/EjDEhF2iKyM8BK78zFyti44pBPE0N4vabUA1DBwcTQfOsxdJnCMRnfooyluY DiUjHxmXFPlqKvsWGzuJ5Cwhe3Bg+kHDSW8mqtlPqg3Zs2DdsfrPJdoSVrNSeD1u iB+hgRaLyhWYmA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudejgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepieeine curfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id AE6B0328005D; Wed, 8 Jul 2020 13:44:14 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard Subject: [PATCH v4 72/78] drm/vc4: hdmi: Do the VID_CTL configuration at once Date: Wed, 8 Jul 2020 19:42:20 +0200 Message-Id: <06921938439fdf7da952fb8d148932fc9403f82a.1594230107.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The VID_CTL setup is done in several places in the driver even though it's not really required. Let's simplify it a bit to do the configuration in one go. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index bbe521ab000b..f56a718a3643 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -428,10 +428,6 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, HDMI_WRITE(HDMI_VERTB0, vertb_even); HDMI_WRITE(HDMI_VERTB1, vertb); - - HDMI_WRITE(HDMI_VID_CTL, - (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | - (hsync_pos ? 0 : VC4_HD_VID_CTL_HSYNC_LOW)); } static void vc4_hdmi_recenter_fifo(struct vc4_hdmi *vc4_hdmi) @@ -520,8 +516,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder) if (vc4_hdmi->variant->phy_init) vc4_hdmi->variant->phy_init(vc4_hdmi, mode); - HDMI_WRITE(HDMI_VID_CTL, 0); - HDMI_WRITE(HDMI_SCHEDULER_CONTROL, HDMI_READ(HDMI_SCHEDULER_CONTROL) | VC4_HDMI_SCHEDULER_CONTROL_MANUAL_FORMAT | @@ -555,15 +549,19 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder) static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) { + struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode; struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder); + bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; + bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; int ret; HDMI_WRITE(HDMI_VID_CTL, - HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_ENABLE | VC4_HD_VID_CTL_UNDERFLOW_ENABLE | - VC4_HD_VID_CTL_FRAME_COUNTER_RESET); + VC4_HD_VID_CTL_FRAME_COUNTER_RESET | + (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | + (hsync_pos ? 0 : VC4_HD_VID_CTL_HSYNC_LOW)); if (vc4_encoder->hdmi_monitor) { HDMI_WRITE(HDMI_SCHEDULER_CONTROL, -- git-series 0.9.1