[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1464066159-22820-1-git-send-email-ykk@rock-chips.com>
Date: Tue, 24 May 2016 13:02:39 +0800
From: Yakir Yang <ykk@...k-chips.com>
To: David Airlie <airlied@...ux.ie>, Inki Dae <inki.dae@...sung.com>,
Mark Yao <yzq@...k-chips.com>,
Thierry Reding <treding@...dia.com>,
Jingoo Han <jingoohan1@...il.com>,
Rob Herring <robh+dt@...nel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@...sung.com>,
Heiko Stuebner <heiko@...ech.de>,
Douglas Anderson <dianders@...omium.org>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Javier Martinez Canillas <javier@....samsung.com>,
emil.l.velikov@...il.com, Dan Carpenter <dan.carpenter@...cle.com>,
linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
linux-samsung-soc@...r.kernel.org,
linux-rockchip@...ts.infradead.org, Yakir Yang <ykk@...k-chips.com>
Subject: [PATCH v2 07/10] drm/bridge: analogix_dp: introduce connector mode_valid callback to plat driver
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 <ykk@...k-chips.com>
---
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);
--
1.9.1
Powered by blists - more mailing lists