Commit 7218779e authored by Jani Nikula's avatar Jani Nikula

drm/edid: add drm_edid_is_digital()

Checking edid->input & DRM_EDID_INPUT_DIGITAL is common enough to
deserve a helper that also lets us abstract the raw EDID a bit better.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/4bdb407bf189fd922be022eb2f9564692377c81d.1692884619.git.jani.nikula@intel.com
parent a35239a8
......@@ -3110,7 +3110,7 @@ drm_monitor_supports_rb(const struct drm_edid *drm_edid)
return ret;
}
return ((drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL) != 0);
return drm_edid_is_digital(drm_edid);
}
static void
......@@ -6532,7 +6532,7 @@ static void update_display_info(struct drm_connector *connector,
if (edid->revision < 3)
goto out;
if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
if (!drm_edid_is_digital(drm_edid))
goto out;
info->color_formats |= DRM_COLOR_FORMAT_RGB444;
......@@ -7348,3 +7348,16 @@ static void _drm_update_tile_info(struct drm_connector *connector,
connector->tile_group = NULL;
}
}
/**
* drm_edid_is_digital - is digital?
* @drm_edid: The EDID
*
* Return true if input is digital.
*/
bool drm_edid_is_digital(const struct drm_edid *drm_edid)
{
return drm_edid && drm_edid->edid &&
drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL;
}
EXPORT_SYMBOL(drm_edid_is_digital);
......@@ -618,6 +618,7 @@ const struct drm_edid *drm_edid_read_switcheroo(struct drm_connector *connector,
int drm_edid_connector_update(struct drm_connector *connector,
const struct drm_edid *edid);
int drm_edid_connector_add_modes(struct drm_connector *connector);
bool drm_edid_is_digital(const struct drm_edid *drm_edid);
const u8 *drm_find_edid_extension(const struct drm_edid *drm_edid,
int ext_id, int *ext_index);
......
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