Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3343219yba; Mon, 6 May 2019 22:53:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQRsnPfDBknFuaHxERXqE3YMdlxBNoCqChht5eGMsfTLQ+Lsej2BKXaNnqtGNVJjMlPYEO X-Received: by 2002:a63:ed12:: with SMTP id d18mr38460206pgi.248.1557208410682; Mon, 06 May 2019 22:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557208410; cv=none; d=google.com; s=arc-20160816; b=QABfju8QubyoZzt28ZblpCr54AHwC+a2L4k2KIBNezV5bGVAw5Fk9wkbBHFQNBxWaU ZKHmluwsgRw6e4hdsEj/9s2jQRfnX8pko7h1FjL6Vy9ia+Y2G80umMZHHMiO9sIuE0s3 4DcPPPEXcCG5HoqvrKogYkxpLbxeKEjr+cWsqHMsaEVArIzgu0hDtlsywbFXO9czZ4Jl q09TxJGz4g4bHwoE2FfKdv4n4z0M9+sTyTRKnzmytQHNL1B/JVvS68VH7r4TVsbdnqzv SJMMB/7gRBcwB/KH5013VpWNNz+vDRQ/fcsdVFcvQ+puJ99bCzpqNuvkf3NkcmJ1TJGc cAwQ== 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; bh=Yrc3PCl8/nwjnp/OKtATx+2mzIKUcTutRTjJZz9//xg=; b=RuFYb+HYgJ5ZuwASwEA/dqzjS8TzjejVf25i4m19y0maaljKuF+0yLTjyhXjTSYheH KUVBIVqrkOFy0B5FLVomt6jkHjNWA+4BKeSp6fHF+3iQnMtbbp4+W2efeYCaMpToSfZ2 CbMeUaZtoIvU99KWqdEXmaXwfUuSil4EoFfho4diUMeo6KLoQdAGi8U9d03DjCCPOhpp TFxdcu0cCplzcDouq351Gqz3bIcB7XeL/BT7rXgaExSIe5H4XhUYKsFhpIitTxTqfAuL ZBXfJGSyRltFbUd6XGUBBhv3g+sR8piU7WtiQuuY5vLE4ua/G/oJWqpoS2abAlyZcHs0 fxiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c34i5nzc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l71si17401254pfb.250.2019.05.06.22.53.15; Mon, 06 May 2019 22:53:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c34i5nzc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbfEGFwa (ORCPT + 99 others); Tue, 7 May 2019 01:52:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:59106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728859AbfEGFj2 (ORCPT ); Tue, 7 May 2019 01:39:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F102205ED; Tue, 7 May 2019 05:39:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207567; bh=1a82mOvcxiOhSPOIhzwEn0QxH4OostE6OsD7NBGsYhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c34i5nzc+81795kWOmyMfmBSRDmeA+6UgZFAvnfqmnJhMmpbTODYNqtXnF2RWqR9n aujcLsgn+7fTkib28l1kqdfy6WF1ZRN6y+g25kdCuwISH0aGpwa+K8LhvZWfR19Q5j lm4TA9jsZF/llRuDYb3KagW3buVB/oKJYBfgddsQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lucas Stach , Jonathan Marek , Philipp Zabel , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.14 30/95] gpu: ipu-v3: dp: fix CSC handling Date: Tue, 7 May 2019 01:37:19 -0400 Message-Id: <20190507053826.31622-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lucas Stach [ Upstream commit d4fad0a426c6e26f48c9a7cdd21a7fe9c198d645 ] Initialize the flow input colorspaces to unknown and reset to that value when the channel gets disabled. This avoids the state getting mixed up with a previous mode. Also keep the CSC settings for the background flow intact when disabling the foreground flow. Root-caused-by: Jonathan Marek Signed-off-by: Lucas Stach Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-dp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-dp.c b/drivers/gpu/ipu-v3/ipu-dp.c index 9b2b3fa479c4..5e44ff1f2085 100644 --- a/drivers/gpu/ipu-v3/ipu-dp.c +++ b/drivers/gpu/ipu-v3/ipu-dp.c @@ -195,7 +195,8 @@ int ipu_dp_setup_channel(struct ipu_dp *dp, ipu_dp_csc_init(flow, flow->foreground.in_cs, flow->out_cs, DP_COM_CONF_CSC_DEF_BOTH); } else { - if (flow->foreground.in_cs == flow->out_cs) + if (flow->foreground.in_cs == IPUV3_COLORSPACE_UNKNOWN || + flow->foreground.in_cs == flow->out_cs) /* * foreground identical to output, apply color * conversion on background @@ -261,6 +262,8 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) struct ipu_dp_priv *priv = flow->priv; u32 reg, csc; + dp->in_cs = IPUV3_COLORSPACE_UNKNOWN; + if (!dp->foreground) return; @@ -268,8 +271,9 @@ void ipu_dp_disable_channel(struct ipu_dp *dp, bool sync) reg = readl(flow->base + DP_COM_CONF); csc = reg & DP_COM_CONF_CSC_DEF_MASK; - if (csc == DP_COM_CONF_CSC_DEF_FG) - reg &= ~DP_COM_CONF_CSC_DEF_MASK; + reg &= ~DP_COM_CONF_CSC_DEF_MASK; + if (csc == DP_COM_CONF_CSC_DEF_BOTH || csc == DP_COM_CONF_CSC_DEF_BG) + reg |= DP_COM_CONF_CSC_DEF_BG; reg &= ~DP_COM_CONF_FG_EN; writel(reg, flow->base + DP_COM_CONF); @@ -347,6 +351,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base) mutex_init(&priv->mutex); for (i = 0; i < IPUV3_NUM_FLOWS; i++) { + priv->flow[i].background.in_cs = IPUV3_COLORSPACE_UNKNOWN; + priv->flow[i].foreground.in_cs = IPUV3_COLORSPACE_UNKNOWN; priv->flow[i].foreground.foreground = true; priv->flow[i].base = priv->base + ipu_dp_flow_base[i]; priv->flow[i].priv = priv; -- 2.20.1