Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp770615rwi; Fri, 14 Oct 2022 08:22:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rzcJZSyIoZ0T/QoMbJ9JWaOei85VdEnCyqOcv4IDkWrCAIQnF1zUSjbrOlpr1WUbNTCfM X-Received: by 2002:a05:6402:50cd:b0:45d:109d:676c with SMTP id h13-20020a05640250cd00b0045d109d676cmr4316093edb.344.1665760955829; Fri, 14 Oct 2022 08:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665760955; cv=none; d=google.com; s=arc-20160816; b=Cvkdf0KEEsuULxUzi3C34GiGyx3q270flRg2/qWJMYMjha2bDqiWMKeG8a4XWckFai Edjs2EcR/Kfu0EmRDQvzB1oLom5lxjnJgVhhrcdXGQwpXFzElMtgmnHtfXHKcmXaz3MV FPUA4ldEp9G0icOtP7nuekNhmC1C5krh2q2Ovh2BC5WvhalQYyD+JO25E3d/dqXIdt71 hCsX3/P4YLfhV7+EI0Y+uk8McjZteeCFA1I8fw4nbpJQrJWJ4eOb/zKUwpbAC08POylD NXC6whcoLm85Yo3l3EQsq47lswhJbo2X//O5QuEFHI/LgtNY1a2UfQp//GlvFFLyE+lV QPBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=6zHUtmTd6RGvQvohicUDo1+C3cWxOXttYxoZ7C1AyNM=; b=N4f8oiAENiyddDcIoTqHe3UkFxU6E4UcBHJdLMxOZ+rG9+0nzh1KcK+6kx4f4MGAkf G0Gsqig6jSb5BaqHL4nTY6cPmlNWFUZ14ABCSG5cufgdeTmN5bHkUKz/H0FSbflAAzEv xX5fHmfsxnP4DSG+W9TJtTLPedTRNbYESVO9h+3TYeLuFQGeBS8hjhxdkR/JdyGm27+v kH/oTu0rFbAB1RAxKButw8jorDJpe0dNApLGGsubB3rJe4+PS1XaOk/PbsAhWsMqf99h YcLAqLMC2C5Q2nRSpBMRfd00ZE3z6vgGjGuUycYiGnyCtHsR1bNqeD4hp8KQiP5A9cHj /syQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=b1ekvbAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w12-20020a1709060a0c00b0078ddff4b3absi2010547ejf.423.2022.10.14.08.22.09; Fri, 14 Oct 2022 08:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=b1ekvbAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbiJNPUq (ORCPT + 99 others); Fri, 14 Oct 2022 11:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiJNPUQ (ORCPT ); Fri, 14 Oct 2022 11:20:16 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BB5E8E73C for ; Fri, 14 Oct 2022 08:20:14 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id a10so8036092wrm.12 for ; Fri, 14 Oct 2022 08:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6zHUtmTd6RGvQvohicUDo1+C3cWxOXttYxoZ7C1AyNM=; b=b1ekvbAxiRGUZad41w9dy58ZZBL0J8ridOkkwRdF18gInQzcQ3UDujQEakqXlF7ORS kcqz5/5ajESm3pS8aRZXGPJ7r/VMwfiZQ8dSyW7iL727J6Ge8Zb5zOsJu6F6XqJvRSXA 9thV1Ae5r5MEcTc3kOLj1e26+YRURClTkzAuy03EpHVg806UPWDQUsLEB5gOKx6bA4C+ HehDnD/Hv+7jWQtMyLxtgysj+FMG0fLbKP2hJJmojpgAJa7cpcV6LQyj1thMDMunUHAx RvY2edcIevRGvsBtTEy5CiaKVd470hlKHXlyIbzKn2BcHMEqLkV9SFEmcn3EGr4EQ/pI ARWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6zHUtmTd6RGvQvohicUDo1+C3cWxOXttYxoZ7C1AyNM=; b=G7R2CKPXkJMNUN4pgJONpE6kWtZhiDH008EUoCSsZxXISKj5dzrgwAfS0uwQUtyvLC MH3ZvnJW3zZop3ThQ7KDfG6EcTti/q3rQh+wJobwH1+CwASS5wXPITDZWC2YjTbQuMQO JBYxSIvssM7Mb/NVd1cIRrdLlUxoy0xIAerJoQ8SiC5iJk2sFUEicxUapTqOTD7VCQOv k00gkRczEYmjojwhePUX5gIaAdtNzdahL4n1m5nJavnd54dprvHZkV3Kcrf/IAufxHWs l2MYLe+cPI3wo9GjNlcCFaGabEWyIlYwGsA1r0/Q6mRl7AFgAfVy2ez7w7Hq91q0uaIu +11A== X-Gm-Message-State: ACrzQf0p13rcAh3u6+Ualy445o0WXISvRmaEMl1GxMIyOdH/6yHMsUN8 eKPHvzxSWDfLSZB+xEvk2SUNGA== X-Received: by 2002:adf:f14b:0:b0:22e:f162:f728 with SMTP id y11-20020adff14b000000b0022ef162f728mr3529705wro.681.1665760812812; Fri, 14 Oct 2022 08:20:12 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6241-7429-3074-96af-9642-0004.rev.sfr.net. [2a02:8440:6241:7429:3074:96af:9642:4]) by smtp.gmail.com with ESMTPSA id z11-20020a05600c0a0b00b003c6bd91caa5sm2818223wmp.17.2022.10.14.08.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 08:20:12 -0700 (PDT) From: Guillaume Ranquet Date: Fri, 14 Oct 2022 17:15:59 +0200 Subject: [PATCH v2 06/12] drm/mediatek: hdmi: add frame_colorimetry flag MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220919-v2-6-8419dcf4f09d@baylibre.com> References: <20220919-v2-0-8419dcf4f09d@baylibre.com> In-Reply-To: <20220919-v2-0-8419dcf4f09d@baylibre.com> To: Chunfeng Yun , David Airlie , Philipp Zabel , Jitao shi , CK Hu , Rob Herring , Krzysztof Kozlowski , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , Daniel Vetter , Chun-Kuang Hu Cc: Guillaume Ranquet , stuart.lee@mediatek.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, Krzysztof Kozlowski , mac.shen@mediatek.com, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org X-Mailer: b4 0.11.0-dev X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a flag to indicate support for frame colorimetry. Signed-off-by: Guillaume Ranquet --- drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 11 +++++++++++ drivers/gpu/drm/mediatek/mtk_hdmi_common.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c index 3635ca66817b..933c51b5f6d7 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c @@ -120,6 +120,17 @@ int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi, u8 *buffer, size_t bufsz return err; } + if (hdmi->conf->has_frame_colorimetry) { + frame.colorimetry = hdmi->colorimtery; + if (frame.colorimetry == HDMI_COLORIMETRY_EXTENDED) + frame.extended_colorimetry = hdmi->extended_colorimetry; + + /* quantiation range:limited or full */ + if (frame.colorspace == HDMI_COLORSPACE_RGB) + frame.quantization_range = hdmi->quantization_range; + else + frame.ycc_quantization_range = hdmi->ycc_quantization_range; + } err = hdmi_avi_infoframe_pack(&frame, buffer, bufsz); if (err < 0) { diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.h b/drivers/gpu/drm/mediatek/mtk_hdmi_common.h index 921bde150e11..2e8e5feec377 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.h +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.h @@ -32,6 +32,7 @@ struct mtk_hdmi_conf { bool tz_disabled; bool cea_modes_only; bool has_cec; + bool has_frame_colorimetry; unsigned long max_mode_clock; const struct drm_bridge_funcs *bridge_funcs; void (*mtk_hdmi_output_init)(struct mtk_hdmi *hdmi); -- b4 0.11.0-dev