Use the DisplayID 2.0 primary use case information to deduce whether this is a head-mounted display, and should not be used for desktop. Cc: Iaroslav Boliukin <iam@xxxxxxx> Cc: Dmitry Osipenko <dmitry.osipenko@xxxxxxxxxxxxx> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> --- drivers/gpu/drm/drm_edid.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3d0a4da661bc..03ad53a1ba82 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -6433,6 +6433,29 @@ static void drm_reset_display_info(struct drm_connector *connector) info->quirks = 0; } +static void update_displayid_info(struct drm_connector *connector, + const struct drm_edid *drm_edid) +{ + struct drm_display_info *info = &connector->display_info; + const struct displayid_block *block; + struct displayid_iter iter; + + displayid_iter_edid_begin(drm_edid, &iter); + displayid_iter_for_each(block, &iter) { + if (displayid_version(&iter) == DISPLAY_ID_STRUCTURE_VER_20 && + (displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_VR || + displayid_primary_use(&iter) == PRIMARY_USE_HEAD_MOUNTED_AR)) + info->non_desktop = true; + + /* + * We're only interested in the base section here, no need to + * iterate further. + */ + break; + } + displayid_iter_end(&iter); +} + static void update_display_info(struct drm_connector *connector, const struct drm_edid *drm_edid) { @@ -6463,6 +6486,8 @@ static void update_display_info(struct drm_connector *connector, info->color_formats |= DRM_COLOR_FORMAT_RGB444; drm_parse_cea_ext(connector, drm_edid); + update_displayid_info(connector, drm_edid); + /* * Digital sink with "DFP 1.x compliant TMDS" according to EDID 1.3? * -- 2.34.1