Various cleanups for amdgpu_dm
Subsystems (3)
Various cleanups to indentation/braces as well as a couple of simplifications. Mostly NFC but there are a couple of patches with trivial functional changes (#6, #8)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/13 drm/amd/display: Simplify dm_late_init()
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
@@ -538,9 +538,8 @@ static int detect_mst_link_for_all_connectors(struct drm_device *dev)static int dm_late_init (void *handle) {struct drm_device *dev = ((struct amdgpu_device *)handle)->ddev; -int r =detect_mst_link_for_all_connectors (dev); -return r; +return detect_mst_link_for_all_connectors (dev); }static void s3_handle_mst (struct drm_device *dev,bool suspend)
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/13 drm/amd/display: Fix indentation in dm_suspend()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -4
@@ -598,10 +598,7 @@ static int dm_suspend(void *handle)WARN_ON (adev->dm.cached_state); adev->dm.cached_state =drm_atomic_helper_suspend (adev->ddev); -dc_set_power_state ( - dm->dc, -DC_ACPI_CM_POWER_STATE_D3 - ); +dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D3 );return ret; }
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/13 drm/amd/display: Fix indentation in dm_resume()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -4
@@ -636,10 +636,7 @@ static int dm_resume(void *handle)struct amdgpu_display_manager *dm = &adev->dm;/* power on hardware */ -dc_set_power_state ( - dm->dc, -DC_ACPI_CM_POWER_STATE_D0 - ); +dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D0 );return 0 ; }
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/13 drm/amd/display: Fix brace style in amdgpu_dm_update_connector_after_detect()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -898,9 +898,9 @@ amdgpu_dm_update_connector_after_detect(struct amdgpu_dm_connector *aconnector) connector); aconnector->dc_sink = sink; -if (sink->dc_edid.length ==0 ) +if (sink->dc_edid.length ==0 ) { aconnector->edid =NULL ; -else { + }else { aconnector->edid = (struct edid *) sink->dc_edid.raw_edid;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/13 drm/amd/display: Fix brace style in dm_handle_hpd_rx_irq()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -1018,8 +1018,9 @@ static void dm_handle_hpd_rx_irq(struct amdgpu_dm_connector *aconnector) dpcd_bytes_to_read); new_irq_handled = false; - }else + }else {break ; + } }if (process_count == max_process_count)
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/13 drm/amd/display: Simplify handle_hpd_rx_irq()
In reply to a message not in the archiveThere is a local reference to the dc_link that wasn't being used so we shorten references throughout the function.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -6
@@ -1032,20 +1032,20 @@ static void handle_hpd_rx_irq(void *param)struct amdgpu_dm_connector *aconnector = (struct amdgpu_dm_connector *)param;struct drm_connector *connector = &aconnector->base;struct drm_device *dev = connector->dev; -const struct dc_link *dc_link = aconnector->dc_link; +struct dc_link *dc_link = aconnector->dc_link;bool is_mst_root_connector = aconnector->mst_mgr.mst_state;/* TODO:Temporary add mutex to protect hpd interrupt not have a gpio * conflict, after implement i2c helper, this mutex should be * retired. */ -if (aconnector->dc_link->type != dc_connection_mst_branch) +if (dc_link->type != dc_connection_mst_branch)mutex_lock (&aconnector->hpd_lock); -if (dc_link_handle_hpd_rx_irq (aconnector->dc_link,NULL ) && +if (dc_link_handle_hpd_rx_irq (dc_link,NULL ) && !is_mst_root_connector) {/* Downstream Port status changed. */ -if (dc_link_detect (aconnector->dc_link,DETECT_REASON_HPDRX )) { +if (dc_link_detect (dc_link,DETECT_REASON_HPDRX )) {amdgpu_dm_update_connector_after_detect (aconnector);
@@ -1057,10 +1057,10 @@ static void handle_hpd_rx_irq(void *param) } }if ((dc_link->cur_link_settings.lane_count !=LANE_COUNT_UNKNOWN ) || - (dc_link->type == dc_connection_mst_branch)) + (dc_link->type == dc_connection_mst_branch))dm_handle_hpd_rx_irq (aconnector); -if (aconnector->dc_link->type != dc_connection_mst_branch) +if (dc_link->type != dc_connection_mst_branch)mutex_unlock (&aconnector->hpd_lock); }
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/13 drm/amd/display: Fix brace style in amdgpu_dm_initialize_drm_device()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
@@ -1420,9 +1420,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail_free_planes; aencoder =kzalloc (sizeof (*aencoder),GFP_KERNEL ); -if (!aencoder) { +if (!aencoder) goto fail_free_connector; - }if (amdgpu_dm_encoder_init (dm->ddev, aencoder, i)) {DRM_ERROR ("KMS: Failed to initialize encoder\n" );
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/13 drm/amd/display: Replace block with strncpy() in fill_audio_info()
In reply to a message not in the archiveReplace inlined strncpy with library call.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -5
@@ -2251,11 +2251,9 @@ static void fill_audio_info(struct audio_info *audio_info, cea_revision = drm_connector->display_info.cea_rev; -while (i <AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS && - edid_caps->display_name[i]) { - audio_info->display_name[i] = edid_caps->display_name[i]; - i++; - } +strncpy (audio_info->display_name, + edid_caps->display_name, +AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS -1 );if (cea_revision >=3 ) { audio_info->mode_count = edid_caps->audio_mode_count;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/13 drm/amd/display: Fix indentation in create_eml_sink()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
@@ -2816,8 +2816,7 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector) (edid->extensions +1 ) *EDID_LENGTH , &init_params); -if (aconnector->base.force - ==DRM_FORCE_ON ) +if (aconnector->base.force ==DRM_FORCE_ON ) aconnector->dc_sink = aconnector->dc_link->local_sink ? aconnector->dc_link->local_sink : aconnector->dc_em_sink;
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/13 drm/amd/display: Tidy up dm_drm_plane_reset()
In reply to a message not in the archiveMove WARN_ON higher up and in doing so fix brace style.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -3
@@ -2969,13 +2969,13 @@ static void dm_drm_plane_reset(struct drm_plane *plane) plane->funcs->atomic_destroy_state (plane, plane->state); amdgpu_state =kzalloc (sizeof (*amdgpu_state),GFP_KERNEL ); - +WARN_ON (amdgpu_state ==NULL ); +if (amdgpu_state) { plane->state = &amdgpu_state->base; plane->state->plane = plane; plane->state->rotation =DRM_MODE_ROTATE_0 ; - }else -WARN_ON (1 ); + } } static struct drm_plane_state *
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/13 drm/amd/display: Fix brace style in amdgpu_dm_connector_ddc_get_modes()
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -3409,8 +3409,9 @@ static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,drm_edid_to_eld (connector, edid);amdgpu_dm_get_native_mode (connector); - }else + }else { amdgpu_dm_connector->num_modes =0 ; + } }static int amdgpu_dm_connector_get_modes (struct drm_connector *connector)
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/13 drm/amd/display: Remove needless cast in amdgpu_dm_connector_init()
In reply to a message not in the archiveThe cast of dc_link is redundant.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -3567,7 +3567,8 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,struct dc *dc = dm->dc;struct dc_link *link =dc_get_link_at_index (dc, link_index);struct amdgpu_i2c_adapter *i2c; - ((struct dc_link *)link)->priv = aconnector; + + link->priv = aconnector;DRM_DEBUG_DRIVER ("%s()\n" , __func__);
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/13 drm/amd/display: Fix brace style
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +6 -9
@@ -208,24 +208,21 @@ static void remove_timer_handler(struct amdgpu_device *adev,DM_IRQ_TABLE_LOCK (adev, irq_table_flags); } -if (handler_in ==NULL ) { -/* Remove ALL handlers. */ +/* Remove ALL handlers. */ +if (handler_in ==NULL )continue ; - } -if (handler_in == handler_temp) { -/* Remove a SPECIFIC handler. -* Found our handler - we can stop here. */ +/* Remove a SPECIFIC handler. +* Found our handler - we can stop here. */ +if (handler_in == handler_temp)break ; - } }DM_IRQ_TABLE_UNLOCK (adev, irq_table_flags); -if (handler_in !=NULL && handler_removed == false) { +if (handler_in !=NULL && handler_removed == false)DRM_ERROR ("DM_IRQ: handler: %p is not in the list!\n" , handler_in); - } } static bool
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Andrey Grodzovsky
Acked-byQuoted 8 lines · Tom St Denis
Various cleanups to indentation/braces as well as a couple of simplifications. Mostly NFC but there are a couple of patches with trivial functional changes (#6, #8)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Harry Wentland
Reviewed-byThanks for these cleanups.
Some of these could possibly squashed but then, I generally prefer smaller changes than one big lump.
Harry
Quoted 9 lines · Tom St Denis
Various cleanups to indentation/braces as well as a couple of simplifications. Mostly NFC but there are a couple of patches with trivial functional changes (#6, #8)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 5eaea6a7-e3d9-e19d-4d75-3d26e4db9aaf-5C7GfCeVMHo@public.gmane.org
Quoted 6 lines · Harry Wentland
Thanks for these cleanups.
Some of these could possibly squashed but then, I generally prefer smaller changes than one big lump.
Reviewed-by Harry Wentland <[email protected]>
Hi Harry,
You're welcome. Normally I too agree that squashing is better but since that part of the tree is less familiar I decided to go for a easily bisectable patchset in case I did fubar something. Mostly I just compile test as I go to make sure I didn't typo anything.
I've pushed these to drm-next. Is there any other place you'd like me to merge them?
Cheers,
Tom
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 6dadea86-5a2c-e193-d02f-27515408b24c-5C7GfCeVMHo@public.gmane.org
Quoted 12 lines · Tom St Denis
Quoted 6 lines · Harry Wentland
Thanks for these cleanups.
Some of these could possibly squashed but then, I generally prefer smaller changes than one big lump.
Reviewed-by Harry Wentland <[email protected]>Hi Harry,
You're welcome. Normally I too agree that squashing is better but since that part of the tree is less familiar I decided to go for a easily bisectable patchset in case I did fubar something. Mostly I just compile test as I go to make sure I didn't typo anything.
Yeah, definitely better to keep it small, especially on unfamiliar territory.
Quoted 2 lines
I've pushed these to drm-next. Is there any other place you'd like me to merge them?
amd-staging-drm-next is the right place. I'll backmerge them to our internal tree from there.
Harry
Quoted 2 lines
Cheers,
Tom
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx