diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-16 00:08:09 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-11-22 21:45:25 -0500 |
commit | 66660d4cf21b7dfcb258d8a51734963802693796 (patch) | |
tree | 0b0136f6030cc961209ecd17a0963d16feebc2fa /drivers/gpu/drm | |
parent | 1cee3bce71e916c6213ec5566bd9666ffd202de0 (diff) |
drm: add connector info/property for non-desktop displays [v2]
This adds the infrastructure needed to quirk displays
using edid and to mark them a non-desktop.
A non-desktop display is one which shouldn't normally be included
as a part of a desktop environment.
This is meant to cover head mounted devices like HTC Vive.
v2: Change description from non-standard to non-desktop, add docs
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
fixup docs
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 8 |
2 files changed, 23 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 704fc8934616..25f4b2e9a44f 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c | |||
@@ -234,6 +234,10 @@ int drm_connector_init(struct drm_device *dev, | |||
234 | config->link_status_property, | 234 | config->link_status_property, |
235 | 0); | 235 | 0); |
236 | 236 | ||
237 | drm_object_attach_property(&connector->base, | ||
238 | config->non_desktop_property, | ||
239 | 0); | ||
240 | |||
237 | if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { | 241 | if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { |
238 | drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); | 242 | drm_object_attach_property(&connector->base, config->prop_crtc_id, 0); |
239 | } | 243 | } |
@@ -763,6 +767,10 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name, | |||
763 | * value of link-status is "GOOD". If something fails during or after modeset, | 767 | * value of link-status is "GOOD". If something fails during or after modeset, |
764 | * the kernel driver may set this to "BAD" and issue a hotplug uevent. Drivers | 768 | * the kernel driver may set this to "BAD" and issue a hotplug uevent. Drivers |
765 | * should update this value using drm_mode_connector_set_link_status_property(). | 769 | * should update this value using drm_mode_connector_set_link_status_property(). |
770 | * non_desktop: | ||
771 | * Indicates the output should be ignored for purposes of displaying a | ||
772 | * standard desktop environment or console. This is most likely because | ||
773 | * the output device is not rectilinear. | ||
766 | * | 774 | * |
767 | * Connectors also have one standardized atomic property: | 775 | * Connectors also have one standardized atomic property: |
768 | * | 776 | * |
@@ -811,6 +819,11 @@ int drm_connector_create_standard_properties(struct drm_device *dev) | |||
811 | return -ENOMEM; | 819 | return -ENOMEM; |
812 | dev->mode_config.link_status_property = prop; | 820 | dev->mode_config.link_status_property = prop; |
813 | 821 | ||
822 | prop = drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE, "non-desktop"); | ||
823 | if (!prop) | ||
824 | return -ENOMEM; | ||
825 | dev->mode_config.non_desktop_property = prop; | ||
826 | |||
814 | return 0; | 827 | return 0; |
815 | } | 828 | } |
816 | 829 | ||
@@ -1194,6 +1207,10 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, | |||
1194 | if (edid) | 1207 | if (edid) |
1195 | size = EDID_LENGTH * (1 + edid->extensions); | 1208 | size = EDID_LENGTH * (1 + edid->extensions); |
1196 | 1209 | ||
1210 | drm_object_property_set_value(&connector->base, | ||
1211 | dev->mode_config.non_desktop_property, | ||
1212 | connector->display_info.non_desktop); | ||
1213 | |||
1197 | ret = drm_property_replace_global_blob(dev, | 1214 | ret = drm_property_replace_global_blob(dev, |
1198 | &connector->edid_blob_ptr, | 1215 | &connector->edid_blob_ptr, |
1199 | size, | 1216 | size, |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 00ddabfbf980..1e24d5d9d659 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -82,6 +82,8 @@ | |||
82 | #define EDID_QUIRK_FORCE_6BPC (1 << 10) | 82 | #define EDID_QUIRK_FORCE_6BPC (1 << 10) |
83 | /* Force 10bpc */ | 83 | /* Force 10bpc */ |
84 | #define EDID_QUIRK_FORCE_10BPC (1 << 11) | 84 | #define EDID_QUIRK_FORCE_10BPC (1 << 11) |
85 | /* Non desktop display (i.e. HMD) */ | ||
86 | #define EDID_QUIRK_NON_DESKTOP (1 << 12) | ||
85 | 87 | ||
86 | struct detailed_mode_closure { | 88 | struct detailed_mode_closure { |
87 | struct drm_connector *connector; | 89 | struct drm_connector *connector; |
@@ -4393,7 +4395,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector, | |||
4393 | } | 4395 | } |
4394 | 4396 | ||
4395 | static void drm_add_display_info(struct drm_connector *connector, | 4397 | static void drm_add_display_info(struct drm_connector *connector, |
4396 | struct edid *edid) | 4398 | struct edid *edid, u32 quirks) |
4397 | { | 4399 | { |
4398 | struct drm_display_info *info = &connector->display_info; | 4400 | struct drm_display_info *info = &connector->display_info; |
4399 | 4401 | ||
@@ -4407,6 +4409,8 @@ static void drm_add_display_info(struct drm_connector *connector, | |||
4407 | info->max_tmds_clock = 0; | 4409 | info->max_tmds_clock = 0; |
4408 | info->dvi_dual = false; | 4410 | info->dvi_dual = false; |
4409 | 4411 | ||
4412 | info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP); | ||
4413 | |||
4410 | if (edid->revision < 3) | 4414 | if (edid->revision < 3) |
4411 | return; | 4415 | return; |
4412 | 4416 | ||
@@ -4627,7 +4631,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) | |||
4627 | * To avoid multiple parsing of same block, lets parse that map | 4631 | * To avoid multiple parsing of same block, lets parse that map |
4628 | * from sink info, before parsing CEA modes. | 4632 | * from sink info, before parsing CEA modes. |
4629 | */ | 4633 | */ |
4630 | drm_add_display_info(connector, edid); | 4634 | drm_add_display_info(connector, edid, quirks); |
4631 | 4635 | ||
4632 | /* | 4636 | /* |
4633 | * EDID spec says modes should be preferred in this order: | 4637 | * EDID spec says modes should be preferred in this order: |