From patchwork Tue May 24 05:02:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yakir Yang X-Patchwork-Id: 9132757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1094D607D8 for ; Tue, 24 May 2016 05:03:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07CD428233 for ; Tue, 24 May 2016 05:03:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F078228283; Tue, 24 May 2016 05:03:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A3B96281E3 for ; Tue, 24 May 2016 05:03:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b54Uo-0006ab-7a; Tue, 24 May 2016 05:03:10 +0000 Received: from lucky1.263xmail.com ([211.157.147.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b54Um-0006HB-2R for linux-rockchip@lists.infradead.org; Tue, 24 May 2016 05:03:08 +0000 Received: from ykk?rock-chips.com (unknown [192.168.167.231]) by lucky1.263xmail.com (Postfix) with SMTP id 8F058761; Tue, 24 May 2016 13:02:44 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 10C2658204; Tue, 24 May 2016 13:02:41 +0800 (CST) X-RL-SENDER: ykk@rock-chips.com X-FST-TO: airlied@linux.ie X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: ykk@rock-chips.com X-UNIQUE-TAG: <34a99aefd9fd64d0309485fc160dd09b> X-ATTACHMENT-NUM: 0 X-SENDER: ykk@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [103.29.142.67]) by smtp.263.net (Postfix) whith ESMTP id 253738UUPWM; Tue, 24 May 2016 13:02:44 +0800 (CST) From: Yakir Yang To: David Airlie , Inki Dae , Mark Yao , Thierry Reding , Jingoo Han , Rob Herring Subject: [PATCH v2 07/10] drm/bridge: analogix_dp: introduce connector mode_valid callback to plat driver Date: Tue, 24 May 2016 13:02:39 +0800 Message-Id: <1464066159-22820-1-git-send-email-ykk@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464066086-21967-1-git-send-email-ykk@rock-chips.com> References: <1464066086-21967-1-git-send-email-ykk@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160523_220308_489670_2EC3A07A X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, Daniel Vetter , emil.l.velikov@gmail.com, Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Javier Martinez Canillas , Yakir Yang , Dan Carpenter MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It's helpful to expand the mode_valid callback to platform driver, so they could valid the display mode or information. Signed-off-by: Yakir Yang --- Changes in v2: None drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 15 +++++++++++++++ include/drm/bridge/analogix_dp.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 4a1b3b8..5af9ce4 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -943,6 +943,20 @@ int analogix_dp_get_modes(struct drm_connector *connector) return num_modes; } +static enum drm_mode_status +analogix_dp_mode_valid(struct drm_connector *connector, + struct drm_display_mode *mode) +{ + struct analogix_dp_device *dp = to_dp(connector); + enum drm_mode_status status = MODE_OK; + + if (dp->plat_data->mode_valid) + status = dp->plat_data->mode_valid(dp->plat_data, connector, + mode); + + return status; +} + static struct drm_encoder * analogix_dp_best_encoder(struct drm_connector *connector) { @@ -954,6 +968,7 @@ analogix_dp_best_encoder(struct drm_connector *connector) static const struct drm_connector_helper_funcs analogix_dp_connector_helper_funcs = { .get_modes = analogix_dp_get_modes, .best_encoder = analogix_dp_best_encoder, + .mode_valid = analogix_dp_mode_valid, }; enum drm_connector_status diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index 82b8135..9ef89de 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -35,6 +35,10 @@ struct analogix_dp_plat_data { int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *, struct drm_connector *); int (*get_modes)(struct analogix_dp_plat_data *); + + enum drm_mode_status (*mode_valid)(struct analogix_dp_plat_data *, + struct drm_connector *, + struct drm_display_mode *); }; int analogix_dp_resume(struct device *dev);