Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2442312ybf; Mon, 2 Mar 2020 08:43:02 -0800 (PST) X-Google-Smtp-Source: ADFU+vvaMQ5JnR/u7sUzupJcp1/TWzp/IDpbI2ED34mGvbPIOCapAV73CQzQ+AdWpN1ffPq+ikAu X-Received: by 2002:a9d:5a09:: with SMTP id v9mr66465oth.214.1583167382693; Mon, 02 Mar 2020 08:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583167382; cv=none; d=google.com; s=arc-20160816; b=Os3rJwBkKs2LO7Nfk8eRGjQeQ52zAlPnq6tpjUyr+Y772iOkse9f/u1DN1dejQLtU4 bwywHQbuEO27w7I60P+v6eNS+1mjWrhybyaP2FIeK20Y9DukcGULI3rLAuWv9Xb+U7QL H/w+lOO5aJ3785pcKfvalvq4XJdotMh4uZb2JZ2iqOeMBHpkWCPKsNECyu18GCuIO12g xZQqvj2xEw8+qj2trMjq5ccUhlagF7Uwr7G2FRfBW9Set4Rb1i9RrIZ/Z4+/Rrwfzme8 s25OVlv/qe76PjNkwA2Q2asxkmy5OzSzkAendld/vfqA63Rcu/hfhfG/9K51ASDlXOVa MzqA== 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; bh=b1bODIHkQ59d829JnHMk6c65lWAdhucNtyGiTQC1HOw=; b=nHJQYhckfXdYvod5C66khHM15SSszE1FmtEnX47WU8EamNMXs+MCInrcud6EmhF2pO Zvmcvxvv3fiqZdFAYxr5hZ4b15VRUTrW2BQN2E2BGTKeSuOIz+YE8G9ImysBqW0O5uW0 OH1hMvG63XIwCHaB9vHwkq2zAShx28buH1KlBPVU20Q6DC7MS59SUHImKh/oLWGqorgz L5UwWMrgcfqF0MfzO0Fqgs7QiBcvFlWnV6JY34KQeVxzVXBGxtOSRszCg4XHMqQOEpU+ Lz2cQL/LjwqX413MurIrpdQ4v764N9J8wu+K5+WSsUmgYUXXlMkYFq0GMK0v+heksLgP OKNA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q81si4979861oic.174.2020.03.02.08.42.50; Mon, 02 Mar 2020 08:43:02 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbgCBQmj (ORCPT + 99 others); Mon, 2 Mar 2020 11:42:39 -0500 Received: from mailoutvs37.siol.net ([185.57.226.228]:51289 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726997AbgCBQmj (ORCPT ); Mon, 2 Mar 2020 11:42:39 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 824AF522BDF; Mon, 2 Mar 2020 17:42:36 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta11.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta11.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iv_LZWHOVX34; Mon, 2 Mar 2020 17:42:36 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id 30B8B522CF0; Mon, 2 Mar 2020 17:42:36 +0100 (CET) Received: from jernej-laptop.localnet (89-212-178-211.dynamic.t-2.net [89.212.178.211]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Postfix) with ESMTPA id 9654A522BDF; Mon, 2 Mar 2020 17:42:35 +0100 (CET) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: a.hajda@samsung.com, Neil Armstrong Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] drm/bridge: dw-hdmi: Fix color space conversion detection Date: Mon, 02 Mar 2020 17:42:35 +0100 Message-ID: <1955232.bB369e8A3T@jernej-laptop> In-Reply-To: References: <20200229163043.158262-1-jernej.skrabec@siol.net> <20200229163043.158262-3-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne ponedeljek, 02. marec 2020 ob 10:26:09 CET je Neil Armstrong napisal(a): > Hi Jernej, > > On 29/02/2020 17:30, Jernej Skrabec wrote: > > Currently, is_color_space_conversion() compares not only color spaces > > but also formats. For example, function would return true if YCbCr 4:4:4 > > and YCbCr 4:2:2 would be set. Obviously in that case color spaces are > > the same. > > > > Fix that by comparing if both values represent RGB color space. > > > > Fixes: b21f4b658df8 ("drm: imx: imx-hdmi: move imx-hdmi to > > bridge/dw_hdmi") > > Signed-off-by: Jernej Skrabec > > --- > > > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index > > 24965e53d351..9d7bfb1cb213 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -956,7 +956,8 @@ static void hdmi_video_sample(struct dw_hdmi *hdmi) > > > > static int is_color_space_conversion(struct dw_hdmi *hdmi) > > { > > > > - return hdmi->hdmi_data.enc_in_bus_format != > > hdmi->hdmi_data.enc_out_bus_format; + return > > hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_in_bus_format) != > > + hdmi_bus_fmt_is_rgb(hdmi- >hdmi_data.enc_out_bus_format); > > > > } > > > > static int is_color_space_decimation(struct dw_hdmi *hdmi) > > I think in this case you should also fix the CEC enablement to: > if (is_color_space_conversion(hdmi) || is_color_space_decimation(hdmi)) > > in dw_hdmi_enable_video_path() otherwise CSC won't be enabled and will be > bypassed in decimation case only. On second thought, I think original implementation is correct, just misnamed. Laurent, Neil, do you agree if I replace this patch with patch which renames is_color_space_conversion() to is_conversion_needed() ? Best regards, Jernej