From patchwork Thu Jul 4 13:52:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1127549 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="KtWFbORV"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45ffb34F7Qz9sPD for ; Thu, 4 Jul 2019 23:53:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CC0DCC21DD4; Thu, 4 Jul 2019 13:52:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DF259C21BE5; Thu, 4 Jul 2019 13:52:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 49B1AC21C3F; Thu, 4 Jul 2019 13:52:19 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id C6C73C21C6A for ; Thu, 4 Jul 2019 13:52:15 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id x4so6717323wrt.6 for ; Thu, 04 Jul 2019 06:52:15 -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=bbfQ+Jmc8Su62WVi81909SfTWTAk8T56gH/qadrUWbk=; b=KtWFbORVctxdgFA0sqvB5nB3eFdFhP2j3Bo8+c2GOR11xL3wm4flnMdGAScDbvoLvf e+eBzDJkt+xdsNPEs76Ld+s1Q7UTalW6j+5QEqGeGOACsVZ9kKTeCx3uOwzVA7benUbG 85cttu+/eHLa/B/pRPIIx0ovBuY8+6lntl+EnN4gUmt93cMSFIkgywdxi2ASWnngF3yz V7ZZUURSmYaCfg6B01x3Dw/yGThCdne+oe7lUa5BFkolc1Oe31Hbjrdt2xcboU1T3+tr cqdCylhZUtE05XSa6/kp/J0aRI5JKFlMgrUAf7U0HdUBZTbYISOrLA+EP3t12jk4nRnL 8zFw== 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=bbfQ+Jmc8Su62WVi81909SfTWTAk8T56gH/qadrUWbk=; b=P8D/oQXph+8pnQGn04aDKBmbBRQ57L+8yqBOZLIlGPsxY/XFRhtML428Bh3laE0L8g J9tAtOm1EE+8JHdFG+6xaT2WjYwJKdSmSeKFVZY7LUAoJ2juDQ/eTOjeoiZhyIO9VuOk lpHSbaTJc3nNzxuI0IAdTFz0EE/R2jDajfJl8pX2bQZ58VDrt516A0B34tNnKa4Yi+LO UI6HIj9taAgXnaiIZlUhvdBnaRL2yjiXhIeFspGbYZTvkT1ODMdSzL7/xoIGAIlSwhb+ NIiL6CgOQ7kkEZyloQPrRwpyDKsrmhDYKYeKHukHwYI58ene7pVFT7QZB3Ml51tp8kTg 91UA== X-Gm-Message-State: APjAAAVMdwPMemiR2Xh0DnfA3hNym7e6KAqkWPhiD2ifycRNZByufL9g BGNOFI3uu8HV6YyHtMQc9VSGLQ== X-Google-Smtp-Source: APXvYqznuzkcBXdARAF2H6FEs+oMU1w04lxWjEyZtnY0eV4aswTfXxO8JXTRlYGg55csQCQl1TaeVQ== X-Received: by 2002:a5d:468a:: with SMTP id u10mr34528329wrq.177.1562248335250; Thu, 04 Jul 2019 06:52:15 -0700 (PDT) Received: from localhost.localdomain (176-150-251-154.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id x11sm4793199wmi.26.2019.07.04.06.52.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 06:52:13 -0700 (PDT) From: Neil Armstrong To: agust@denx.de Date: Thu, 4 Jul 2019 15:52:06 +0200 Message-Id: <20190704135208.32104-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190704135208.32104-1-narmstrong@baylibre.com> References: <20190704135208.32104-1-narmstrong@baylibre.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [U-Boot] [PATCH 1/3] edid: add edid_get_timing_validate() variant to filter out edid modes X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The original edid_get_timing() function returns the first valid timing, but on some plaforms, we could only supports a subset of the listed monitot's navite timing. Let's introduce a edid_get_timing_validate() adding a mode_valid callback including a private cookie pointer. If the callback returns false, the current timing is discared and the next one is checked. If no valid & supported timings are found, the function would return an error. Signed-off-by: Neil Armstrong --- common/edid.c | 22 +++++++++++++++++++--- include/edid.h | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/common/edid.c b/common/edid.c index 90d1167f6e..f244d26e04 100644 --- a/common/edid.c +++ b/common/edid.c @@ -168,8 +168,12 @@ static bool cea_is_hdmi_vsdb_present(struct edid_cea861_info *info) return false; } -int edid_get_timing(u8 *buf, int buf_size, struct display_timing *timing, - int *panel_bits_per_colourp) +int edid_get_timing_validate(u8 *buf, int buf_size, + struct display_timing *timing, + int *panel_bits_per_colourp, + bool (*mode_valid)(void *priv, + const struct display_timing *timing), + void *mode_valid_priv) { struct edid1_info *edid = (struct edid1_info *)buf; bool timing_done; @@ -193,7 +197,11 @@ int edid_get_timing(u8 *buf, int buf_size, struct display_timing *timing, desc = &edid->monitor_details.descriptor[i]; if (desc->zero_flag_1 != 0) { decode_timing((u8 *)desc, timing); - timing_done = true; + if (mode_valid) + timing_done = mode_valid(mode_valid_priv, + timing); + else + timing_done = true; break; } } @@ -225,6 +233,14 @@ int edid_get_timing(u8 *buf, int buf_size, struct display_timing *timing, return 0; } +int edid_get_timing(u8 *buf, int buf_size, struct display_timing *timing, + int *panel_bits_per_colourp) +{ + return edid_get_timing_validate(buf, buf_size, timing, + panel_bits_per_colourp, NULL, NULL); +} + + /** * Snip the tailing whitespace/return of a string. * diff --git a/include/edid.h b/include/edid.h index f05d2b82f2..2562733061 100644 --- a/include/edid.h +++ b/include/edid.h @@ -306,6 +306,28 @@ int edid_get_ranges(struct edid1_info *edid, unsigned int *hmin, struct display_timing; +/** + * edid_get_timing_validate() - Get basic digital display parameters with + * mode selection callback + * + * @param buf Buffer containing EDID data + * @param buf_size Size of buffer in bytes + * @param timing Place to put preferring timing information + * @param panel_bits_per_colourp Place to put the number of bits per + * colour supported by the panel. This will be set to + * -1 if not available + * @param mode_valid Callback validating mode, returning true is mode is + * supported, false otherwise. + * @parem valid_priv Pointer to private data for mode_valid callback + * @return 0 if timings are OK, -ve on error + */ +int edid_get_timing_validate(u8 *buf, int buf_size, + struct display_timing *timing, + int *panel_bits_per_colourp, + bool (*mode_valid)(void *priv, + const struct display_timing *timing), + void *mode_valid_priv); + /** * edid_get_timing() - Get basic digital display parameters * From patchwork Thu Jul 4 13:52:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1127546 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="S/C+Qlab"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45ffYt22vfz9sBp for ; Thu, 4 Jul 2019 23:52:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E17D0C21C6A; Thu, 4 Jul 2019 13:52:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5E389C21DDC; Thu, 4 Jul 2019 13:52:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6CC99C21DD3; Thu, 4 Jul 2019 13:52:19 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by lists.denx.de (Postfix) with ESMTPS id 88FD7C21DA1 for ; Thu, 4 Jul 2019 13:52:16 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id n9so6764459wru.0 for ; Thu, 04 Jul 2019 06:52:16 -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=VwiGuXU951s4yt+UxjjQdhtHcFPb7/GYOeJp+XiRbmI=; b=S/C+Qlab+NCiVDgr4iJ5rVf3eGln4oEdQzvkUgECT83O0pr3KE9WYlmgRsLQqt+qAE sZNAOLjUu9yMXqJ7u5tjecQuvGMg9ROHO+nXYxI4iZJYarTw9h68mlAx9aQH4QgM14iz cJarC84tqlTlVb/rWPjmF7fUoO357JWKo8Tmj66JtIxmWB7G68JjJEhT5VezvfxLZ0pS jqEnDuKemVXj9fGzTPbK/5Cbv0OMwm0CMod2oh2mMge/DUCVpp5jyGoUwCouxDBOwN4H bnTjnx3Bq98SdYVzAzOdKXu6xhaCLsq8zG0+k+DqXkWQUaF7NCCmPNq3UjtIFr5W+jvB 6GWQ== 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=VwiGuXU951s4yt+UxjjQdhtHcFPb7/GYOeJp+XiRbmI=; b=DDXJvYXi3bxnk6zOCh5WMOhMzr9M1L2kxaowfN8CoCpv6UWpSYFjlgzfJCpnrfVS5t slb350j7ZVcHkKpNV4qfgBvDT8Ojsumdb2Woh0d6AwDzu5Mfqa2XRnWkoGzoWLn8RIu5 3aJmW/QhOtEqknDOZv8PA6qEPphJUB4TjNCOT3Uc54ls2LDThqPyfi/WMDDC3XPMNjWz egbQucSyt5S3eAReZm+HfLq7NJlilx17kNnRzcidL3E4kuamcaN9YRwD6AqylO9HPh6Z FoKyPLemzmbN72tcy3cNvo9DQD6UTbG3E/hrrKiT6rlWbmOaJJm3HDDPBNXL2MRpZ54u 2CrQ== X-Gm-Message-State: APjAAAXuKq8Ns3P6+bG536ybG8hS0KIZji/dSxCWob+PRkFF6tUDAUTH G5MbZM0ADps3BAeaYqf4r309bg== X-Google-Smtp-Source: APXvYqyvq45B5DCMTeqxvARsdJetIykUf09oJZi0WnBT/cXpyvSLqgqiN0GLcGnQCcJW6OnYHo6mHQ== X-Received: by 2002:adf:fe09:: with SMTP id n9mr2688066wrr.41.1562248335954; Thu, 04 Jul 2019 06:52:15 -0700 (PDT) Received: from localhost.localdomain (176-150-251-154.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id x11sm4793199wmi.26.2019.07.04.06.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 06:52:15 -0700 (PDT) From: Neil Armstrong To: agust@denx.de Date: Thu, 4 Jul 2019 15:52:07 +0200 Message-Id: <20190704135208.32104-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190704135208.32104-1-narmstrong@baylibre.com> References: <20190704135208.32104-1-narmstrong@baylibre.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [U-Boot] [PATCH 2/3] video: display: use edid_get_timing_validate() variant to filter supported EDID modes X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Introduce a new display op, mode_valid() to be used with the newly introduced edid_get_timing_validate() function, to filter supported monitor timings if handled by the display driver. Signed-off-by: Neil Armstrong --- drivers/video/display-uclass.c | 15 ++++++++++++++- include/display.h | 10 ++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/video/display-uclass.c b/drivers/video/display-uclass.c index 99ef5e76f5..1a29ce5d85 100644 --- a/drivers/video/display-uclass.c +++ b/drivers/video/display-uclass.c @@ -37,6 +37,17 @@ int display_enable(struct udevice *dev, int panel_bpp, return 0; } +static bool display_mode_valid(void *priv, const struct display_timing *timing) +{ + struct udevice *dev = priv; + struct dm_display_ops *ops = display_get_ops(dev); + + if (ops && ops->mode_valid) + return ops->mode_valid(dev, timing); + + return true; +} + int display_read_timing(struct udevice *dev, struct display_timing *timing) { struct dm_display_ops *ops = display_get_ops(dev); @@ -53,7 +64,9 @@ int display_read_timing(struct udevice *dev, struct display_timing *timing) if (ret < 0) return ret; - return edid_get_timing(buf, ret, timing, &panel_bits_per_colour); + return edid_get_timing_validate(buf, ret, timing, + &panel_bits_per_colour, + display_mode_valid, dev); } bool display_in_use(struct udevice *dev) diff --git a/include/display.h b/include/display.h index 16f317c9c8..66294616ea 100644 --- a/include/display.h +++ b/include/display.h @@ -80,6 +80,16 @@ struct dm_display_ops { */ int (*enable)(struct udevice *dev, int panel_bpp, const struct display_timing *timing); + + /** + * mode_valid() - Check if mode is supported + * + * @dev: Device to enable + * @timing: Display timings + * @return true if supported, false if not + */ + bool (*mode_valid)(struct udevice *dev, + const struct display_timing *timing); }; #define display_get_ops(dev) ((struct dm_display_ops *)(dev)->driver->ops) From patchwork Thu Jul 4 13:52:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 1127548 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="R5v4uKGN"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45ffZQ42YLz9sBp for ; Thu, 4 Jul 2019 23:53:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F0858C21D65; Thu, 4 Jul 2019 13:52:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EAA39C21DB3; Thu, 4 Jul 2019 13:52:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4BEBEC21DB5; Thu, 4 Jul 2019 13:52:21 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by lists.denx.de (Postfix) with ESMTPS id E4369C21DE8 for ; Thu, 4 Jul 2019 13:52:17 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id v14so6741131wrr.4 for ; Thu, 04 Jul 2019 06:52:17 -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=QyRCC4bUtDTkFoUgDa5zYvhIk1y06EaYmyazSTdlSTw=; b=R5v4uKGNiPPa809Sst8jAoTzFPM7sLWUnZlI/8inilO31i4r62SjH3afwB8vB5PY3p PA6n4RNkA3FGyVAT76cX3x5rL2xD0i4zqwC1k6bAVt3KLMhsnarEABHrAU70yuQjuhpa K3Oidgaaltf/QYW8EByo2/hSb2eDZrdcGHDiFPHBloJg+o6Za7ZsjHebAkcu9tvTAwtz EKy8oZ5WLmKRk6FNy2/GcSt6tSs25kMW0YJYM6gAgfDQU3mq3RNtEqNuFMNlcNthaPvM pgsLbGdQh1It/nygq7HcfD+qdW3peHiDQHbE9CKV3CCyXHHYPdmNNa4vINT51wi0uCr+ arVg== 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=QyRCC4bUtDTkFoUgDa5zYvhIk1y06EaYmyazSTdlSTw=; b=MJscL4rI+U3XdcVukkBoWikhTm6JKR4k84uC6RtThKICY8hyHFLouC0WGW3FSnn4F/ +RzDxX45gZiLHmwoZHguBTBg0Z+Cee1ZuHpzb7gEYtj7wqqQPpOkPh57A8TPvXJ83DDC DN6o89mztG+nZXR/ZgLyY3YHBbIw2k+54PzG5xv4vnUW6XCwEDT2TYhXCcyG4TPEDw34 P6MT0PBtEuzCwjECpbcQ07SOFew+JZi/KfD1/Liy+XFDFk2AQQf7MNckv0qIXEbw6kJ8 SitXYCNtyP/PW4GL8sI0VIC0Vr3xYvocmntRMAcQt+F6u4F21M7SubcvX4TolxWU5okM acSQ== X-Gm-Message-State: APjAAAU3hmw2MiLwd01uxOmS1S+V2cixBo6ZyJLXG9qxFni0fYhNRIUX bALjhTrVuAhtyosPgFX3JaIXkg== X-Google-Smtp-Source: APXvYqyE1bIv6+gJnZz7ELIoyDRwplx1fqPXdXq/Ho1e9RgKI0kba4ETEUHQ3Wkg0GSbcWH2dO12nQ== X-Received: by 2002:a5d:60c5:: with SMTP id x5mr20737318wrt.253.1562248337385; Thu, 04 Jul 2019 06:52:17 -0700 (PDT) Received: from localhost.localdomain (176-150-251-154.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id x11sm4793199wmi.26.2019.07.04.06.52.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jul 2019 06:52:16 -0700 (PDT) From: Neil Armstrong To: agust@denx.de Date: Thu, 4 Jul 2019 15:52:08 +0200 Message-Id: <20190704135208.32104-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190704135208.32104-1-narmstrong@baylibre.com> References: <20190704135208.32104-1-narmstrong@baylibre.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io Subject: [U-Boot] [PATCH 3/3] video: meson: dw-hdmi: add EDID mode filtering to only select supported modes X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for the new mode_valid() display op to filter out unsupported display DMT timings. This is useful when connected to 4k displays, since we only support DMT monitors up to 1920x1080, the 4k native timings are discarded to select supported timings. Signed-off-by: Neil Armstrong --- drivers/video/meson/meson_dw_hdmi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/video/meson/meson_dw_hdmi.c b/drivers/video/meson/meson_dw_hdmi.c index 483c93f6b6..617f75724b 100644 --- a/drivers/video/meson/meson_dw_hdmi.c +++ b/drivers/video/meson/meson_dw_hdmi.c @@ -426,9 +426,16 @@ static int meson_dw_hdmi_probe(struct udevice *dev) return ret; } +static bool meson_dw_hdmi_mode_valid(struct udevice *dev, + const struct display_timing *timing) +{ + return meson_venc_hdmi_supported_mode(timing); +} + static const struct dm_display_ops meson_dw_hdmi_ops = { .read_edid = meson_dw_hdmi_read_edid, .enable = meson_dw_hdmi_enable, + .mode_valid = meson_dw_hdmi_mode_valid, }; static const struct udevice_id meson_dw_hdmi_ids[] = {