All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch,
	chris@chris-wilson.co.uk, rodrigo.vivi@intel.com
Cc: paulo.r.zanoni@intel.com
Subject: [RFC PATCH 18/18] drm/i915: Connector property for DRRS capability
Date: Fri, 26 Jun 2015 19:22:02 +0530	[thread overview]
Message-ID: <1435326722-24633-19-git-send-email-ramalingam.c@intel.com> (raw)
In-Reply-To: <1435326722-24633-1-git-send-email-ramalingam.c@intel.com>

DRRS capability on each connector is exposed to userspace through
drm connector property.

In this change one drm property is created and attached with each
connector. And when DRRS is successfully initialized for a connector,
drrs connector property is set with appropriate value.

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c    |    1 +
 drivers/gpu/drm/i915/intel_drrs.c  |    5 +++++
 drivers/gpu/drm/i915/intel_drv.h   |    6 ++++++
 drivers/gpu/drm/i915/intel_dsi.c   |    8 ++++++++
 drivers/gpu/drm/i915/intel_modes.c |   28 ++++++++++++++++++++++++++++
 5 files changed, 48 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 9ded4d1..22001b6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5063,6 +5063,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect
 
 	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
+	intel_attach_drrs_capability_property(connector);
 	intel_dp->color_range_auto = true;
 
 	if (is_edp(intel_dp)) {
diff --git a/drivers/gpu/drm/i915/intel_drrs.c b/drivers/gpu/drm/i915/intel_drrs.c
index 9634254..89f2d39 100644
--- a/drivers/gpu/drm/i915/intel_drrs.c
+++ b/drivers/gpu/drm/i915/intel_drrs.c
@@ -684,6 +684,11 @@ int intel_drrs_init(struct drm_device *dev,
 	mutex_init(&drrs->drrs_mutex);
 	drrs->resume_idleness_detection = false;
 	drrs->drrs_state.current_rr_type = DRRS_HIGH_RR;
+
+	/* DRRS connector property */
+	drm_object_property_set_value(&intel_connector->base.base,
+				intel_connector->drrs_capability_property,
+				drrs->drrs_state.type);
 	DRM_INFO("SEAMLESS DRRS supported on this panel.\n");
 
 	return 0;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 3a5cff8..97a5af8 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -231,6 +231,9 @@ struct intel_connector {
 	void *port; /* store this opaque as its illegal to dereference it */
 
 	struct intel_dp *mst_port;
+
+	/* DRRS capability */
+	struct drm_property *drrs_capability_property;
 };
 
 typedef struct dpll {
@@ -1266,6 +1269,9 @@ int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
 void intel_attach_force_audio_property(struct drm_connector *connector);
 void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
 
+/* DRRS function */
+void intel_attach_drrs_capability_property(struct drm_connector *connector);
+
 
 /* intel_overlay.c */
 void intel_setup_overlay(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 503f3de..2efad4b 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -968,6 +968,13 @@ static void intel_dsi_encoder_destroy(struct drm_encoder *encoder)
 	intel_encoder_destroy(encoder);
 }
 
+static void
+intel_dsi_add_properties(struct intel_dsi *intel_dsi,
+				struct drm_connector *connector)
+{
+	intel_attach_drrs_capability_property(connector);
+}
+
 static const struct drm_encoder_funcs intel_dsi_funcs = {
 	.destroy = intel_dsi_encoder_destroy,
 };
@@ -1091,6 +1098,7 @@ void intel_dsi_init(struct drm_device *dev)
 	connector->interlace_allowed = false;
 	connector->doublescan_allowed = false;
 
+	intel_dsi_add_properties(intel_dsi, connector);
 	intel_connector_attach_encoder(intel_connector, intel_encoder);
 
 	drm_connector_register(connector);
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index 0e860f3..f6c466c 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -126,3 +126,31 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector)
 
 	drm_object_attach_property(&connector->base, prop, 0);
 }
+
+static const struct drm_prop_enum_list drrs_capability_names[] = {
+	{ DRRS_NOT_SUPPORTED, "Off" },
+	{ STATIC_DRRS_SUPPORT, "Off-Static" },
+	{ SEAMLESS_DRRS_SUPPORT, "Seamless-HW" },
+	{ SEAMLESS_DRRS_SUPPORT_SW, "Seamless-SW" },
+};
+
+void intel_attach_drrs_capability_property(struct drm_connector *connector)
+{
+	struct drm_device *dev = connector->dev;
+	struct intel_connector *intel_connector = to_intel_connector(connector);
+	struct drm_property *prop;
+
+	prop = intel_connector->drrs_capability_property;
+	if (prop == NULL) {
+		prop = drm_property_create_enum(dev, 0,
+					"drrs_capability",
+					drrs_capability_names,
+					ARRAY_SIZE(drrs_capability_names));
+		if (prop == NULL) {
+			DRM_ERROR("Drm property enum creation failed\n");
+			return;
+		}
+		intel_connector->drrs_capability_property = prop;
+	}
+	drm_object_attach_property(&connector->base, prop, DRRS_NOT_SUPPORTED);
+}
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-06-26 14:01 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 13:51 [RFC PATCH 00/18] Generic DRRS implementation across the encoders Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 01/18] drm/i915: Removing the eDP specific DRRS implementation Ramalingam C
2015-06-26 16:50   ` Daniel Vetter
2015-06-29 11:24     ` Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 02/18] drm/i915: Generic DRRS state Machine Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 03/18] drm/i915: Addition of the drrs_min_vrefresh in VBT Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 04/18] drm/i915: Implementation of Generic DSI DRRS Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 05/18] drm/i915: Adjusting the pclk for dual link and burst mode Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 06/18] drm/i915: VLV dsi drrs support Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 07/18] drm/i915: Generic eDP DRRS implementation Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 08/18] drm/i915: VLV eDP DRRS methods Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 09/18] drm/i915: Cloned mode check Ramalingam C
2015-06-26 17:08   ` Daniel Vetter
2015-06-26 17:14     ` Chris Wilson
2015-06-26 17:38       ` Daniel Vetter
2015-06-29 11:48     ` Ramalingam C
2015-06-29 16:16       ` Daniel Vetter
2015-06-26 13:51 ` [RFC PATCH 10/18] drm/i915: Initializing DRRS for all connectors Ramalingam C
2015-06-26 17:12   ` Daniel Vetter
2015-06-29 14:52     ` Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 11/18] drm/i915: Updating the crtc modes in DRRS transitions Ramalingam C
2015-06-26 17:11   ` Daniel Vetter
2015-06-29 14:58     ` Ramalingam C
2015-06-29 16:23       ` Daniel Vetter
2015-06-26 13:51 ` [RFC PATCH 12/18] drm/i915: Redesigning dp_set_m_n to receive divider values Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 13/18] drm/i915: MEDIA_RR support in general DRRS state machine Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 14/18] drm/i915: MEDIA_RR support in eDP DRRS module Ramalingam C
2015-06-26 13:51 ` [RFC PATCH 15/18] drm/i915: MEDIA_RR support in DSI " Ramalingam C
2015-06-26 13:52 ` [RFC PATCH 16/18] drm/i915: Filtering media playback DRRS requests Ramalingam C
2015-06-26 13:52 ` [RFC PATCH 17/18] drm/i915: Addition of downclock mode to connector modelist Ramalingam C
2015-06-26 13:52 ` Ramalingam C [this message]
2015-06-26 17:16 ` [RFC PATCH 00/18] Generic DRRS implementation across the encoders Daniel Vetter
2015-06-29 11:22   ` Ramalingam C
2015-06-29 16:27     ` Daniel Vetter
2015-06-30  6:29       ` Ramalingam C
2015-06-30 10:02         ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435326722-24633-19-git-send-email-ramalingam.c@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.