forked from Minki/linux
drm/edid: convert drm_connector_update_edid_property() to struct drm_edid
Make drm_connector_update_edid_property() a thin wrapper around a struct drm_edid based version of the same. This lets us remove the legacy drm_update_tile_info() and drm_add_display_info() functions altogether. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/4bfe87ae392554ffb41d725353c4265ae56700bb.1656494768.git.jani.nikula@intel.com
This commit is contained in:
parent
02b16fbc56
commit
a819451eda
@ -6042,14 +6042,6 @@ out:
|
||||
return quirks;
|
||||
}
|
||||
|
||||
static u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edid)
|
||||
{
|
||||
struct drm_edid drm_edid;
|
||||
|
||||
return update_display_info(connector,
|
||||
drm_edid_legacy_init(&drm_edid, edid));
|
||||
}
|
||||
|
||||
static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev,
|
||||
struct displayid_detailed_timings_1 *timings,
|
||||
bool type_7)
|
||||
@ -6206,8 +6198,63 @@ static int drm_edid_connector_update(struct drm_connector *connector,
|
||||
return num_modes;
|
||||
}
|
||||
|
||||
static void drm_update_tile_info(struct drm_connector *connector,
|
||||
const struct edid *edid);
|
||||
static void _drm_update_tile_info(struct drm_connector *connector,
|
||||
const struct drm_edid *drm_edid);
|
||||
|
||||
static int _drm_connector_update_edid_property(struct drm_connector *connector,
|
||||
const struct drm_edid *drm_edid)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
int ret;
|
||||
|
||||
/* ignore requests to set edid when overridden */
|
||||
if (connector->override_edid)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Set the display info, using edid if available, otherwise resetting
|
||||
* the values to defaults. This duplicates the work done in
|
||||
* drm_add_edid_modes, but that function is not consistently called
|
||||
* before this one in all drivers and the computation is cheap enough
|
||||
* that it seems better to duplicate it rather than attempt to ensure
|
||||
* some arbitrary ordering of calls.
|
||||
*/
|
||||
if (drm_edid)
|
||||
update_display_info(connector, drm_edid);
|
||||
else
|
||||
drm_reset_display_info(connector);
|
||||
|
||||
_drm_update_tile_info(connector, drm_edid);
|
||||
|
||||
if (connector->edid_blob_ptr) {
|
||||
const struct edid *old_edid = connector->edid_blob_ptr->data;
|
||||
|
||||
if (old_edid) {
|
||||
if (!drm_edid_are_equal(drm_edid ? drm_edid->edid : NULL, old_edid)) {
|
||||
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
|
||||
connector->base.id, connector->name);
|
||||
|
||||
connector->epoch_counter += 1;
|
||||
DRM_DEBUG_KMS("Updating change counter to %llu\n",
|
||||
connector->epoch_counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
drm_edid ? drm_edid->size : 0,
|
||||
drm_edid ? drm_edid->edid : NULL,
|
||||
&connector->base,
|
||||
dev->mode_config.edid_property);
|
||||
if (ret)
|
||||
return ret;
|
||||
return drm_connector_set_tile_property(connector);
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_connector_update_edid_property - update the edid property of a connector
|
||||
@ -6226,60 +6273,10 @@ static void drm_update_tile_info(struct drm_connector *connector,
|
||||
int drm_connector_update_edid_property(struct drm_connector *connector,
|
||||
const struct edid *edid)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
size_t size = 0;
|
||||
int ret;
|
||||
const struct edid *old_edid;
|
||||
struct drm_edid drm_edid;
|
||||
|
||||
/* ignore requests to set edid when overridden */
|
||||
if (connector->override_edid)
|
||||
return 0;
|
||||
|
||||
if (edid)
|
||||
size = EDID_LENGTH * (1 + edid->extensions);
|
||||
|
||||
/*
|
||||
* Set the display info, using edid if available, otherwise resetting
|
||||
* the values to defaults. This duplicates the work done in
|
||||
* drm_add_edid_modes, but that function is not consistently called
|
||||
* before this one in all drivers and the computation is cheap enough
|
||||
* that it seems better to duplicate it rather than attempt to ensure
|
||||
* some arbitrary ordering of calls.
|
||||
*/
|
||||
if (edid)
|
||||
drm_add_display_info(connector, edid);
|
||||
else
|
||||
drm_reset_display_info(connector);
|
||||
|
||||
drm_update_tile_info(connector, edid);
|
||||
|
||||
if (connector->edid_blob_ptr) {
|
||||
old_edid = (const struct edid *)connector->edid_blob_ptr->data;
|
||||
if (old_edid) {
|
||||
if (!drm_edid_are_equal(edid, old_edid)) {
|
||||
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Edid was changed.\n",
|
||||
connector->base.id, connector->name);
|
||||
|
||||
connector->epoch_counter += 1;
|
||||
DRM_DEBUG_KMS("Updating change counter to %llu\n",
|
||||
connector->epoch_counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
edid,
|
||||
&connector->base,
|
||||
dev->mode_config.edid_property);
|
||||
if (ret)
|
||||
return ret;
|
||||
return drm_connector_set_tile_property(connector);
|
||||
return _drm_connector_update_edid_property(connector,
|
||||
drm_edid_legacy_init(&drm_edid, edid));
|
||||
}
|
||||
EXPORT_SYMBOL(drm_connector_update_edid_property);
|
||||
|
||||
@ -6720,11 +6717,3 @@ static void _drm_update_tile_info(struct drm_connector *connector,
|
||||
connector->tile_group = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void drm_update_tile_info(struct drm_connector *connector,
|
||||
const struct edid *edid)
|
||||
{
|
||||
struct drm_edid drm_edid;
|
||||
|
||||
_drm_update_tile_info(connector, drm_edid_legacy_init(&drm_edid, edid));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user