Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp463003yba; Wed, 15 May 2019 04:33:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwCqYn9pOFc+FyTRynqOpe3pFg9AeYenEpSgKxatSAVmj0yi7RYfmtRG7P4LjV4WgwIvj4 X-Received: by 2002:a17:902:2983:: with SMTP id h3mr17334589plb.267.1557919994952; Wed, 15 May 2019 04:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919994; cv=none; d=google.com; s=arc-20160816; b=qUD/fNhE8Mqu0sDZryEfOxF7bIufnaNNviuQCNN/hDDYINLyPVtZOhuiQ6QfbwQ8Aq 9vYYRoibzQzIDi1/Ib5ijUB90ay0rdAHJ59ulQvVjL8V5Bb1yn3WLeFC8CLPvCLtyqdR utvUJGPV8ELFuUzrnSo7jp4l6eCusB9FC1J2uVSUoiAkKbdijfQfPCn/lkaHEKgAeftg jfljV89zcN6l9I8KtZPuExULjVu6t02iJHn9W1pGVL37jb9atGeFEH6xvjQqv7UOrT6Q cOGb/9BnokMvUnHUCSRhmGLr9SKXuri7MzPnS18loX0N//htps7fUEOSIxOnhEkd1COs Q4gQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FbI09YyrtsrVuZsThXUn2mfl7IGqCWta2BDd6iuJUCA=; b=xw/3+Fs6Ae1HwUtiXeKcYTdd27tMQyRvbAXA4mPjUASKsHoOGqbRaCE6XL0/fmogbO nQlc/mTdOmc60pzyI3UM8eIbg8UCnyGy1peM5n8sVaTbsHbPsvYZAJEthfdPruBBf1mr KkQfuf4VrGwT/r+4h/bANY/p31Kf5ny0CCK8pgzrflr2HPjNUtT1o3Pve5ZRRWzfjsgt JeIyEjUWouo/o0EjAoti7TlnWJaYbplKllTp/tihhnK9loLcI84rHtvYQpvCgrIW6SnZ hULMwY5MbSBIcjdkSMm5AKoityPofDCR+T7TjN3QVOoKOLYj2Iesw2uOcDA3MZSvA5VS Sqyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Udxz9BWk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si1593513pla.313.2019.05.15.04.33.00; Wed, 15 May 2019 04:33:14 -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=Udxz9BWk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732869AbfEOLbO (ORCPT + 99 others); Wed, 15 May 2019 07:31:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732855AbfEOLbL (ORCPT ); Wed, 15 May 2019 07:31:11 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B3FC20843; Wed, 15 May 2019 11:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919870; bh=150jhkgBPAGqDHBLd7kUBOwIldgeC8zcqCG3Pz6Cp34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Udxz9BWkaBGQolMyWkcfU9bNN4sMKrd04kDVYez989voV07muqCYqG5rPjC4Wp8Go 6Wr3Z8nlxFDfarU3+lQBbYxW+ex1QnwwKLBLFxefK7DS8iBCshsASV/eG1mkrpjcht gaHgsvzzMhTIeRc7SnJdvhNE8/WWi7UU6Z3w0X0E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lucas Stach , Philipp Zabel , Sasha Levin , Jonathan Marek Subject: [PATCH 5.0 081/137] gpu: ipu-v3: dp: fix CSC handling Date: Wed, 15 May 2019 12:56:02 +0200 Message-Id: <20190515090659.363951177@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 9b2b3fa479c46..5e44ff1f20851 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