[Intel-gfx] [PATCH v4 1/9] drm/atomic: Handle aspect ratio and scaling mode in core

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Apr 12 10:49:59 UTC 2017


This is required to for i915 to convert connector properties to atomic.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: dri-devel at lists.freedesktop.org
---
 drivers/gpu/drm/drm_atomic.c | 8 ++++++++
 include/drm/drm_connector.h  | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f32506a7c1d6..052cfe2376f8 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1123,6 +1123,10 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
 		 */
 		if (state->link_status != DRM_LINK_STATUS_GOOD)
 			state->link_status = val;
+	} else if (property == config->aspect_ratio_property) {
+		state->picture_aspect_ratio = val;
+	} else if (property == config->scaling_mode_property) {
+		state->scaling_mode = val;
 	} else if (connector->funcs->atomic_set_property) {
 		return connector->funcs->atomic_set_property(connector,
 				state, property, val);
@@ -1199,6 +1203,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->tv.hue;
 	} else if (property == config->link_status_property) {
 		*val = state->link_status;
+	} else if (property == config->aspect_ratio_property) {
+		*val = state->picture_aspect_ratio;
+	} else if (property == config->scaling_mode_property) {
+		*val = state->scaling_mode;
 	} else if (connector->funcs->atomic_get_property) {
 		return connector->funcs->atomic_get_property(connector,
 				state, property, val);
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 4eeda120e46d..3b819cd1d858 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -326,6 +326,9 @@ struct drm_connector_state {
 	struct drm_atomic_state *state;
 
 	struct drm_tv_connector_state tv;
+
+	unsigned int picture_aspect_ratio;
+	unsigned int scaling_mode;
 };
 
 /**
-- 
2.7.4



More information about the Intel-gfx mailing list