@@ -841,6 +841,38 @@ int drm_mode_create_tv_properties(struct drm_device *dev, int num_modes,
}
EXPORT_SYMBOL(drm_mode_create_tv_properties);
+static const struct drm_prop_enum_list s3d_modes_list[] =
+{
+ { 0, "None" },
+ { DRM_MODE_FLAG_3D_TOP_BOTTOM, "Top bottom" },
+ { DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF, "Side by side (half)" },
+ { DRM_MODE_FLAG_3D_FRAME_PACKING, "Frame packing" }
+};
+
+/**
+ * drm_mode_create_3d_property - create stereo 3D properties
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to modes
+ * that supports stereo 3D formats.
+ */
+int drm_mode_create_3d_property(struct drm_device *dev)
+{
+ struct drm_property *s3d_selector;
+
+ if (dev->mode_config.s3d_select_mode_property)
+ return 0;
+
+ s3d_selector = drm_property_create_enum(dev, 0,
+ "select 3D mode",
+ s3d_modes_list,
+ ARRAY_SIZE(s3d_modes_list));
+ dev->mode_config.s3d_select_mode_property = s3d_selector;
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_3d_property);
+
/**
* drm_mode_create_scaling_mode_property - create scaling mode property
* @dev: DRM device
@@ -802,6 +802,9 @@ struct drm_mode_config {
struct drm_property *tv_saturation_property;
struct drm_property *tv_hue_property;
+ /* Stereo 3D properties */
+ struct drm_property *s3d_select_mode_property;
+
/* Optional properties */
struct drm_property *scaling_mode_property;
struct drm_property *dithering_mode_property;
@@ -950,6 +953,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index,
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
char *formats[]);
+extern int drm_mode_create_3d_property(struct drm_device *dev);
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
extern int drm_mode_create_dithering_property(struct drm_device *dev);
extern int drm_mode_create_dirty_info_property(struct drm_device *dev);