Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3656551imu; Fri, 30 Nov 2018 04:05:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XiOahFrFgqx68pHxgsgG8WExPxnO6rNlHuUQBJXR6t0MlBQ7GyPoM3lR3oNHmLhSchi5gl X-Received: by 2002:a62:7a8b:: with SMTP id v133mr5457279pfc.159.1543579530051; Fri, 30 Nov 2018 04:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543579530; cv=none; d=google.com; s=arc-20160816; b=moKGbqDM0gHMh2+/1IYSMUsiGPclQtbHFYSXMp4NKb+qR0+NV7ISxt8ajcyxLW+ioa b9KC0F4Z1x1olG21qA5moHati4P2MjCvk+CadQ8lzkHykQv8JipqWwLV/cN0gdJXtmuX bbi+2wG+VXw2vebMHYYduFAi1NZ5E5NL+492Wl4CYYJ4oz/PNYyVqy9/Ye6dfUatwpRa wOTTYDH5ZyMtx0wqDsgac7lWLv/uNbBNRJr0UIucKkVsd+bJsa4/4MC9VFuZIoGwogSd DzMZSyaeJxAcZcNyBBpm08EtSz9fLUoAwEE5CNKVKo5Kx+KO6NCr2g+oyAvhy2fDhCKa r5EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=lBf6JAoFHbx6NthwBSg2D1kScF7EVOwlotNynBKwKIw=; b=V5R0onaADZ2wAhNj4iHL+8tIXtMZ6+FG7UAIOJwzXkkCL0R8niRKiKxKYFdC1xgiW3 w6GSwmWXhH+FaI9Pz+Mi5AgqXUiLM1iQVSseKl5coZpAqisiHN/Rtha9j9vYfco66eLi PYcZz6r+I6SPq+vQ0AcEaiYWdS5/+uhTpk7h84P5ofzhzRrpyHx10dvj8sVojQVL4a2T n/4tyGK56kLhp2P61QtR1TJFZRoLB2Xvl6zIIvjBjz+mQf+TqEvzw9sM9JrBX3Xh9eGz 7LTMh4QYHRmqDNT2ih8B0TOQ9teu4y5vVHb2QCP7WFoVwFODtb8NjSScgZT5v1yar9V8 LAjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=aqrkyehf; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si4627256pgg.143.2018.11.30.04.05.15; Fri, 30 Nov 2018 04:05:30 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=aqrkyehf; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbeK3XLf (ORCPT + 99 others); Fri, 30 Nov 2018 18:11:35 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57821 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbeK3XLe (ORCPT ); Fri, 30 Nov 2018 18:11:34 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181130120230euoutp01d333b48c29bd14a64bc3c10866edd087~r5T2sfVnK1464514645euoutp01Q for ; Fri, 30 Nov 2018 12:02:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181130120230euoutp01d333b48c29bd14a64bc3c10866edd087~r5T2sfVnK1464514645euoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543579350; bh=lBf6JAoFHbx6NthwBSg2D1kScF7EVOwlotNynBKwKIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqrkyehfkbIjlfNYrRCELmGMCmo4UTsuTjtstKvInQiG3i3gpGZbBFzoTi87vrRHt hRDNLLjwyt+afxWegPoTHzZAZSIFmWv9CMQQMdyFMZnEp0XUXmKFs0optXY2EvLumr GSSrpmYeMbVQHh6iZoFgtanJyVlYNbohCoxXdddA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181130120229eucas1p2218be6aff3ee2cd618709a63da427bfd~r5T1xFy1i0231202312eucas1p23; Fri, 30 Nov 2018 12:02:29 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id A5.6B.04294.5D6210C5; Fri, 30 Nov 2018 12:02:29 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9~r5T0_MW5P2507925079eucas1p1d; Fri, 30 Nov 2018 12:02:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181130120228eusmtrp26e297096bd7a2e63c1764b930b85e90b~r5T0u5LPx2249222492eusmtrp2g; Fri, 30 Nov 2018 12:02:28 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-96-5c0126d50732 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C2.A1.04128.4D6210C5; Fri, 30 Nov 2018 12:02:28 +0000 (GMT) Received: from AMDC2034.DIGITAL.local (unknown [106.120.51.41]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181130120227eusmtip21b340e588508aee92205f932d1bb7546~r5T0IGLcg0121601216eusmtip2F; Fri, 30 Nov 2018 12:02:27 +0000 (GMT) From: Christoph Manszewski To: dri-devel@lists.freedesktop.org Cc: Christoph Manszewski , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Kukjin Kim , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 1/2] drm/edid: Add colorimetry helper function Date: Fri, 30 Nov 2018 13:02:11 +0100 Message-Id: <1543579332-16609-2-git-send-email-c.manszewski@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543579332-16609-1-git-send-email-c.manszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfyyUcRzHfe957rmHOR7H+EzNrWvZZH416lk1/Vhbj//UsiVKF09YHN05 JRViCqVDi0n6MeZHtnSdH11FbtxlcaYwx8Qmm1/NdPRrIo9n5r/X9/3j+/7u2UNiEp3QnYxX pLBKhTxBRtjhzcY/Zp9BTxTp32PB6XvmbgFteluN6IHlBYIuHtfg9PTXfpy+PzmH0X19jSK6 99a8iNZODgnpL/oKgi7raxPQzxabcHpiph3RYyWdiC4rmSEOOzKVDemMtj6PYFp+TgiZyu4T zHiBScC8rspgTPoREVOoq0eMVesRanvG7mAMmxCfyir9gs/bxT0sn8KT2x2uLrb8FWQig30+ siWBCoSs5QKUj+xICVWLoL94RcgZEmoJQfYIwxtWBI9KM4WbjZyuuyLeqEFQ0Krfakx/DOWY oIJgdOwHwbELtRP+FdVvTGBUAw5Zo80bBWcqGJoGs3COcWoXFA2/F3Esphioere55gEWcx7G sS0VAp9b5jHuIqCMIqiY7UJ86BhkfagheHaGWZNOxPN2WHvzRMAXshGMLA0J+YMGQceLfJxP HQDt8Ox6ilx/nxe81Pvx8hF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q1ND cwtLQ3Njc2MzCyVx3vMGlVFCAumJJanZqakFqUUwfUwcnFINjOq/uBS42n02xLzctElV+ZGv 6+blQedP9PKeeGwXzPf72f3Iptpzi57tXZLKlXjd/7Wjp/pXWbm4jKCl0qv5ZihP6p66cgeD t13auoVl1Z5fFRVuhV6/d0/syuT38hsnXd31h6l9gU4hd3QaT+qp4Bm/tyi8mcS4qljg3S11 hweRcnscxY9MO6PEUpyRaKjFXFScCADNLBd2qgIAAA== X-CMS-MailID: 20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181130120228eucas1p17dd7e4da8adb8bb8c88f1e372fb0ebd9 References: <1543579332-16609-1-git-send-email-c.manszewski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In analogy to drm_default_rgb_quant_range, create drm_default_colorimetry helper function to determine the default colorimetry value based on drm_display_mode. Currently there isn't any standarized way to determine the default color space format. Signed-off-by: Christoph Manszewski --- drivers/gpu/drm/drm_edid.c | 12 ++++++++++++ include/drm/drm_edid.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index b506e3622b08..03ac833dcc3c 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -4278,6 +4278,18 @@ drm_default_rgb_quant_range(const struct drm_display_mode *mode) } EXPORT_SYMBOL(drm_default_rgb_quant_range); +enum hdmi_colorimetry +drm_default_colorimetry(const struct drm_display_mode *mode) +{ + if (mode->vdisplay < 720) + return HDMI_COLORIMETRY_ITU_601; + else if (mode->vdisplay <= 1080) + return HDMI_COLORIMETRY_ITU_709; + else + return HDMI_COLORIMETRY_EXTENDED; +} +EXPORT_SYMBOL(drm_default_colorimetry); + static void drm_parse_ycbcr420_deep_color_info(struct drm_connector *connector, const u8 *db) { diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index e3c404833115..da43a5d02f7f 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -474,6 +474,8 @@ bool drm_detect_monitor_audio(struct edid *edid); bool drm_rgb_quant_range_selectable(struct edid *edid); enum hdmi_quantization_range drm_default_rgb_quant_range(const struct drm_display_mode *mode); +enum hdmi_colorimetry +drm_default_colorimetry(const struct drm_display_mode *mode); int drm_add_modes_noedid(struct drm_connector *connector, int hdisplay, int vdisplay); void drm_set_preferred_mode(struct drm_connector *connector, -- 2.7.4