From patchwork Mon Sep 19 16:56:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Ranquet X-Patchwork-Id: 12980909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92498ECAAD3 for ; Mon, 19 Sep 2022 18:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E4gppUOcxC2FoCu/qPZYTwoQdYoYysr0Z+Y/9IieB34=; b=de6SeBocXAQv2X eYi5xBwik6Cck0ZRzeNt+KjPVe4y1nwnAvUD9QxCMWp4Ybp06mUNthsrApppe2MBZ9AKrVUBbQR3e 1rRtMM/eSRIGIJHIj5O6ZfHq93jA/uxTEg1YKKcItQzCH4lECg7qZ8PKvq/3Psf2L6Lrb+g+1RBbQ DGgW1Trh9hn6at62chvoFrWlqB/XPoR9xs3hK6LuJ2afqSy8xWf48Xuw4h0QjzJNNspmdpfcslABl vce0bmjGqD4Qg/1pOr8WTvPmiRbG3YGWWaUNU2oizP8Wgx3T5aPrI6YjPr+cIWPAVvIcua0iv9Wq4 Dra37p2cbe56BT4QfPRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaL81-00DX1E-Q7; Mon, 19 Sep 2022 18:04:22 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaL7H-00DW7g-UI for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Sep 2022 18:03:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=7ewVwlqmSZNgETsEvZqoFNhQps11G0ZAn5b60e+kwmE=; b=l6wXCDfczd5NGyRE8Hed6VlpUL OfT65VPBCnCF6ur+J2MNdsUkN4qF86X/zyvLJJvLoZG5OctVcFRbWz7Fv3MrHjT/jWf95hB24ZmG1 K9UlnDEIuvjZwdXcdyYlsujPC4uePEtcMIj4fiKzoZcqY+TDdi30RrSG1mqIPT/Vu+eFd9bzCjsae 90/iVdwnzwkeg9G8iN8Xvo1rn7765MH1bThXFHQB8nNxV/o3vHIcl1r9Kdo1aEZzXYnpQ8tWRPj1X /haQQ4ljHwsbA5m7A65lY9EEKkNvmbVkGgXXb97zrjWcu1Yj6jjwWqIaGQCtGI1sDxdoE9thNFXOZ qhZaRK4w==; Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaK7p-00E8H1-LS for linux-arm-kernel@lists.infradead.org; Mon, 19 Sep 2022 17:00:07 +0000 Received: by mail-ej1-x630.google.com with SMTP id lc7so260602ejb.0 for ; Mon, 19 Sep 2022 10:00:05 -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; bh=7ewVwlqmSZNgETsEvZqoFNhQps11G0ZAn5b60e+kwmE=; b=ltJHkE9qpYoLEDSN5DAx3cZgruYpelRbpwQcuaGdFUMLM3WJOSSnmHPjq0mpUqr1/z gQmz4aIu1+C2XCgAurWgLJcYErvdR4pZCHRjigSIHMdLj1hHPhb1eZ0uKCN3yalxK9qu GQSLKUQSOH+ZG7+yYGBOCRSOxQjRklDOiAYlzLZkIXtvsZWEgeOzyAm7yN5N0KoblI5a Chf8ShDsXCqZKzCoTAj9MlcgaigL68bvRigo9a2jipo46Rdg4R3ClF/1eroZSV1j3O6z CgcSBUC0Z9qbQQR/6dtC3LdupnvTBwtPW3JXZNgAEGC0PifQtmrhh69LHGp9uY59knMO qdZQ== 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; bh=7ewVwlqmSZNgETsEvZqoFNhQps11G0ZAn5b60e+kwmE=; b=m9MMQOjFfsMwY/t2tJZwBDRHfalRVvhDmGuPBfuyGZezalK02XCUhv1CgXvqlEGAq9 T5aGreQuHq1iUKBjtRQWs8L19u1+aTZctFTAj6jZiZ4gWt6wCM+SqMBNKAsllXFPJdvD zClxv/7qTxLTxf2YQBt6zJRrGX2fGD0Mym/rhLgbxo7pS43B+2sbe9UEhmUvOl4rUxZC 5+rH+Ps/P9V0MuvaAiYdvntC3pP1QL5nyg0xzqJQ5RphtVvWl129M/0aJLHiAL5Upfax eP26lCS3emf8/k9igtpJofUWuK91ejd+8rRFjJp81CNHgLF3vXOG6mc+p6wQijG+icfm g7Qw== X-Gm-Message-State: ACrzQf2eG3VoO3TSXFu0dVpuGOAvSOqmYuyPSLhbPoxq8qEdAn5iV5Tu 5lv8A0QGi70q0eKfPTJqpv5POg== X-Google-Smtp-Source: AMsMyM67IRRVMY+Suw0izTU3sRzUSrYIHC8PsOPjPY/v4kIJUR1V+xpsamXrdF60dn5nXvO6vgqnpA== X-Received: by 2002:a17:907:72d5:b0:77d:5d01:4f4f with SMTP id du21-20020a17090772d500b0077d5d014f4fmr13945767ejc.285.1663606804603; Mon, 19 Sep 2022 10:00:04 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6340-f287-3074-96af-9642-0003.rev.sfr.net. [2a02:8440:6340:f287:3074:96af:9642:3]) by smtp.gmail.com with ESMTPSA id cf16-20020a0564020b9000b0044fc3c0930csm20424246edb.16.2022.09.19.10.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 10:00:04 -0700 (PDT) From: Guillaume Ranquet Date: Mon, 19 Sep 2022 18:56:08 +0200 Subject: [PATCH v1 10/17] drm/mediatek: hdmi: add frame_colorimetry flag MIME-Version: 1.0 Message-Id: <20220919-v1-10-4844816c9808@baylibre.com> References: <20220919-v1-0-4844816c9808@baylibre.com> In-Reply-To: <20220919-v1-0-4844816c9808@baylibre.com> To: Vinod Koul , Stephen Boyd , David Airlie , Rob Herring , Philipp Zabel , Krzysztof Kozlowski , Daniel Vetter , Chunfeng Yun , CK Hu , Jitao shi , Chun-Kuang Hu , Michael Turquette , Kishon Vijay Abraham I , Matthias Brugger Cc: linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, Pablo Sun , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Mattijs Korpershoek , linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, Guillaume Ranquet , devicetree@vger.kernel.org X-Mailer: b4 0.10.0-dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_180006_017150_3F774F28 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a flag to indicate support for frame colorimetry. Signed-off-by: Guillaume Ranquet diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c index 30407603d693..9fe086e2cd7c 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 62a14435be69..75a9b62dccee 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.h +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.h @@ -33,6 +33,7 @@ struct mtk_hdmi_conf { bool cea_modes_only; bool has_cec; bool has_connector; + 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);