[RFC PATCH 17/18] drm/i915: Addition of downclock mode to connector modelist

Ramalingam C
2015-06-26T14:00:46Z

If DSI panel has the downclock mode supported, add that in the
connector's mode list.

This is needed by userspace apps to identify the range of vrefresh
rates supported by panel incase of the media playback DRRS.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
drivers/gpu/drm/i915/intel_dsi.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 98998e9..503f3de 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -912,23 +912,38 @@ static int intel_dsi_get_modes(struct drm_connector *connector)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
struct drm_display_mode *mode;
+ int count = 0;

DRM_DEBUG_KMS("\n");

if (!intel_connector->panel.fixed_mode) {
DRM_DEBUG_KMS("no fixed mode\n");
- return 0;
+ return count;
}

mode = drm_mode_duplicate(connector->dev,
intel_connector->panel.fixed_mode);
if (!mode) {
DRM_DEBUG_KMS("drm_mode_duplicate failed\n");
- return 0;
+ return count;
}

drm_mode_probed_add(connector, mode);
- return 1;
+ count++;
+
+ if (intel_connector->panel.downclock_mode) {
+ mode = drm_mode_duplicate(connector->dev,
+ intel_connector->panel.downclock_mode);
+ if (!mode) {
+ DRM_DEBUG_KMS("drm_mode_duplicate failed\n");
+ return count;
+ }
+
+ drm_mode_probed_add(connector, mode);
+ count++;
+ }
+
+ return count;
}

static void intel_dsi_connector_destroy(struct drm_connector *connector)