[PATCH 11/28] drm/amd/display: Unify DRM state variable namings.
Harry Wentland
harry.wentland at amd.com
Thu Oct 19 17:46:30 UTC 2017
From: "Leo (Sunpeng) Li" <sunpeng.li at amd.com>
Use new_*_state and old_*_state for their respective new/old DRM object
states.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 90 +++++++++++------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 924e33211f8b..1b11ea23f112 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -608,12 +608,12 @@ amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,
struct drm_crtc *crtc)
{
uint32_t i;
- struct drm_connector_state *conn_state;
+ struct drm_connector_state *new_con_state;
struct drm_connector *connector;
struct drm_crtc *crtc_from_state;
- for_each_new_connector_in_state(state, connector, conn_state, i) {
- crtc_from_state = conn_state->crtc;
+ for_each_new_connector_in_state(state, connector, new_con_state, i) {
+ crtc_from_state = new_con_state->crtc;
if (crtc_from_state == crtc)
return to_amdgpu_dm_connector(connector);
@@ -640,10 +640,10 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)
struct amdgpu_dm_connector *aconnector;
struct drm_connector *connector;
struct drm_crtc *crtc;
- struct drm_crtc_state *crtc_state;
+ struct drm_crtc_state *new_crtc_state;
struct dm_crtc_state *dm_crtc_state;
struct drm_plane *plane;
- struct drm_plane_state *plane_state;
+ struct drm_plane_state *new_plane_state;
struct dm_plane_state *dm_plane_state;
struct dm_atomic_state *cached_state;
int ret = 0;
@@ -681,8 +681,8 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)
}
/* Force mode set in atomic comit */
- for_each_new_crtc_in_state(adev->dm.cached_state, crtc, crtc_state, i)
- crtc_state->active_changed = true;
+ for_each_new_crtc_in_state(adev->dm.cached_state, crtc, new_crtc_state, i)
+ new_crtc_state->active_changed = true;
cached_state = to_dm_atomic_state(adev->dm.cached_state);
@@ -698,8 +698,8 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)
ASSERT(cached_state->context);
dc_resource_state_copy_construct_current(adev->dm.dc, cached_state->context);
- for_each_new_crtc_in_state(adev->dm.cached_state, crtc, crtc_state, i) {
- dm_crtc_state = to_dm_crtc_state(crtc_state);
+ for_each_new_crtc_in_state(adev->dm.cached_state, crtc, new_crtc_state, i) {
+ dm_crtc_state = to_dm_crtc_state(new_crtc_state);
if (dm_crtc_state->stream) {
WARN_ON(kref_read(&dm_crtc_state->stream->refcount) > 1);
dc_stream_release(dm_crtc_state->stream);
@@ -707,8 +707,8 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)
}
}
- for_each_new_plane_in_state(adev->dm.cached_state, plane, plane_state, i) {
- dm_plane_state = to_dm_plane_state(plane_state);
+ for_each_new_plane_in_state(adev->dm.cached_state, plane, new_plane_state, i) {
+ dm_plane_state = to_dm_plane_state(new_plane_state);
if (dm_plane_state->dc_state) {
WARN_ON(kref_read(&dm_plane_state->dc_state->refcount) > 1);
dc_plane_state_release(dm_plane_state->dc_state);
@@ -4015,7 +4015,7 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
bool nonblock)
{
struct drm_crtc *crtc;
- struct drm_crtc_state *old_crtc_state, *new_state;
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
struct amdgpu_device *adev = dev->dev_private;
int i;
@@ -4026,11 +4026,11 @@ static int amdgpu_dm_atomic_commit(struct drm_device *dev,
* it will update crtc->dm_crtc_state->stream pointer which is used in
* the ISRs.
*/
- for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_state, i) {
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
struct dm_crtc_state *old_acrtc_state = to_dm_crtc_state(old_crtc_state);
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
- if (drm_atomic_crtc_needs_modeset(new_state) && old_acrtc_state->stream)
+ if (drm_atomic_crtc_needs_modeset(new_crtc_state) && old_acrtc_state->stream)
manage_dm_interrupts(adev, acrtc, false);
}
/* Add check here for SoC's that support hardware cursor plane, to
@@ -4056,7 +4056,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
unsigned long flags;
bool wait_for_vblank = true;
struct drm_connector *connector;
- struct drm_connector_state *old_conn_state, *new_con_state;
+ struct drm_connector_state *old_con_state, *new_con_state;
struct dm_crtc_state *old_acrtc_state, *new_acrtc_state;
drm_atomic_helper_update_legacy_modeset_state(dev, state);
@@ -4221,9 +4221,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
}
/* Handle scaling and undersacn changes*/
- for_each_oldnew_connector_in_state(state, connector, old_conn_state, new_con_state, i) {
+ for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
struct dm_connector_state *con_new_state = to_dm_connector_state(new_con_state);
- struct dm_connector_state *con_old_state = to_dm_connector_state(old_conn_state);
+ struct dm_connector_state *con_old_state = to_dm_connector_state(old_con_state);
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(con_new_state->base.crtc);
struct dc_stream_status *status = NULL;
@@ -4451,7 +4451,7 @@ static int dm_update_crtcs_state(struct dc *dc,
bool *lock_and_validation_needed)
{
struct drm_crtc *crtc;
- struct drm_crtc_state *old_crtc_state, *crtc_state;
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
int i;
struct dm_crtc_state *old_acrtc_state, *new_acrtc_state;
struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
@@ -4460,16 +4460,16 @@ static int dm_update_crtcs_state(struct dc *dc,
/*TODO Move this code into dm_crtc_atomic_check once we get rid of dc_validation_set */
/* update changed items */
- for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, crtc_state, i) {
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
struct amdgpu_crtc *acrtc = NULL;
struct amdgpu_dm_connector *aconnector = NULL;
- struct drm_connector_state *conn_state = NULL;
+ struct drm_connector_state *new_con_state = NULL;
struct dm_connector_state *dm_conn_state = NULL;
new_stream = NULL;
old_acrtc_state = to_dm_crtc_state(old_crtc_state);
- new_acrtc_state = to_dm_crtc_state(crtc_state);
+ new_acrtc_state = to_dm_crtc_state(new_crtc_state);
acrtc = to_amdgpu_crtc(crtc);
aconnector = amdgpu_dm_find_first_crtc_matching_connector(state, crtc);
@@ -4477,18 +4477,18 @@ static int dm_update_crtcs_state(struct dc *dc,
/* TODO This hack should go away */
if (aconnector && enable) {
// Make sure fake sink is created in plug-in scenario
- conn_state = drm_atomic_get_connector_state(state,
+ new_con_state = drm_atomic_get_connector_state(state,
&aconnector->base);
- if (IS_ERR(conn_state)) {
- ret = PTR_ERR_OR_ZERO(conn_state);
+ if (IS_ERR(new_con_state)) {
+ ret = PTR_ERR_OR_ZERO(new_con_state);
break;
}
- dm_conn_state = to_dm_connector_state(conn_state);
+ dm_conn_state = to_dm_connector_state(new_con_state);
new_stream = create_stream_for_sink(aconnector,
- &crtc_state->mode,
+ &new_crtc_state->mode,
dm_conn_state);
/*
@@ -4508,14 +4508,14 @@ static int dm_update_crtcs_state(struct dc *dc,
if (dc_is_stream_unchanged(new_stream, old_acrtc_state->stream) &&
dc_is_stream_scaling_unchanged(new_stream, old_acrtc_state->stream)) {
- crtc_state->mode_changed = false;
+ new_crtc_state->mode_changed = false;
DRM_DEBUG_DRIVER("Mode change not required, setting mode_changed to %d",
- crtc_state->mode_changed);
+ new_crtc_state->mode_changed);
}
- if (!drm_atomic_crtc_needs_modeset(crtc_state))
+ if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
goto next_crtc;
DRM_DEBUG_DRIVER(
@@ -4523,12 +4523,12 @@ static int dm_update_crtcs_state(struct dc *dc,
"planes_changed:%d, mode_changed:%d,active_changed:%d,"
"connectors_changed:%d\n",
acrtc->crtc_id,
- crtc_state->enable,
- crtc_state->active,
- crtc_state->planes_changed,
- crtc_state->mode_changed,
- crtc_state->active_changed,
- crtc_state->connectors_changed);
+ new_crtc_state->enable,
+ new_crtc_state->active,
+ new_crtc_state->planes_changed,
+ new_crtc_state->mode_changed,
+ new_crtc_state->active_changed,
+ new_crtc_state->connectors_changed);
/* Remove stream for any changed/disabled CRTC */
if (!enable) {
@@ -4562,10 +4562,10 @@ static int dm_update_crtcs_state(struct dc *dc,
if (!aconnector || (!aconnector->dc_sink && aconnector->mst_port))
goto next_crtc;
- if (modereset_required(crtc_state))
+ if (modereset_required(new_crtc_state))
goto next_crtc;
- if (modeset_required(crtc_state, new_stream,
+ if (modeset_required(new_crtc_state, new_stream,
old_acrtc_state->stream)) {
WARN_ON(new_acrtc_state->stream);
@@ -4729,9 +4729,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
struct dc *dc = adev->dm.dc;
struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
struct drm_connector *connector;
- struct drm_connector_state *old_con_state, *conn_state;
+ struct drm_connector_state *old_con_state, *new_con_state;
struct drm_crtc *crtc;
- struct drm_crtc_state *old_crtc_state, *crtc_state;
+ struct drm_crtc_state *old_crtc_state, *new_crtc_state;
/*
* This bool will be set for true for any modeset/reset
@@ -4752,16 +4752,16 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
* we should not add it to list of affected planes.
*/
if (state->legacy_cursor_update) {
- for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
- if (crtc_state->color_mgmt_changed) {
+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+ if (new_crtc_state->color_mgmt_changed) {
ret = drm_atomic_add_affected_planes(state, crtc);
if (ret)
goto fail;
}
}
} else {
- for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, crtc_state, i) {
- if (!crtc_state->enable)
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+ if (!new_crtc_state->enable)
continue;
ret = drm_atomic_add_affected_connectors(state, crtc);
@@ -4812,9 +4812,9 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
* new stream into context w\o causing full reset. Need to
* decide how to handle.
*/
- for_each_oldnew_connector_in_state(state, connector, old_con_state, conn_state, i) {
+ for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
struct dm_connector_state *con_old_state = to_dm_connector_state(old_con_state);
- struct dm_connector_state *con_new_state = to_dm_connector_state(conn_state);
+ struct dm_connector_state *con_new_state = to_dm_connector_state(new_con_state);
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(con_new_state->base.crtc);
/* Skip any modesets/resets */
--
2.14.1
More information about the amd-gfx
mailing list