}
}
-static int
-add_inferred_modes(struct drm_connector *connector, const struct edid *edid)
+static int add_inferred_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid)
{
struct detailed_mode_closure closure = {
.connector = connector,
- .edid = edid,
+ .edid = drm_edid->edid,
};
- if (version_greater(edid, 1, 0))
- drm_for_each_detailed_block(edid, do_inferred_modes, &closure);
+ if (version_greater(drm_edid->edid, 1, 0))
+ drm_for_each_detailed_block(drm_edid->edid, do_inferred_modes, &closure);
return closure.modes;
}
* bitmap of the supported "established modes" list (defined above). Tease them
* out and add them to the global modes list.
*/
-static int
-add_established_modes(struct drm_connector *connector, const struct edid *edid)
+static int add_established_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid)
{
struct drm_device *dev = connector->dev;
+ const struct edid *edid = drm_edid->edid;
unsigned long est_bits = edid->established_timings.t1 |
(edid->established_timings.t2 << 8) |
((edid->established_timings.mfg_rsvd & 0x80) << 9);
}
if (version_greater(edid, 1, 0))
- drm_for_each_detailed_block(edid, do_established_modes,
+ drm_for_each_detailed_block(drm_edid->edid, do_established_modes,
&closure);
return modes + closure.modes;
* using the appropriate standard (DMT, GTF, or CVT). Grab them from EDID and
* add them to the list.
*/
-static int
-add_standard_modes(struct drm_connector *connector, const struct edid *edid)
+static int add_standard_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid)
{
int i, modes = 0;
struct detailed_mode_closure closure = {
.connector = connector,
- .edid = edid,
+ .edid = drm_edid->edid,
};
for (i = 0; i < EDID_STD_TIMINGS; i++) {
struct drm_display_mode *newmode;
- newmode = drm_mode_std(connector, edid,
- &edid->standard_timings[i]);
+ newmode = drm_mode_std(connector, drm_edid->edid,
+ &drm_edid->edid->standard_timings[i]);
if (newmode) {
drm_mode_probed_add(connector, newmode);
modes++;
}
}
- if (version_greater(edid, 1, 0))
- drm_for_each_detailed_block(edid, do_standard_modes,
+ if (version_greater(drm_edid->edid, 1, 0))
+ drm_for_each_detailed_block(drm_edid->edid, do_standard_modes,
&closure);
/* XXX should also look for standard codes in VTB blocks */
}
static int
-add_cvt_modes(struct drm_connector *connector, const struct edid *edid)
+add_cvt_modes(struct drm_connector *connector, const struct drm_edid *drm_edid)
{
struct detailed_mode_closure closure = {
.connector = connector,
- .edid = edid,
+ .edid = drm_edid->edid,
};
- if (version_greater(edid, 1, 2))
- drm_for_each_detailed_block(edid, do_cvt_mode, &closure);
+ if (version_greater(drm_edid->edid, 1, 2))
+ drm_for_each_detailed_block(drm_edid->edid, do_cvt_mode, &closure);
/* XXX should also look for CVT codes in VTB blocks */
/*
* add_detailed_modes - Add modes from detailed timings
* @connector: attached connector
- * @edid: EDID block to scan
+ * @drm_edid: EDID block to scan
* @quirks: quirks to apply
*/
-static int
-add_detailed_modes(struct drm_connector *connector, const struct edid *edid,
- u32 quirks)
+static int add_detailed_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid, u32 quirks)
{
struct detailed_mode_closure closure = {
.connector = connector,
- .edid = edid,
+ .edid = drm_edid->edid,
.preferred = true,
.quirks = quirks,
};
- if (closure.preferred && !version_greater(edid, 1, 3))
+ if (closure.preferred && !version_greater(drm_edid->edid, 1, 3))
closure.preferred =
- (edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
+ (drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING);
- drm_for_each_detailed_block(edid, do_detailed_mode, &closure);
+ drm_for_each_detailed_block(drm_edid->edid, do_detailed_mode, &closure);
return closure.modes;
}
}
/* Return true if the EDID has a CTA extension or a DisplayID CTA data block */
-static bool drm_edid_has_cta_extension(const struct edid *edid)
+static bool drm_edid_has_cta_extension(const struct drm_edid *drm_edid)
{
const struct displayid_block *block;
struct displayid_iter iter;
bool found = false;
/* Look for a top level CEA extension block */
- if (drm_find_edid_extension(edid, CEA_EXT, &ext_index))
+ if (drm_find_edid_extension(drm_edid->edid, CEA_EXT, &ext_index))
return true;
/* CEA blocks can also be found embedded in a DisplayID block */
- displayid_iter_edid_begin(edid, &iter);
+ displayid_iter_edid_begin(drm_edid->edid, &iter);
displayid_iter_for_each(block, &iter) {
if (block->tag == DATA_BLOCK_CTA) {
found = true;
return vic > 0 && vic < ARRAY_SIZE(edid_4k_modes);
}
-static int
-add_alternate_cea_modes(struct drm_connector *connector, const struct edid *edid)
+static int add_alternate_cea_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid)
{
struct drm_device *dev = connector->dev;
struct drm_display_mode *mode, *tmp;
int modes = 0;
/* Don't add CTA modes if the CTA extension block is missing */
- if (!drm_edid_has_cta_extension(edid))
+ if (!drm_edid_has_cta_extension(drm_edid))
return 0;
/*
hdmi->y420_cmdb_map = map;
}
-static int
-add_cea_modes(struct drm_connector *connector, const struct edid *edid)
+static int add_cea_modes(struct drm_connector *connector,
+ const struct drm_edid *drm_edid)
{
const struct cea_db *db;
struct cea_db_iter iter;
int modes = 0;
- cea_db_iter_edid_begin(edid, &iter);
+ cea_db_iter_edid_begin(drm_edid->edid, &iter);
cea_db_iter_for_each(db, &iter) {
const u8 *hdmi = NULL, *video = NULL;
u8 hdmi_len = 0, video_len = 0;
}
static int add_displayid_detailed_modes(struct drm_connector *connector,
- const struct edid *edid)
+ const struct drm_edid *drm_edid)
{
const struct displayid_block *block;
struct displayid_iter iter;
int num_modes = 0;
- displayid_iter_edid_begin(edid, &iter);
+ displayid_iter_edid_begin(drm_edid->edid, &iter);
displayid_iter_for_each(block, &iter) {
if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING ||
block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING)
static int drm_edid_connector_update(struct drm_connector *connector,
const struct drm_edid *drm_edid)
{
- const struct edid *edid;
int num_modes = 0;
u32 quirks;
return 0;
}
- edid = drm_edid->edid;
-
/*
* CEA-861-F adds ycbcr capability map block, for HDMI 2.0 sinks.
* To avoid multiple parsing of same block, lets parse that map
*
* XXX order for additional mode types in extension blocks?
*/
- num_modes += add_detailed_modes(connector, edid, quirks);
- num_modes += add_cvt_modes(connector, edid);
- num_modes += add_standard_modes(connector, edid);
- num_modes += add_established_modes(connector, edid);
- num_modes += add_cea_modes(connector, edid);
- num_modes += add_alternate_cea_modes(connector, edid);
- num_modes += add_displayid_detailed_modes(connector, edid);
- if (edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
- num_modes += add_inferred_modes(connector, edid);
+ num_modes += add_detailed_modes(connector, drm_edid, quirks);
+ num_modes += add_cvt_modes(connector, drm_edid);
+ num_modes += add_standard_modes(connector, drm_edid);
+ num_modes += add_established_modes(connector, drm_edid);
+ num_modes += add_cea_modes(connector, drm_edid);
+ num_modes += add_alternate_cea_modes(connector, drm_edid);
+ num_modes += add_displayid_detailed_modes(connector, drm_edid);
+ if (drm_edid->edid->features & DRM_EDID_FEATURE_DEFAULT_GTF)
+ num_modes += add_inferred_modes(connector, drm_edid);
if (quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75))
edid_fixup_preferred(connector, quirks);