Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp504163ybf; Sat, 29 Feb 2020 08:31:42 -0800 (PST) X-Google-Smtp-Source: APXvYqw7drQ/e1ViKEFX7jllEwlz0d3b3fFsNYWAm9/XzNmxR1jY5HvxC8J3Tz2XceTdmrY0f9JW X-Received: by 2002:aca:2813:: with SMTP id 19mr6763994oix.76.1582993902181; Sat, 29 Feb 2020 08:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582993902; cv=none; d=google.com; s=arc-20160816; b=II8c3w8TaTIE9nPknkdCwKC6wiufuZAtdXlTkrLKlm6ETBA4iEh/7ltMY4tqLJzt0a ynfQycRcbLS/c3YaSt5dXbOboStAblGvomsc/+SDheK0dKPRRTRukoaCSmjcimRj+irr Yrt2rTtS5+0g+zHOSEb+x5YKkyYpuU+XP4hB+NXICmWKZdmbqNE0Y5QM4g3CZH/ghKn8 xC3rG1vnpk6exBZTw5lZT9BVhDazKKgu8FA/WV2vRJ0FX/xnCv2ZRs8vGHCDAgzyKDej tRNxvPd5BAyRSa3r/aMlk80VqdDHpby67Awth2+NPuJZsPySzwLr1r+JSnHrFF23eX7G IQKw== 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=utiELlF1VwLY0mTktZvLW6TlVWkmatDHJTvAsuzw+a0=; b=aMgMU1FxjBmsbDeep7gipUhfPdkTZazSPdj7ptdDvDZ6Itaw6OnPxpBTnSFa3NQYo9 doM3TlyS0l3nIPd1uc0sSha4jkMoup0KPfr6jZ1nGv1LpU0UNEl+B/bxZBj3RCc0tcWc eMHxCj4eMXocsCqdcUxAzdrN0JXcvJI8PQOs7NZAQQ3IWP2/zlrtZcX5jKd1ytGffL8D mLSMt4yFR6zkLXzwhhTs7N7tKmIJBNniG6qkk0J8C6Pt4mhtQMxJ68tmlJmpqzxfwRFw KRc8MVVIG9wpWiceG/Mx0Y9/zEn9CYPA9ThwhTxlFSNxvL0/EyNagIGtacm6FT4Gukfc /nHA== 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 x12si3329767oto.194.2020.02.29.08.31.22; Sat, 29 Feb 2020 08:31:42 -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 S1727391AbgB2QbH (ORCPT + 99 others); Sat, 29 Feb 2020 11:31:07 -0500 Received: from mailoutvs40.siol.net ([185.57.226.231]:46048 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727177AbgB2QbH (ORCPT ); Sat, 29 Feb 2020 11:31:07 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTP id 1261C5235E7; Sat, 29 Feb 2020 17:31:04 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta12.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta12.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id HN22pp9Tlisj; Sat, 29 Feb 2020 17:31:03 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Zimbra) with ESMTPS id 9C3A6523546; Sat, 29 Feb 2020 17:31:03 +0100 (CET) Received: from localhost.localdomain (cpe-194-152-20-232.static.triera.net [194.152.20.232]) (Authenticated sender: 031275009) by mail.siol.net (Zimbra) with ESMTPSA id 0785B5235E3; Sat, 29 Feb 2020 17:31:01 +0100 (CET) From: Jernej Skrabec To: a.hajda@samsung.com, narmstrong@baylibre.com Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] drm/bridge: dw-hdmi: fix AVI frame colorimetry Date: Sat, 29 Feb 2020 17:30:40 +0100 Message-Id: <20200229163043.158262-2-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200229163043.158262-1-jernej.skrabec@siol.net> References: <20200229163043.158262-1-jernej.skrabec@siol.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CTA-861-F explicitly states that for RGB colorspace colorimetry should be set to "none". Fix that. Fixes: def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and = encodings") Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++---------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/= bridge/synopsys/dw-hdmi.c index 67fca439bbfb..24965e53d351 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1624,28 +1624,34 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi,= struct drm_display_mode *mode) frame.colorspace =3D HDMI_COLORSPACE_RGB; =20 /* Set up colorimetry */ - switch (hdmi->hdmi_data.enc_out_encoding) { - case V4L2_YCBCR_ENC_601: - if (hdmi->hdmi_data.enc_in_encoding =3D=3D V4L2_YCBCR_ENC_XV601) - frame.colorimetry =3D HDMI_COLORIMETRY_EXTENDED; - else + if (!hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) { + switch (hdmi->hdmi_data.enc_out_encoding) { + case V4L2_YCBCR_ENC_601: + if (hdmi->hdmi_data.enc_in_encoding =3D=3D V4L2_YCBCR_ENC_XV601) + frame.colorimetry =3D HDMI_COLORIMETRY_EXTENDED; + else + frame.colorimetry =3D HDMI_COLORIMETRY_ITU_601; + frame.extended_colorimetry =3D + HDMI_EXTENDED_COLORIMETRY_XV_YCC_601; + break; + case V4L2_YCBCR_ENC_709: + if (hdmi->hdmi_data.enc_in_encoding =3D=3D V4L2_YCBCR_ENC_XV709) + frame.colorimetry =3D HDMI_COLORIMETRY_EXTENDED; + else + frame.colorimetry =3D HDMI_COLORIMETRY_ITU_709; + frame.extended_colorimetry =3D + HDMI_EXTENDED_COLORIMETRY_XV_YCC_709; + break; + default: /* Carries no data */ frame.colorimetry =3D HDMI_COLORIMETRY_ITU_601; + frame.extended_colorimetry =3D + HDMI_EXTENDED_COLORIMETRY_XV_YCC_601; + break; + } + } else { + frame.colorimetry =3D HDMI_COLORIMETRY_NONE; frame.extended_colorimetry =3D - HDMI_EXTENDED_COLORIMETRY_XV_YCC_601; - break; - case V4L2_YCBCR_ENC_709: - if (hdmi->hdmi_data.enc_in_encoding =3D=3D V4L2_YCBCR_ENC_XV709) - frame.colorimetry =3D HDMI_COLORIMETRY_EXTENDED; - else - frame.colorimetry =3D HDMI_COLORIMETRY_ITU_709; - frame.extended_colorimetry =3D - HDMI_EXTENDED_COLORIMETRY_XV_YCC_709; - break; - default: /* Carries no data */ - frame.colorimetry =3D HDMI_COLORIMETRY_ITU_601; - frame.extended_colorimetry =3D - HDMI_EXTENDED_COLORIMETRY_XV_YCC_601; - break; + HDMI_EXTENDED_COLORIMETRY_XV_YCC_601; } =20 frame.scan_mode =3D HDMI_SCAN_MODE_NONE; --=20 2.25.1