Commit 783dedc5 authored by Jani Nikula's avatar Jani Nikula

drm/edid: store quirks in display info

Although the quirks are internal to EDID parsing, it'll be helpful to
store them in display info to avoid having to pass them around.

This will also help separate adding probed modes (which needs the
quirks) from updating display info.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/819b908f64ad2d158245917f436f24d33a65b95d.1672826282.git.jani.nikula@intel.com
parent 852be13f
...@@ -6428,18 +6428,20 @@ static void drm_reset_display_info(struct drm_connector *connector) ...@@ -6428,18 +6428,20 @@ static void drm_reset_display_info(struct drm_connector *connector)
kfree(info->vics); kfree(info->vics);
info->vics = NULL; info->vics = NULL;
info->vics_len = 0; info->vics_len = 0;
info->quirks = 0;
} }
static u32 update_display_info(struct drm_connector *connector, static void update_display_info(struct drm_connector *connector,
const struct drm_edid *drm_edid) const struct drm_edid *drm_edid)
{ {
struct drm_display_info *info = &connector->display_info; struct drm_display_info *info = &connector->display_info;
const struct edid *edid = drm_edid->edid; const struct edid *edid = drm_edid->edid;
u32 quirks = edid_get_quirks(drm_edid);
drm_reset_display_info(connector); drm_reset_display_info(connector);
info->quirks = edid_get_quirks(drm_edid);
info->width_mm = edid->width_cm * 10; info->width_mm = edid->width_cm * 10;
info->height_mm = edid->height_cm * 10; info->height_mm = edid->height_cm * 10;
...@@ -6510,17 +6512,15 @@ static u32 update_display_info(struct drm_connector *connector, ...@@ -6510,17 +6512,15 @@ static u32 update_display_info(struct drm_connector *connector,
drm_update_mso(connector, drm_edid); drm_update_mso(connector, drm_edid);
out: out:
if (quirks & EDID_QUIRK_NON_DESKTOP) { if (info->quirks & EDID_QUIRK_NON_DESKTOP) {
drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Non-desktop display%s\n", drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Non-desktop display%s\n",
connector->base.id, connector->name, connector->base.id, connector->name,
info->non_desktop ? " (redundant quirk)" : ""); info->non_desktop ? " (redundant quirk)" : "");
info->non_desktop = true; info->non_desktop = true;
} }
if (quirks & EDID_QUIRK_CAP_DSC_15BPP) if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP)
info->max_dsc_bpp = 15; info->max_dsc_bpp = 15;
return quirks;
} }
static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev, static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev,
...@@ -6618,8 +6618,8 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, ...@@ -6618,8 +6618,8 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
static int _drm_edid_connector_update(struct drm_connector *connector, static int _drm_edid_connector_update(struct drm_connector *connector,
const struct drm_edid *drm_edid) const struct drm_edid *drm_edid)
{ {
struct drm_display_info *info = &connector->display_info;
int num_modes = 0; int num_modes = 0;
u32 quirks;
if (!drm_edid) { if (!drm_edid) {
drm_reset_display_info(connector); drm_reset_display_info(connector);
...@@ -6632,7 +6632,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector, ...@@ -6632,7 +6632,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
* To avoid multiple parsing of same block, lets parse that map * To avoid multiple parsing of same block, lets parse that map
* from sink info, before parsing CEA modes. * from sink info, before parsing CEA modes.
*/ */
quirks = update_display_info(connector, drm_edid); update_display_info(connector, drm_edid);
/* Depends on info->cea_rev set by update_display_info() above */ /* Depends on info->cea_rev set by update_display_info() above */
drm_edid_to_eld(connector, drm_edid); drm_edid_to_eld(connector, drm_edid);
...@@ -6651,7 +6651,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector, ...@@ -6651,7 +6651,7 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
* *
* XXX order for additional mode types in extension blocks? * XXX order for additional mode types in extension blocks?
*/ */
num_modes += add_detailed_modes(connector, drm_edid, quirks); num_modes += add_detailed_modes(connector, drm_edid, info->quirks);
num_modes += add_cvt_modes(connector, drm_edid); num_modes += add_cvt_modes(connector, drm_edid);
num_modes += add_standard_modes(connector, drm_edid); num_modes += add_standard_modes(connector, drm_edid);
num_modes += add_established_modes(connector, drm_edid); num_modes += add_established_modes(connector, drm_edid);
...@@ -6661,20 +6661,20 @@ static int _drm_edid_connector_update(struct drm_connector *connector, ...@@ -6661,20 +6661,20 @@ static int _drm_edid_connector_update(struct drm_connector *connector,
if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
num_modes += add_inferred_modes(connector, drm_edid); num_modes += add_inferred_modes(connector, drm_edid);
if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75)) if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
edid_fixup_preferred(connector, quirks); edid_fixup_preferred(connector, info->quirks);
if (quirks & EDID_QUIRK_FORCE_6BPC) if (info->quirks & EDID_QUIRK_FORCE_6BPC)
connector->display_info.bpc = 6; info->bpc = 6;
if (quirks & EDID_QUIRK_FORCE_8BPC) if (info->quirks & EDID_QUIRK_FORCE_8BPC)
connector->display_info.bpc = 8; info->bpc = 8;
if (quirks & EDID_QUIRK_FORCE_10BPC) if (info->quirks & EDID_QUIRK_FORCE_10BPC)
connector->display_info.bpc = 10; info->bpc = 10;
if (quirks & EDID_QUIRK_FORCE_12BPC) if (info->quirks & EDID_QUIRK_FORCE_12BPC)
connector->display_info.bpc = 12; info->bpc = 12;
return num_modes; return num_modes;
} }
......
...@@ -728,6 +728,11 @@ struct drm_display_info { ...@@ -728,6 +728,11 @@ struct drm_display_info {
* @vics_len: Number of elements in vics. Internal to EDID parsing. * @vics_len: Number of elements in vics. Internal to EDID parsing.
*/ */
int vics_len; int vics_len;
/**
* @quirks: EDID based quirks. Internal to EDID parsing.
*/
u32 quirks;
}; };
int drm_display_info_set_bus_formats(struct drm_display_info *info, int drm_display_info_set_bus_formats(struct drm_display_info *info,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment