From patchwork Mon Apr 12 09:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 12197409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2538C433ED for ; Mon, 12 Apr 2021 09:39:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7AC3961248 for ; Mon, 12 Apr 2021 09:39:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AC3961248 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 772DE6E3FE; Mon, 12 Apr 2021 09:39:40 +0000 (UTC) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8620E6E3EE for ; Mon, 12 Apr 2021 09:39:38 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id h4so3157849wrt.12 for ; Mon, 12 Apr 2021 02:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b64pfOb+ESukFQpojWv0aNxV3D5E9ms1GDFWEsqil0U=; b=cUCTfH9cQ20lN0ASEY1CcKyAskerlXs7EVSJaa6aV9/KVocXxKC9+GyDoWrNIo/+Z6 xinJzqXyxeW3D3CAEl7kmAQIl0+SFCe0ibs9Urg8AyOHMFU+E8L1wfOvAu319Atd7xv2 H9wet+wscvVhrd40D2HQX2U9l3P9Y1QnEieLZdZdvGOdjEJd6vAC3u3OcC2NH1yqaFpu wPoBNr6F3CGOwT4rkkJQ3k3I7iKBP38HOBmpHCHl+NZpewk2S8wEyrQg4B/6I86x/qmv VRRXKBFZsQaPCgjwZfMM6FezSVukE4fYRjWwFFUWkBDxNqUk/JG6wNERV2ufIjHxFpfj wFtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b64pfOb+ESukFQpojWv0aNxV3D5E9ms1GDFWEsqil0U=; b=I8wLq2JrOxEqOfn58ZkDiKboSqmuO4oMl6K5OC+EV5Oh2YRiHXqUEP8p1aB//mUrEV WAQjKkWdJZKAmwjgP+CmhUllB+60R3EzmljfULEUPYjhf8Z0wQZxn3DE9jVL/KKiypvL wKKI0mssCyuQ35QAwfuDxqHtXwwmpW8TCUgWtYfHSOu0vfUr9cF09n3hZMf+SuPs7fRF OpYtsRdUia2WRTMhk7e1oe70bON58KgV3WAaEc+JzqrfVkVfW6kvbEhPPk3LXhwjDsjF 4YT2zSXio+Kg31YBnAIVFIm6Nm4bvVcQappvDU6Qf83SuYA+5MvRfZIsDIcuAAAGk9IQ I+GQ== X-Gm-Message-State: AOAM530RXkKh7FUUTjkh0TwfshhQVo6nytgjLChTGlWAs8XbEp4kyVWm 5bUC5g6qh34XmUdpkOVDQ/kN7w== X-Google-Smtp-Source: ABdhPJz96Ixh0rydLkGNtoMbTLcMl1V8ZHJ6OxRZb3g3eu/v9lSIxMYmfdeZLJ4ofiQecixqlveQKA== X-Received: by 2002:a5d:6c62:: with SMTP id r2mr32037266wrz.62.1618220377138; Mon, 12 Apr 2021 02:39:37 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:90c:e290:4c21:b00e:ff79:bf20]) by smtp.gmail.com with ESMTPSA id r22sm14405902wmh.11.2021.04.12.02.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 02:39:36 -0700 (PDT) From: Neil Armstrong To: chunkuang.hu@kernel.org, p.zabel@pengutronix.de, matthias.bgg@gmail.com Subject: [PATCH v2 3/5] gpu/drm: mediatek: hdmi: add check for CEA modes only Date: Mon, 12 Apr 2021 11:39:26 +0200 Message-Id: <20210412093928.3321194-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210412093928.3321194-1-narmstrong@baylibre.com> References: <20210412093928.3321194-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Fabien Parent , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Some SoCs like the MT8167 are not validated and supported for HDMI modes out of HDMI CEA modes, so add a configuration boolean to filter out non-CEA modes. Signed-off-by: Fabien Parent Signed-off-by: Neil Armstrong --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index dea46d66e712..0539262e69d3 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -148,6 +148,7 @@ struct hdmi_audio_param { struct mtk_hdmi_conf { bool tz_disabled; + bool cea_modes_only; }; struct mtk_hdmi { @@ -1222,6 +1223,9 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge, return MODE_BAD; } + if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) + return MODE_BAD; + if (mode->clock < 27000) return MODE_CLOCK_LOW; if (mode->clock > 297000)