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>
Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
(Ported 66660d4cf2
from git://people.freedesktop.org/~airlied/linux)
pull/10/head
parent
0240e5e248
commit
4b3f1d875a
|
@ -234,6 +234,10 @@ int drm_connector_init(struct drm_device *dev,
|
|||
config->link_status_property,
|
||||
0);
|
||||
|
||||
drm_object_attach_property(&connector->base,
|
||||
config->non_desktop_property,
|
||||
0);
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
|
||||
drm_object_attach_property(&connector->base, config->prop_crtc_id, 0);
|
||||
}
|
||||
|
@ -796,6 +800,11 @@ int drm_connector_create_standard_properties(struct drm_device *dev)
|
|||
return -ENOMEM;
|
||||
dev->mode_config.hdr_source_metadata_property = prop;
|
||||
|
||||
prop = drm_property_create_bool(dev, DRM_MODE_PROP_IMMUTABLE, "non-desktop");
|
||||
if (!prop)
|
||||
return -ENOMEM;
|
||||
dev->mode_config.non_desktop_property = prop;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1179,6 +1188,10 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector,
|
|||
if (edid)
|
||||
size = EDID_LENGTH * (1 + edid->extensions);
|
||||
|
||||
drm_object_property_set_value(&connector->base,
|
||||
dev->mode_config.non_desktop_property,
|
||||
connector->display_info.non_desktop);
|
||||
|
||||
ret = drm_property_replace_global_blob(dev,
|
||||
&connector->edid_blob_ptr,
|
||||
size,
|
||||
|
|
|
@ -82,6 +82,8 @@
|
|||
#define EDID_QUIRK_FORCE_6BPC (1 << 10)
|
||||
/* Force 10bpc */
|
||||
#define EDID_QUIRK_FORCE_10BPC (1 << 11)
|
||||
/* Non desktop display (i.e. HMD) */
|
||||
#define EDID_QUIRK_NON_DESKTOP (1 << 12)
|
||||
|
||||
struct detailed_mode_closure {
|
||||
struct drm_connector *connector;
|
||||
|
@ -4491,7 +4493,7 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
|
|||
}
|
||||
|
||||
static void drm_add_display_info(struct drm_connector *connector,
|
||||
struct edid *edid)
|
||||
struct edid *edid, u32 quirks)
|
||||
{
|
||||
struct drm_display_info *info = &connector->display_info;
|
||||
|
||||
|
@ -4505,6 +4507,8 @@ static void drm_add_display_info(struct drm_connector *connector,
|
|||
info->max_tmds_clock = 0;
|
||||
info->dvi_dual = false;
|
||||
|
||||
info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
|
||||
|
||||
if (edid->revision < 3)
|
||||
return;
|
||||
|
||||
|
@ -4725,7 +4729,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
|
|||
* To avoid multiple parsing of same block, lets parse that map
|
||||
* from sink info, before parsing CEA modes.
|
||||
*/
|
||||
drm_add_display_info(connector, edid);
|
||||
drm_add_display_info(connector, edid, quirks);
|
||||
|
||||
/*
|
||||
* EDID spec says modes should be preferred in this order:
|
||||
|
|
|
@ -285,6 +285,11 @@ struct drm_display_info {
|
|||
*/
|
||||
u8 cea_rev;
|
||||
|
||||
/**
|
||||
* @non_desktop: Non desktop display (HMD)
|
||||
*/
|
||||
bool non_desktop;
|
||||
|
||||
/**
|
||||
* @hdmi: advance features of a HDMI sink.
|
||||
*/
|
||||
|
|
|
@ -735,6 +735,14 @@ struct drm_mode_config {
|
|||
* the position of the output on the host's screen.
|
||||
*/
|
||||
struct drm_property *suggested_x_property;
|
||||
|
||||
/**
|
||||
* @non_desktop_property: Optional connector property with a hint
|
||||
* that device isn't a standard display, and the console/desktop
|
||||
* should not be displayed on it.
|
||||
*/
|
||||
struct drm_property *non_desktop_property;
|
||||
|
||||
/**
|
||||
* @suggested_y_property: Optional connector property with a hint for
|
||||
* the position of the output on the host's screen.
|
||||
|
|
Loading…
Reference in New Issue