From: Yakir Yang Date: Wed, 13 Apr 2016 04:02:48 +0000 (+0800) Subject: drm/bridge: analogix_dp: introduce connector mode_valid callback to plat driver X-Git-Tag: firefly_0821_release~2815 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=280a4db6103334d85329fc91fa89e90eef511ddf;p=firefly-linux-kernel-4.4.55.git 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 informations. Change-Id: Icfd7593bd10c93fc9045acf04a8d0ed6336ffb85 Signed-off-by: Yakir Yang --- diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index 7699597070a1..e04b65d905d3 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 25afb31f0389..da4800aa31ec 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -29,6 +29,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);