Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp952286ybm; Wed, 27 May 2020 12:02:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrA2vFST3fqHNBN31lEaCgqzhONNJiTrtM4BXTaxilByYeA2gwmXQHIMLF2QWtjYoN55EC X-Received: by 2002:a50:8dc2:: with SMTP id s2mr26189362edh.318.1590606139369; Wed, 27 May 2020 12:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590606139; cv=none; d=google.com; s=arc-20160816; b=rl+8f9URwmkvbC23J/DrfA5sLJMw10ikgq0ULWnRkLSORCTNqFa7HR8zWOH6QyAxT+ 6FNCD3IcTffc2vVDfwcrupu9yLzsMwJ/GUpOvHifXmywQEpWWMT+ygav5yNr4nVfwVHq 5QJtqUpOAVp4zxt3Qyw/JZLrx22zZKK02yQlEy299ELSB2rpvBxlgx4Ok/9OEqQFk5D6 mzVxlQZPt/1kOP/efvsLKPaBY4nh/IcrgBkjd1rohmFPaiO+ioKrTnezajyFZX1fikti l/udB5YDssaX6B3Q4xycsXWzX6nM6cVKdFRQelO0B71dDoHA8BYmESYJCk8h1w7awIyM M+lg== 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=BuUKiGuqk973sDDN5AZmCuX6+VtoVQEUzT93MfWaojA=; b=O+Kwbk8PcjMInifW8iWyIph+8STYEu8dACPE/rO7d2eQBhaVxL88c0KorImb8pfBqF TG0XCzOe0zb8Pcui4A42JETL8r9NlAWNiqV2kE7tA9vYM9FF+vHYKJvX1c/GR46xLGcl +F6/+7f2Yt7YNL/isP60OCJHyfPcGfLGvK84ZWTir6WHmxgSFCP1EEi9t4fZs00SsBSj 2ZbF3dWN+KafSEF/oGEsjRWUZuGQzkaO3IEon6PvQkSzWHsBsBYKRcSJPYYbEOVvL57A 72Zr/mR4XUlvUfORj2Raorktps3jx/7odJrsnDdRVlkjgzEqmyq4JUQIEU76uX2HFQ70 UtbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=jTygBAYy; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=y5Rh7V3Z; 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 gt11si2527224ejb.699.2020.05.27.12.01.56; Wed, 27 May 2020 12:02:19 -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=fm2 header.b=jTygBAYy; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=y5Rh7V3Z; 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 S2390512AbgE0PyG (ORCPT + 98 others); Wed, 27 May 2020 11:54:06 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:46947 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390361AbgE0Pv6 (ORCPT ); Wed, 27 May 2020 11:51:58 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 6D84F582126; Wed, 27 May 2020 11:51:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 27 May 2020 11:51:57 -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=fm2; bh=BuUKiGuqk973s DDN5AZmCuX6+VtoVQEUzT93MfWaojA=; b=jTygBAYybWdJmfyo8k2Ct9ZWKqqdz 6cr3EDlE1KyQn90HRJQ4yszEkjDwFHwNGpPuQAe7hEyFnGsktGzjTB9lYB9sPQLA mPIaNz4PqhauZYpuwLp1kh0rcJ6yDNKiifb2SSGV2o3Hu6z4PhCcQo1+2A40dWZl /natkAQ5x+kJDaNVYwvSIZwMzI8CIHsiEWlXjZ2AmXAILn/MW+rBFwAt8o2uk55j vKjoSGK/0UI2ldCMHuzeBFqPq/TeQwAXqz6Z+Q3f/0xcPquuzoshx5tEzZEDfUKm DRtyt+3XkKepuvAZZr7Q+FYhy+AA6hoH596QMK3wICNAUt1xylrHWz7aQ== 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= fm2; bh=BuUKiGuqk973sDDN5AZmCuX6+VtoVQEUzT93MfWaojA=; b=y5Rh7V3Z qWQN1KSDAMmzPoDI4HrmYqdhSxMjEQFFxyCvXBhX1X4TJkQqJlCkhFbG73UuPPYf CohwqFLzxJunDdf4/vytLXKd//rosgtBhI2+bg8uHGk8dip/2PQZqiNGwX/6OlVU fn3RUr76Yoe5SPN0cJWpgIlKVtQRzlmScSk/PGuprazeOUAIusAPMigSvqOQxiTj ZMigkVijCL7oESAxGsXk8cmwINyriVlrOttj01fcKCWikjUhyBPcVgMZjXYzt7qk yKau+41WP0eCWDlQIj2kYLQWvB5N9/KyNEkZGOwDh8ax41J2sqrJtBRDv6QQYcv/ vhyHdjUs5PAn6A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvgedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepjeekne 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 1ED1A328005A; Wed, 27 May 2020 11:51:57 -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 v3 102/105] drm/vc4: hdmi: Switch to blank pixels when disabled Date: Wed, 27 May 2020 17:49:12 +0200 Message-Id: <271605b39ee5e9bc7db5ac1d0ed9df6ecc4edc29.1590594512.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 In order to avoid pixels getting stuck in an unflushable FIFO, we need when we disable the HDMI controller to switch away from getting our pixels from the pixelvalve and instead use blank pixels, and switch back to the pixelvalve when we enable the HDMI controller. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++++++++ drivers/gpu/drm/vc4/vc4_regs.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index d889a83a0f56..8c9cff9ce216 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -325,6 +325,12 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder) struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0); + + HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) | + VC4_HD_VID_CTL_CLRRGB | VC4_HD_VID_CTL_CLRSYNC); + + HDMI_WRITE(HDMI_VID_CTL, + HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_BLANKPIX); } static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder) @@ -563,6 +569,9 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder) (vsync_pos ? 0 : VC4_HD_VID_CTL_VSYNC_LOW) | (hsync_pos ? 0 : VC4_HD_VID_CTL_HSYNC_LOW)); + HDMI_WRITE(HDMI_VID_CTL, + HDMI_READ(HDMI_VID_CTL) & ~VC4_HD_VID_CTL_BLANKPIX); + if (vc4_encoder->hdmi_monitor) { HDMI_WRITE(HDMI_SCHEDULER_CONTROL, HDMI_READ(HDMI_SCHEDULER_CONTROL) | diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h index 5a3ee2030cff..ce103f925f05 100644 --- a/drivers/gpu/drm/vc4/vc4_regs.h +++ b/drivers/gpu/drm/vc4/vc4_regs.h @@ -723,6 +723,9 @@ # define VC4_HD_VID_CTL_FRAME_COUNTER_RESET BIT(29) # define VC4_HD_VID_CTL_VSYNC_LOW BIT(28) # define VC4_HD_VID_CTL_HSYNC_LOW BIT(27) +# define VC4_HD_VID_CTL_CLRSYNC BIT(24) +# define VC4_HD_VID_CTL_CLRRGB BIT(23) +# define VC4_HD_VID_CTL_BLANKPIX BIT(18) # define VC4_HD_CSC_CTL_ORDER_MASK VC4_MASK(7, 5) # define VC4_HD_CSC_CTL_ORDER_SHIFT 5 -- git-series 0.9.1