drm/amd/display: Don't access legacy properties
We're an atomic driver and shouldn't access legacy properties. Doing so will only scare users with stack traces. Instead save the prop in the state and access it directly. Much simpler. Signed-off-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1eb1547fd0
commit
8218d7f1f7
|
@ -5118,17 +5118,24 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector,
|
||||||
struct edid *edid)
|
struct edid *edid)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint64_t val_capable;
|
|
||||||
bool edid_check_required;
|
bool edid_check_required;
|
||||||
struct detailed_timing *timing;
|
struct detailed_timing *timing;
|
||||||
struct detailed_non_pixel *data;
|
struct detailed_non_pixel *data;
|
||||||
struct detailed_data_monitor_range *range;
|
struct detailed_data_monitor_range *range;
|
||||||
struct amdgpu_dm_connector *amdgpu_dm_connector =
|
struct amdgpu_dm_connector *amdgpu_dm_connector =
|
||||||
to_amdgpu_dm_connector(connector);
|
to_amdgpu_dm_connector(connector);
|
||||||
|
struct dm_connector_state *dm_con_state;
|
||||||
|
|
||||||
struct drm_device *dev = connector->dev;
|
struct drm_device *dev = connector->dev;
|
||||||
struct amdgpu_device *adev = dev->dev_private;
|
struct amdgpu_device *adev = dev->dev_private;
|
||||||
|
|
||||||
|
if (!connector->state) {
|
||||||
|
DRM_ERROR("%s - Connector has no state", __func__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dm_con_state = to_dm_connector_state(connector->state);
|
||||||
|
|
||||||
edid_check_required = false;
|
edid_check_required = false;
|
||||||
if (!amdgpu_dm_connector->dc_sink) {
|
if (!amdgpu_dm_connector->dc_sink) {
|
||||||
DRM_ERROR("dc_sink NULL, could not add free_sync module.\n");
|
DRM_ERROR("dc_sink NULL, could not add free_sync module.\n");
|
||||||
|
@ -5147,7 +5154,7 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector,
|
||||||
amdgpu_dm_connector);
|
amdgpu_dm_connector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val_capable = 0;
|
dm_con_state->freesync_capable = false;
|
||||||
if (edid_check_required == true && (edid->version > 1 ||
|
if (edid_check_required == true && (edid->version > 1 ||
|
||||||
(edid->version == 1 && edid->revision > 1))) {
|
(edid->version == 1 && edid->revision > 1))) {
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
@ -5183,7 +5190,7 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector,
|
||||||
amdgpu_dm_connector->min_vfreq * 1000000;
|
amdgpu_dm_connector->min_vfreq * 1000000;
|
||||||
amdgpu_dm_connector->caps.max_refresh_in_micro_hz =
|
amdgpu_dm_connector->caps.max_refresh_in_micro_hz =
|
||||||
amdgpu_dm_connector->max_vfreq * 1000000;
|
amdgpu_dm_connector->max_vfreq * 1000000;
|
||||||
val_capable = 1;
|
dm_con_state->freesync_capable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,6 +220,7 @@ struct dm_connector_state {
|
||||||
uint8_t underscan_hborder;
|
uint8_t underscan_hborder;
|
||||||
bool underscan_enable;
|
bool underscan_enable;
|
||||||
struct mod_freesync_user_enable user_enable;
|
struct mod_freesync_user_enable user_enable;
|
||||||
|
bool freesync_capable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define to_dm_connector_state(x)\
|
#define to_dm_connector_state(x)\
|
||||||
|
|
Loading…
Reference in New Issue