Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp753811ybt; Wed, 8 Jul 2020 10:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylI8KOmVPyGg4cVwwM7+R3NkFwfaTyHaWmgcDu3ynku6YHC5UciW8lux0PrRcACRpDUm/v X-Received: by 2002:a17:906:5008:: with SMTP id s8mr41649428ejj.147.1594230478031; Wed, 08 Jul 2020 10:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594230478; cv=none; d=google.com; s=arc-20160816; b=QguzR0p7/WjRjmIj1CB/0xRcrTxPCxGfmexq5leveKde0J8ucBJybirg3YgnDEzf85 ajUJo7WY/pqPlWN5QX9Xpc1M9nze26InSleEaxOxH3fLu/3zx98rC/CajmsHzJQ/+eLC xklsbydNwniqc9YV/OwYQXhYnJ/3MkU0XuwpCvxnCn23FEFHncgQrkZ54nYFFWqBnxpw PrfXhRORRds+5Lo4OCgQxDTHNZF4lwUj9mquVm3/CA1ookXgBpMWVDTClzxKlJy0m8F3 7f5CoTCc0qL/5LCayviw5yBQPc+86wkHE8NICmk4hsjlPbVwfBC2yvZLpQRBEvNUhOUe +gKg== 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=CCM3FR9MommKfkWPXC3zWsbEckUn2ox+/fsqWabGT3A=; b=Nx2MCdYHrWpTbdzx/HyxqPx4cidIw49AxsOstK7DSW8t9rpVY5vv3AGBIkzCC90E9r x2rDm5xIC5TJBoygN3L9NRfY/Z6A85Fgx1qtH32PCx9w8VLM8bh5XQsNYzNICpHb8BQl GImeVzf124ePqpO2PRAwJSgifOMXcmm2O2Rl3PbgLLhKEnLIRLZWMFViFpqc+a7kLU87 QBZ38I+qqIO2ZBegye9vXjmulY/FLZXF3XzPhZk6r7tITj5Z9khQAhRsLu3ALuKOBC7N ND6+WDFRhIHGKCWxcOd2o7sdm28DpGKcB7DadE6TKkJP1+PJc3+KUqaZFQ1uhGmX8qii 9riw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=aI20NJSm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fiV4BgGM; 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 i4si448299edr.244.2020.07.08.10.47.35; Wed, 08 Jul 2020 10:47:58 -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=aI20NJSm; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=fiV4BgGM; 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 S1728186AbgGHRon (ORCPT + 99 others); Wed, 8 Jul 2020 13:44:43 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:38871 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbgGHRoS (ORCPT ); Wed, 8 Jul 2020 13:44:18 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id E1057102C; Wed, 8 Jul 2020 13:44:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 08 Jul 2020 13:44:17 -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=CCM3FR9MommKf kWPXC3zWsbEckUn2ox+/fsqWabGT3A=; b=aI20NJSmlPS4cflG+uQwQnmyreMaK uk6sBjuRYpQI0N11oKd7qtnUmu3xM5Xc5RmfW80AqQ1aSxDcXfHVLwpakf23eQx5 hP1OnKvdiWm78508JT7Qj1r6BsELd9YoyOg+iPiT2r6HDU2cJd22nSQ9H7qhp0Sm 0NsRQIJxLctoBathyMzR5es4g95uPGqlYkxymRd7xg1NFWIv+58FbiOFrxEWS90Q 4FUyTxK95WeDaGnsixesSemIjFjTEpsmSFI9IVb/O1kepASSKJyNYDGpmrLYCeF/ +d7q5IwnrTC8WHmi7ckBDadA/VlJl+Aob1e0qkzbTn0vCrDb9Tg36RihQ== 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=CCM3FR9MommKfkWPXC3zWsbEckUn2ox+/fsqWabGT3A=; b=fiV4BgGM Dt8UZMM2K7v3YC4AokbUY+nWaU54y8J4yQ///pTOoGpmqcdBtOa3bzBSQ/rurECc EruABXrimIjuk/XPfuflUGqh4QdW9n+Cpjk+faFsNt3SKha5fGqEv1HiF2oJst7+ a6KQspanDwqfqnyumDzlGcCyK7r9msR24A1MBY4aEL/vmrXLdXKOXahdbBZJ40D6 6DovcrPpH5axM7jV+5k5fIrzntRPQLT/euu1YUEeoNMIp/2gkDtY/uRhaWe+9oUO SokV05Q2nCuHJfLtX2F08rT72a39lfbjhExyTiy4QNlELW1sm19i0zvSr5m6vhyi IeIOwXVEphctXQ== 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 2A8F1306005F; Wed, 8 Jul 2020 13:44:16 -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 73/78] drm/vc4: hdmi: Switch to blank pixels when disabled Date: Wed, 8 Jul 2020 19:42:21 +0200 Message-Id: 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 f56a718a3643..37463b016b47 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 d1e8961edaa0..30af52b406f1 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