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: 9132749 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 1B81E6075E for ; Tue, 24 May 2016 05:03:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13B00281E3 for ; Tue, 24 May 2016 05:03:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0896628282; Tue, 24 May 2016 05:03:02 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1975281E3 for ; Tue, 24 May 2016 05:03:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C04CA6E62B; Tue, 24 May 2016 05:02:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.134]) by gabe.freedesktop.org (Postfix) with ESMTPS id AE1746E5D3 for ; Tue, 24 May 2016 05:02:46 +0000 (UTC) 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> Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, 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 , Dan Carpenter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);