DC Linux Patches Oct 25, 2017
Subsystems (3)
cover DC Linux Patches Oct 25, 2017
* Remove annoyning Freesync warning
* Fix Freesync and amd-stg which was broken in last set of patches
* Fix issue with plugging in displays during S3
* Bunch of generic fixes found during Raven bringup
* Whole bunch of Raven fixes and work
Andrew Jiang (3):
drm/amd/display: Reject PPLib clock values if they are invalid drm/amd/display: Use constants from atom.h for HDMI caps read drm/amd/display: Don't reject 3D timings
Anthony Koo (1):
drm/amd/display: Move hdr_metadata from plane to stream
Charlene Liu (1):
drm/amd/display: correct DP is always in full range or bt609
Dmytro Laktyushkin (2):
drm/amd/display: fix split recout calculation
drm/amd/display: fix split recout offset
Eric Yang (1):
drm/amd/display: Add timing validation against dongle cap
Harry Wentland (7):
drm/amdgpu: Remove immutable flag from freesync_capable property drm/amd/display: Move conn_state to header drm/amd/display: Use plane pointer to avoid line breaks drm/amd/display: Use single fail label in init_drm_dev drm/amd/display: Explicitly call ->reset for each object drm/amd/display: Don't access legacy properties drm/amd/display: Fix Freesync enablement
Hersen Wu (1):
drm/amd/display: Handle as MST first and then DP dongle if sink
support both
Leo (Sunpeng) Li (2):
drm/amd/display: Fix styling of freesync code in commit_tail drm/amd/display: Complete TODO item: use new DRM iterator
Roman Li (1):
drm/amd/display: Fix S3 topology change
SivapiriyanKumarasamy (1):
drm/amd/display: Apply VQ adjustments in MPO case
Tony Cheng (3):
drm/amd/display: dal 3.1.08
drm/amd/display: dal 3.1.09
drm/amd/display: dal 3.1.10
Yongqiang Sun (3):
drm/amd/display: Power down front end in init_hw. drm/amd/display: Not reset front end when program back end. drm/amd/display: Added disconnect dchub.
Yue Hin Lau (3):
drm/amd/display: create new files for hubbub functions drm/amd/display: create new structure for hubbub drm/amd/display: fix bug from last commit for hubbub
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 198 ++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 13 + drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 68 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 4 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 108 ++- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 21 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 51 +- drivers/gpu/drm/amd/display/dc/dc.h | 44 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 9 + drivers/gpu/drm/amd/display/dc/dc_types.h | 5 - .../drm/amd/display/dc/dce/dce_stream_encoder.c | 34 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +- drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 3 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 31 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 47 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 44 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 510 +++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 217 ++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 9 + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 841 +++++---------------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 44 ++ .../amd/display/dc/dcn10/dcn10_timing_generator.c | 3 - drivers/gpu/drm/amd/display/dc/inc/core_status.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 10 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 2 + drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 14 + drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 6 +- 32 files changed, 1468 insertions(+), 906 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h
Signature · 6 lines
2.14.1 _______________________________________________ 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): 20171026183525.7532-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/29 drm/amdgpu: Remove immutable flag from freesync_capable property
Atomic drivers should not use legacy properties but atomic properties don't support the immutable flag. Remove the immutable flag for now.
This will be followed by a bunch of DC patches to start treating freesync_capable as an atomic property on a connector_state.
Eventually we'll want to remove the these properties and replace them with new atomic adaptive sync properties that we define in DRM.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 -1
@@ -638,7 +638,7 @@ int amdgpu_modeset_create_props(struct amdgpu_device *adev)return -ENOMEM ; adev->mode_info.freesync_capable_property =drm_property_create_bool (adev->ddev, -DRM_MODE_PROP_IMMUTABLE , +0 ,"freesync_capable" );if (!adev->mode_info.freesync_capable_property)return -ENOMEM ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/29 drm/amd/display: Fix styling of freesync code in commit_tail
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
For better readability.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -4
@@ -4111,7 +4111,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)* are removed from freesync module */ if (adev->dm.freesync_module) { -for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, + new_crtc_state, i) {struct amdgpu_dm_connector *aconnector =NULL ;struct dm_connector_state *dm_new_con_state =NULL ;struct amdgpu_crtc *acrtc =NULL ;
@@ -4139,9 +4140,11 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)amdgpu_dm_find_first_crtc_matching_connector ( state, crtc);if (!aconnector) { -DRM_DEBUG_DRIVER ("Atomic commit: Failed to find connector for acrtc id:%d " -"skipping freesync init\n" , - acrtc->crtc_id); +DRM_DEBUG_DRIVER ("Atomic commit: Failed to " +"find connector for acrtc " +"id:%d skipping freesync " +"init\n" , + acrtc->crtc_id);continue ; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/29 drm/amd/display: Complete TODO item: use new DRM iterator
In reply to a message not in the archiveFrom: "Leo (Sunpeng) Li" <[email protected]>
Abandon new_crtcs array and use for_each_new iterator to acquire new crtcs.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +14 -22
@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct amdgpu_display_manager *dm = &adev->dm;struct dm_atomic_state *dm_state;uint32_t i, j; -uint32_t new_crtcs_count =0 ;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct amdgpu_crtc *new_crtcs[MAX_STREAMS ];unsigned long flags;bool wait_for_vblank = true;struct drm_connector *connector;
@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)continue ; } -if (dm_old_crtc_state->stream)remove_stream (adev, acrtc, dm_old_crtc_state->stream); - -/* -* this loop saves set mode crtcs -* we needed to enable vblanks once all -* resources acquired in dc after dc_commit_streams -*/ - -/*TODO move all this into dm_crtc_state, get rid of -* new_crtcs array and use old and new atomic states -* instead -*/ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode; crtc->hwmode = new_crtc_state->mode;
@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)dm_error ("%s: Failed to update stream scaling!\n" , __func__); } -for (i =0 ; i < new_crtcs_count; i++) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, + new_crtc_state, i) {/* * loop to enable interrupts on newly arrived crtc */ -struct amdgpu_crtc *acrtc = new_crtcs[i]; +struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); +bool modeset_needed; - new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + modeset_needed =modeset_required ( + new_crtc_state, + dm_new_crtc_state->stream, + dm_old_crtc_state->stream); + +if (dm_new_crtc_state->stream ==NULL || !modeset_needed) +continue ;if (adev->dm.freesync_module)mod_freesync_notify_mode_change ( - adev->dm.freesync_module, &dm_new_crtc_state->stream,1 ); + adev->dm.freesync_module, + &dm_new_crtc_state->stream,1 );manage_dm_interrupts (adev, acrtc, true); }
Signature · 6 lines
2.14.1 _______________________________________________ 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): 20171026183525.7532-4-harry.wentland-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 03/29] drm/amd/display: Complete TODO item: use new DRM iterator
Quoted 66 lines · Harry Wentland
From: "Leo (Sunpeng) Li" <[email protected]>
Abandon
new_crtcsarray and usefor_each_newiterator to acquire new crtcs.Signed-off-by Leo (Sunpeng) Li <[email protected]>Reviewed-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-20@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct amdgpu_display_manager *dm = &adev->dm;struct dm_atomic_state *dm_state;uint32_t i, j; -uint32_t new_crtcs_count =0 ;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct amdgpu_crtc *new_crtcs[MAX_STREAMS ];unsigned long flags;bool wait_for_vblank = true;struct drm_connector *connector;@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)continue ; } -if (dm_old_crtc_state->stream)remove_stream (adev, acrtc, dm_old_crtc_state->stream); - -/* -* this loop saves set mode crtcs -* we needed to enable vblanks once all -* resources acquired in dc after dc_commit_streams -*/ - -/*TODO move all this into dm_crtc_state, get rid of -* new_crtcs array and use old and new atomic states -* instead -*/ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode; crtc->hwmode = new_crtc_state->mode;@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)dm_error ("%s: Failed to update stream scaling!\n" , __func__); } -for (i =0 ; i < new_crtcs_count; i++) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, + new_crtc_state, i) {/* * loop to enable interrupts on newly arrived crtc */ -struct amdgpu_crtc *acrtc = new_crtcs[i]; +struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); +bool modeset_needed;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 4222
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-1- new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + modeset_needed =modeset_required ( + new_crtc_state, + dm_new_crtc_state->stream, + dm_old_crtc_state->stream); + +if (dm_new_crtc_state->stream ==NULL || !modeset_needed) +continue ;
I feel it's a bit future bug prone to repeat the 2 checks above from the initial for_each_crtc_in_state loop, somebody makes changes there and forget about this loop. The array is ugly but it avoids logic duplication.
Thanks,
Andrey
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 4230
Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1if (adev->dm.freesync_module)mod_freesync_notify_mode_change ( - adev->dm.freesync_module, &dm_new_crtc_state->stream,1 ); + adev->dm.freesync_module, + &dm_new_crtc_state->stream,1 );manage_dm_interrupts (adev, acrtc, true); }
_______________________________________________
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): 3450881e-59f5-7784-707c-fa9387d9e97e-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 03/29] drm/amd/display: Complete TODO item: use new DRM iterator
Quoted 76 lines · Andrey Grodzovsky
Quoted 73 lines · Harry Wentland
From: "Leo (Sunpeng) Li" <[email protected]>
Abandon
new_crtcsarray and usefor_each_newiterator to acquire new crtcs.Signed-off-by Leo (Sunpeng) Li <[email protected]>Reviewed-by Harry Wentland <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 36
+++++++++--------------1 file changed, 14 insertions(+), 22 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-2@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct amdgpu_display_manager *dm = &adev->dm; struct dm_atomic_state *dm_state; uint32_t i, j; - uint32_t new_crtcs_count = 0; struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state, *new_crtc_state; - struct amdgpu_crtc *new_crtcs[MAX_STREAMS]; unsigned long flags; bool wait_for_vblank = true;struct
drm_connector*connector;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-19@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) continue; } - if (dm_old_crtc_state->stream) remove_stream(adev, acrtc, dm_old_crtc_state->stream); - - /* - * this loop saves set mode crtcs - * we needed to enable vblanks once all - * resources acquired in dc after dc_commit_streams - */ - - /*TODO move all this into dm_crtc_state, get rid of - * new_crtcs array and use old and new atomic states - * instead - */ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode; crtc->hwmode = new_crtc_state->mode;@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_error("%s: Failed to update stream scaling!\n", __func__); } - for (i = 0; i < new_crtcs_count; i++) { + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, + new_crtc_state, i) { /* * loop to enable interrupts on newly arrived crtc */ - struct amdgpu_crtc *acrtc = new_crtcs[i]; + struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); + bool modeset_needed; - new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base); dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); + dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); + modeset_needed = modeset_required( + new_crtc_state, + dm_new_crtc_state->stream,
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 4222
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-0+ dm_old_crtc_state->stream); + + if (dm_new_crtc_state->stream == NULL || !modeset_needed) + continue;I feel it's a bit future bug prone to repeat the 2 checks above from the initial
for_each_crtc_in_stateloop, somebody makes changes there and forget about this loop. The array is ugly but it avoids logic duplication.
I think a better fix would be to combine this for_each section with the one above it. The only thing keeping them separate (not shown in the above context) is an if (adev->dm.freesync_module) guard, which can be pulled into the first for_each loop. It would also eliminate a lot of duplicated initialization code.
Thoughts?
Leo
Quoted 13 lines
Thanks,
AndreyQuoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (adev->dm.freesync_module)mod_freesync_notify_mode_change(
-adev->dm.freesync_module,&dm_new_crtc_state->stream, 1);
+adev->dm.freesync_module,
+&dm_new_crtc_state->stream, 1);manage_dm_interrupts(adev, acrtc, true);
}
_______________________________________________
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): 87b988ad-8c7c-ec08-df65-6b4ff4c1af59-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 03/29] drm/amd/display: Complete TODO item: use new DRM iterator
Quoted 95 lines · Leo
Quoted 77 lines · Andrey Grodzovsky
Quoted 74 lines · Harry Wentland
From: "Leo (Sunpeng) Li" <[email protected]>
Abandon
new_crtcsarray and usefor_each_newiterator to acquire new crtcs.Signed-off-by Leo (Sunpeng) Li <[email protected]>Reviewed-by Harry Wentland <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 36
+++++++++--------------1 file changed, 14 insertions(+), 22 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-2@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct amdgpu_display_manager *dm = &adev->dm; struct dm_atomic_state *dm_state; uint32_t i, j; - uint32_t new_crtcs_count = 0; struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state, *new_crtc_state; - struct amdgpu_crtc *new_crtcs[MAX_STREAMS]; unsigned long flags; bool wait_for_vblank = true;struct
drm_connector*connector;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-19@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) continue; } - if (dm_old_crtc_state->stream) remove_stream(adev, acrtc, dm_old_crtc_state->stream); - - /* - * this loop saves set mode crtcs - * we needed to enable vblanks once all - * resources acquired in dc after dc_commit_streams - */ - - /*TODO move all this into dm_crtc_state, get rid of - * new_crtcs array and use old and new atomic states - * instead - */ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode; crtc->hwmode = new_crtc_state->mode;@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_error("%s: Failed to update stream scaling!\n", __func__); } - for (i = 0; i < new_crtcs_count; i++) { + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, + new_crtc_state, i) { /* * loop to enable interrupts on newly arrived crtc */ - struct amdgpu_crtc *acrtc = new_crtcs[i]; + struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); + bool modeset_needed; - new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base); dm_new_crtc_state = to_dm_crtc_state(new_crtc_state); + dm_old_crtc_state = to_dm_crtc_state(old_crtc_state); + modeset_needed = modeset_required( + new_crtc_state, + dm_new_crtc_state->stream,Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 4222
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-0+ dm_old_crtc_state->stream); + + if (dm_new_crtc_state->stream == NULL || !modeset_needed) + continue;I feel it's a bit future bug prone to repeat the 2 checks above from the initial
for_each_crtc_in_stateloop, somebody makes changes there and forget about this loop. The array is ugly but it avoids logic duplication.I think a better fix would be to combine this
for_eachsection with the one above it. The only thing keeping them separate (not shown in the above context) is anif (adev->dm.freesync_module)guard, which can be pulled into the firstfor_eachloop. It would also eliminate a lot of duplicated initialization code.
Quoted 4 lines
Thoughts?
Leo
Ignore what I said, It seems I was looking at the wrong context :) The fact this blob is being done after dc_commit_state() is annoying...
The maintainability of this duplicated logic is a good point. Although I'm not sure if going back to a shared array using custom iterator logic is the best approach. Perhapse we can pull this duplicated logic into a seperate function?
Thanks,
Leo
Quoted 13 lines
Quoted 13 lines
Thanks,
AndreyQuoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0if (adev->dm.freesync_module)
mod_freesync_notify_mode_change( - adev->dm.freesync_module, &dm_new_crtc_state->stream, 1);
+adev->dm.freesync_module, +&dm_new_crtc_state->stream, 1);manage_dm_interrupts(adev, acrtc, true); }
Quoted 4 lines
_______________________________________________
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): cdd84a44-a35d-d980-1ae4-f82a76eceecf-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 03/29] drm/amd/display: Complete TODO item: use new DRM iterator
Quoted 100 lines · Leo
Quoted 97 lines · Leo
Quoted 79 lines · Andrey Grodzovsky
Quoted 76 lines · Harry Wentland
From: "Leo (Sunpeng) Li" <[email protected]>
Abandon
new_crtcsarray and usefor_each_newiterator to acquire new crtcs.Signed-off-by Leo (Sunpeng) Li <[email protected]>Reviewed-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-2@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct amdgpu_display_manager *dm = &adev->dm;struct dm_atomic_state *dm_state;uint32_t i, j; -uint32_t new_crtcs_count =0 ;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct amdgpu_crtc *new_crtcs[MAX_STREAMS ];unsigned long flags;bool wait_for_vblank = true;struct drm_connector *connector;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-16@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) continue; } -if (dm_old_crtc_state->stream)remove_stream (adev, acrtc, dm_old_crtc_state->stream); - -/* -* this loop saves set mode crtcs -* we needed to enable vblanks once all -* resources acquired in dc after dc_commit_streams -*/ - -/*TODO move all this into dm_crtc_state, get rid of -* new_crtcs array and use old and new atomic states -* instead -*/ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode;crtc->hwmode = new_crtc_state->mode;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-3@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_error("%s: Failed to update stream scaling!\n", __func__); } -for (i =0 ; i < new_crtcs_count; i++) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, + new_crtc_state, i) {/* * loop to enable interrupts on newly arrived crtc */ -struct amdgpu_crtc *acrtc = new_crtcs[i]; +struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); +bool modeset_needed; - new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + modeset_needed = modeset_required( + new_crtc_state, + dm_new_crtc_state->stream,Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void · line 4223
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-0+ dm_old_crtc_state->stream); + +if (dm_new_crtc_state->stream ==NULL || !modeset_needed) +continue ;I feel it's a bit future bug prone to repeat the 2 checks above from the initial
for_each_crtc_in_stateloop, somebody makes changes there and forget about this loop. The array is ugly but it avoids logic duplication.I think a better fix would be to combine this
for_eachsection with the one above it. The only thing keeping them separate (not shown in the above context) is anif (adev->dm.freesync_module)guard, which can be pulled into the firstfor_eachloop. It would also eliminate a lot of duplicated initialization code.
Quoted 8 lines
Quoted 4 lines
Thoughts?
Leo
Ignore what I said, It seems I was looking at the wrong context :) The fact this blob is being done after
dc_commit_state()is annoying...The maintainability of this duplicated logic is a good point. Although I'm not sure if going back to a shared array using custom iterator logic is the best approach. Perhapse we can pull this duplicated logic into a seperate function?
That actually a good idea.
Thanks,
Andrey
Quoted 23 lines
Thanks,
LeoQuoted 17 lines
Quoted 13 lines
Thanks,
AndreyQuoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1if (adev->dm.freesync_module)mod_freesync_notify_mode_change ( - adev->dm.freesync_module, &dm_new_crtc_state->stream,1 ); + adev->dm.freesync_module, + &dm_new_crtc_state->stream, 1);manage_dm_interrupts (adev, acrtc, true); }_______________________________________________
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
Re: [PATCH 03/29] drm/amd/display: Complete TODO item: use new DRM iterator
In reply to a message not in the archiveQuoted 91 lines · Leo
Quoted 79 lines · Andrey Grodzovsky
Quoted 76 lines · Harry Wentland
From: "Leo (Sunpeng) Li" <[email protected]>
Abandon
new_crtcsarray and usefor_each_newiterator to acquire new crtcs.Signed-off-by Leo (Sunpeng) Li <[email protected]>Reviewed-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++-------------- 1 file changed, 14 insertions(+), 22 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-2@@ -4013,10 +4013,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct amdgpu_display_manager *dm = &adev->dm;struct dm_atomic_state *dm_state;uint32_t i, j; -uint32_t new_crtcs_count =0 ;struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state, *new_crtc_state; -struct amdgpu_crtc *new_crtcs[MAX_STREAMS ];unsigned long flags;bool wait_for_vblank = true;struct drm_connector *connector;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-16@@ -4075,25 +4073,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) continue; } -if (dm_old_crtc_state->stream)remove_stream (adev, acrtc, dm_old_crtc_state->stream); - -/* -* this loop saves set mode crtcs -* we needed to enable vblanks once all -* resources acquired in dc after dc_commit_streams -*/ - -/*TODO move all this into dm_crtc_state, get rid of -* new_crtcs array and use old and new atomic states -* instead -*/ - new_crtcs[new_crtcs_count] = acrtc; - new_crtcs_count++; - - new_crtc_state =drm_atomic_get_new_crtc_state (state, crtc); acrtc->enabled = true; acrtc->hw_mode = new_crtc_state->mode;crtc->hwmode = new_crtc_state->mode;drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-3@@ -4221,18 +4203,28 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_error("%s: Failed to update stream scaling!\n", __func__); } -for (i =0 ; i < new_crtcs_count; i++) { +for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, + new_crtc_state, i) {/* * loop to enable interrupts on newly arrived crtc */ -struct amdgpu_crtc *acrtc = new_crtcs[i]; +struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc); +bool modeset_needed; - new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); dm_new_crtc_state =to_dm_crtc_state (new_crtc_state); + dm_old_crtc_state =to_dm_crtc_state (old_crtc_state); + modeset_needed = modeset_required( + new_crtc_state, + dm_new_crtc_state->stream,Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · line 4222
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-0+ dm_old_crtc_state->stream); + +if (dm_new_crtc_state->stream ==NULL || !modeset_needed) +continue ;I feel it's a bit future bug prone to repeat the 2 checks above from the initial
for_each_crtc_in_stateloop, somebody makes changes there and forget about this loop. The array is ugly but it avoids logic duplication.
Quoted 7 lines
I think a better fix would be to combine this
for_eachsection with the one above it. The only thing keeping them separate (not shown in the above context) is anif (adev->dm.freesync_module)guard, which can be pulled into the firstfor_eachloop. It would also eliminate a lot of duplicated initialization code.Thoughts?
It might be a bit more difficult since inside the clause is flip and vblank interrupts enabling, but they rely heavily on acrtc->otg_inst which is being set in between.
Thanks,
Andrey
Quoted 16 lines
Leo
Quoted 13 lines
Thanks,
AndreyQuoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1if (adev->dm.freesync_module)mod_freesync_notify_mode_change ( - adev->dm.freesync_module, &dm_new_crtc_state->stream,1 ); + adev->dm.freesync_module, + &dm_new_crtc_state->stream, 1);manage_dm_interrupts (adev, acrtc, true); }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/29 drm/amd/display: Add timing validation against dongle cap
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
For DP active dongles, the dpcd dongle caps are read but not used to validate mode timing. This addresses this.
In particular, this change fixes light up on the HDMI 4k TV connected through DP active dongle. Since the 4k TV defaults to YCbCr420, which the dongle don't support.
This change does not address MST cases, a more generalized approach must be taken for that.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 70 +++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 21 ++++++- drivers/gpu/drm/amd/display/dc/inc/core_status.h | 2 +- 4 files changed, 91 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -128,6 +128,7 @@ static bool create_links( link->link_id.id =CONNECTOR_ID_VIRTUAL ; link->link_id.enum_id =ENUM_ID_1 ; link->link_enc =kzalloc (sizeof (*link->link_enc),GFP_KERNEL ); + link->link_status.dpcd_caps = &link->dpcd_caps; enc_init.ctx = dc->ctx; enc_init.channel =CHANNEL_ID_UNKNOWN ;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +69 -1
89 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +20 -1
@@ -2062,6 +2062,24 @@ bool is_dp_active_dongle(const struct dc_link *link) (dongle_type ==DISPLAY_DONGLE_DP_HDMI_CONVERTER ); } +static int translate_dpcd_max_bpc (enum dpcd_downstream_port_max_bpc bpc) +{ +switch (bpc) { +case DOWN_STREAM_MAX_8BPC : +return 8 ; +case DOWN_STREAM_MAX_10BPC : +return 10 ; +case DOWN_STREAM_MAX_12BPC : +return 12 ; +case DOWN_STREAM_MAX_16BPC : +return 16 ; +default : +break ; + } + +return -1 ; +} +static void get_active_converter_info (uint8_t data,struct dc_link *link) {
@@ -2131,7 +2149,8 @@ static void get_active_converter_info( hdmi_caps.bits.YCrCr420_CONVERSION; link->dpcd_caps.dongle_caps.dp_hdmi_max_bpc = - hdmi_color_caps.bits.MAX_BITS_PER_COLOR_COMPONENT; +translate_dpcd_max_bpc ( + hdmi_color_caps.bits.MAX_BITS_PER_COLOR_COMPONENT); link->dpcd_caps.dongle_caps.extendedCapValid = true; }
drivers/gpu/drm/amd/display/dc/inc/core_status.h +1 -1
@@ -38,7 +38,7 @@ enum dc_status {DC_FAIL_DETACH_SURFACES =8 ,DC_FAIL_SURFACE_VALIDATE =9 ,DC_NO_DP_LINK_BANDWIDTH =10 , -DC_EXCEED_DONGLE_MAX_CLK =11 , +DC_EXCEED_DONGLE_CAP =11 ,DC_SURFACE_PIXEL_FORMAT_UNSUPPORTED =12 ,DC_FAIL_BANDWIDTH_VALIDATE =13 ,/* BW and Watermark validation */ DC_FAIL_SCALING = 14,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/29 drm/amd/display: create new files for hubbub functions
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
moving hubbub functions to new file
--- drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 3 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 494 +++++++++++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 67 +++ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 490 +------------------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + 5 files changed, 579 insertions(+), 476 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c create mode 100644 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h
drivers/gpu/drm/amd/display/dc/dcn10/Makefile +2 -1
@@ -4,7 +4,8 @@ DCN10 = dcn10_resource.o dcn10_ipp.o dcn10_hw_sequencer.o \ dcn10_dpp.o dcn10_opp.o dcn10_timing_generator.o \ dcn10_hubp.o dcn10_mpc.o \ - dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_cm_common.o + dcn10_dpp_dscl.o dcn10_dpp_cm.o dcn10_cm_common.o \ + dcn10_hubbub.o AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c new file +494 -0
494 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h new file +67 -0
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +15 -475
537 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +1 -0
@@ -35,4 +35,5 @@ extern void fill_display_configs(const struct dc_state *context, struct dm_pp_display_configuration *pp_display_cfg); +#endif /* __DC_HWSS_DCN10_H__ */
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/29 drm/amd/display: Fix S3 topology change
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
Clean fake sink flag on resume if real sink connected. Fixing S3 topology change problem like this:
1) x desktop with 1 or > displays
2) unplug display
3) suspend
4) replug same display
5) resume
without this change replugged display doesn't light up
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
@@ -670,6 +670,10 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev)mutex_lock (&aconnector->hpd_lock);dc_link_detect (aconnector->dc_link,DETECT_REASON_HPD ); + +if (aconnector->fake_enable && aconnector->dc_link->local_sink) + aconnector->fake_enable = false; + aconnector->dc_sink =NULL ;amdgpu_dm_update_connector_after_detect (aconnector);mutex_unlock (&aconnector->hpd_lock);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/29 drm/amd/display: Reject PPLib clock values if they are invalid
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
We should be sticking with the default clock values if the values obtained from PPLib are bogus.
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 68 ++++++++++++++++-------- 1 file changed, 45 insertions(+), 23 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +45 -23
@@ -1231,40 +1231,62 @@ unsigned int dcn_find_dcfclk_suits_all(return dcf_clk; } +static bool verify_clock_values (struct dm_pp_clock_levels_with_voltage *clks) +{ +int i; + +if (clks->num_levels ==0 ) +return false; + +for (i =0 ; i < clks->num_levels; i++) +/* Ensure that the result is sane */ +if (clks->data[i].clocks_in_khz ==0 ) +return false; + +return true; +} +void dcn_bw_update_from_pplib (struct dc *dc) {struct dc_context *ctx = dc->ctx; -struct dm_pp_clock_levels_with_voltage clks = {0 }; +struct dm_pp_clock_levels_with_voltage fclks = {0 }, dcfclks = {0 }; +bool res;kernel_fpu_begin ();/* TODO: This is not the proper way to obtain fabric_and_dram_bandwidth, should be min(fclk, memclk) */ - -if (dm_pp_get_clock_levels_by_type_with_voltage ( - ctx,DM_PP_CLOCK_TYPE_FCLK , &clks) && - clks.num_levels !=0 ) { -ASSERT (clks.num_levels >=3 ); - dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 =32 * (clks.data[0 ].clocks_in_khz /1000.0 ) /1000.0 ; -if (clks.num_levels >2 ) { - dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->number_of_channels * - (clks.data[clks.num_levels -3 ].clocks_in_khz /1000.0 ) * ddr4_dram_factor_single_Channel /1000.0 ; - }else { - dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->number_of_channels * - (clks.data[clks.num_levels -2 ].clocks_in_khz /1000.0 ) * ddr4_dram_factor_single_Channel /1000.0 ; - } + res =dm_pp_get_clock_levels_by_type_with_voltage ( + ctx,DM_PP_CLOCK_TYPE_FCLK , &fclks); + +if (res) + res =verify_clock_values (&fclks); + +if (res) { +ASSERT (fclks.num_levels >=3 ); + dc->dcn_soc->fabric_and_dram_bandwidth_vmin0p65 =32 * (fclks.data[0 ].clocks_in_khz /1000.0 ) /1000.0 ; + dc->dcn_soc->fabric_and_dram_bandwidth_vmid0p72 = dc->dcn_soc->number_of_channels * + (fclks.data[fclks.num_levels - (fclks.num_levels >2 ?3 :2 )].clocks_in_khz /1000.0 ) + * ddr4_dram_factor_single_Channel /1000.0 ; dc->dcn_soc->fabric_and_dram_bandwidth_vnom0p8 = dc->dcn_soc->number_of_channels * - (clks.data[clks.num_levels -2 ].clocks_in_khz /1000.0 ) * ddr4_dram_factor_single_Channel /1000.0 ; + (fclks.data[fclks.num_levels -2 ].clocks_in_khz /1000.0 ) + * ddr4_dram_factor_single_Channel /1000.0 ; dc->dcn_soc->fabric_and_dram_bandwidth_vmax0p9 = dc->dcn_soc->number_of_channels * - (clks.data[clks.num_levels -1 ].clocks_in_khz /1000.0 ) * ddr4_dram_factor_single_Channel /1000.0 ; + (fclks.data[fclks.num_levels -1 ].clocks_in_khz /1000.0 ) + * ddr4_dram_factor_single_Channel /1000.0 ; }else BREAK_TO_DEBUGGER (); -if (dm_pp_get_clock_levels_by_type_with_voltage ( - ctx,DM_PP_CLOCK_TYPE_DCFCLK , &clks) && - clks.num_levels >=3 ) { - dc->dcn_soc->dcfclkv_min0p65 = clks.data[0 ].clocks_in_khz /1000.0 ; - dc->dcn_soc->dcfclkv_mid0p72 = clks.data[clks.num_levels -3 ].clocks_in_khz /1000.0 ; - dc->dcn_soc->dcfclkv_nom0p8 = clks.data[clks.num_levels -2 ].clocks_in_khz /1000.0 ; - dc->dcn_soc->dcfclkv_max0p9 = clks.data[clks.num_levels -1 ].clocks_in_khz /1000.0 ; + + res =dm_pp_get_clock_levels_by_type_with_voltage ( + ctx,DM_PP_CLOCK_TYPE_DCFCLK , &dcfclks); + +if (res) + res =verify_clock_values (&dcfclks); + +if (res && dcfclks.num_levels >=3 ) { + dc->dcn_soc->dcfclkv_min0p65 = dcfclks.data[0 ].clocks_in_khz /1000.0 ; + dc->dcn_soc->dcfclkv_mid0p72 = dcfclks.data[dcfclks.num_levels -3 ].clocks_in_khz /1000.0 ; + dc->dcn_soc->dcfclkv_nom0p8 = dcfclks.data[dcfclks.num_levels -2 ].clocks_in_khz /1000.0 ; + dc->dcn_soc->dcfclkv_max0p9 = dcfclks.data[dcfclks.num_levels -1 ].clocks_in_khz /1000.0 ; }else BREAK_TO_DEBUGGER ();
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/29 drm/amd/display: Power down front end in init_hw.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
front end is initialized during init_hw, but not power gated. There are some left over valuse and will cause some diags test failed. Power gated all front end pipes will make sure every test has same starting point.
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 172 +++++++++++---------- 1 file changed, 87 insertions(+), 85 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +87 -85
@@ -414,91 +414,6 @@ static void bios_golden_init(struct dc *dc) } } -static void dcn10_init_hw (struct dc *dc) -{ -int i; -struct abm *abm = dc->res_pool->abm; -struct dmcu *dmcu = dc->res_pool->dmcu; -struct dce_hwseq *hws = dc->hwseq; - -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { -REG_WRITE (REFCLK_CNTL ,0 ); -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); - -if (!dc->debug.disable_clock_gate) { -/* enable all DCN clock gating */ -REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); - -REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); - -REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); - } - -enable_power_gating_plane (dc->hwseq, true); -return ; - } -/* end of FPGA. Below if real ASIC */ - -bios_golden_init (dc); - -disable_vga (dc->hwseq); - -for (i =0 ; i < dc->link_count; i++) { -/* Power up AND update implementation according to the -* required signal (which may be different from the -* default signal on connector). -*/ -struct dc_link *link = dc->links[i]; - - link->link_enc->funcs->hw_init (link->link_enc); - } - -for (i =0 ; i < dc->res_pool->pipe_count; i++) { -struct dpp *dpp = dc->res_pool->dpps[i]; -struct timing_generator *tg = dc->res_pool->timing_generators[i]; - - dpp->funcs->dpp_reset (dpp); - dc->res_pool->mpc->funcs->remove ( - dc->res_pool->mpc, &(dc->res_pool->opps[i]->mpc_tree), - dc->res_pool->opps[i]->inst, i); - -/* Blank controller using driver code instead of -* command table. -*/ - tg->funcs->set_blank (tg, true); -hwss_wait_for_blank_complete (tg); - } - -for (i =0 ; i < dc->res_pool->audio_count; i++) { -struct audio *audio = dc->res_pool->audios[i]; - - audio->funcs->hw_init (audio); - } - -if (abm !=NULL ) { - abm->funcs->init_backlight (abm); - abm->funcs->abm_init (abm); - } - -if (dmcu !=NULL ) - dmcu->funcs->dmcu_init (dmcu); - -/* power AFMT HDMI memory TODO: may move to dis/en output save power*/ -REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); - -if (!dc->debug.disable_clock_gate) { -/* enable all DCN clock gating */ -REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); - -REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); - -REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); - } - -enable_power_gating_plane (dc->hwseq, true); -} - static enum dc_status dcn10_prog_pixclk_crtc_otg( struct pipe_ctx *pipe_ctx, struct dc_state *context,
@@ -784,6 +699,93 @@ static void dcn10_power_down_fe(struct dc *dc, int fe_idx)verify_allow_pstate_change_high (dc->hwseq); } +static void dcn10_init_hw (struct dc *dc) +{ +int i; +struct abm *abm = dc->res_pool->abm; +struct dmcu *dmcu = dc->res_pool->dmcu; +struct dce_hwseq *hws = dc->hwseq; + +if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { +REG_WRITE (REFCLK_CNTL ,0 ); +REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); +REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); + +if (!dc->debug.disable_clock_gate) { +/* enable all DCN clock gating */ +REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); + +REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); + +REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); + } + +enable_power_gating_plane (dc->hwseq, true); +return ; + } +/* end of FPGA. Below if real ASIC */ + +bios_golden_init (dc); + +disable_vga (dc->hwseq); + +for (i =0 ; i < dc->link_count; i++) { +/* Power up AND update implementation according to the +* required signal (which may be different from the +* default signal on connector). +*/ +struct dc_link *link = dc->links[i]; + + link->link_enc->funcs->hw_init (link->link_enc); + } + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct dpp *dpp = dc->res_pool->dpps[i]; +struct timing_generator *tg = dc->res_pool->timing_generators[i]; + + dpp->funcs->dpp_reset (dpp); + dc->res_pool->mpc->funcs->remove ( + dc->res_pool->mpc, &(dc->res_pool->opps[i]->mpc_tree), + dc->res_pool->opps[i]->inst, i); + +/* Blank controller using driver code instead of +* command table. +*/ + tg->funcs->set_blank (tg, true); +hwss_wait_for_blank_complete (tg); + +dcn10_power_down_fe (dc, i); + } + +for (i =0 ; i < dc->res_pool->audio_count; i++) { +struct audio *audio = dc->res_pool->audios[i]; + + audio->funcs->hw_init (audio); + } + +if (abm !=NULL ) { + abm->funcs->init_backlight (abm); + abm->funcs->abm_init (abm); + } + +if (dmcu !=NULL ) + dmcu->funcs->dmcu_init (dmcu); + +/* power AFMT HDMI memory TODO: may move to dis/en output save power*/ +REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); + +if (!dc->debug.disable_clock_gate) { +/* enable all DCN clock gating */ +REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); + +REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); + +REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); + } + +enable_power_gating_plane (dc->hwseq, true); +} +static void reset_hw_ctx_wrap (struct dc *dc,struct dc_state *context)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/29 drm/amd/display: Not reset front end when program back end.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
Since front end is programmed before back end programming, no need to reset front end in back end programming.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 76 ---------------------- 2 files changed, 2 insertions(+), 77 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
@@ -809,6 +809,8 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cif (!dcb->funcs->is_accelerated_mode (dcb)) dc->hwss.enable_accelerated_mode (dc); + +for (i =0 ; i < context->stream_count; i++) {const struct dc_sink *sink = context->streams[i]->sink;
@@ -889,7 +891,6 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)return (result ==DC_OK ); } -bool dc_post_update_surfaces_to_stream (struct dc *dc) {int i;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +0 -76
88 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/29 drm/amd/display: dal 3.1.08
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.07" +#define DC_VER "3.1.08"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/29 drm/amd/display: Use constants from atom.h for HDMI caps read
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
Get rid of the constant we copied over before and just directly use the constants from the file.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -3
@@ -24,6 +24,7 @@*/ #include "dm_services.h" +#include "atom.h" #include "dm_helpers.h" #include "dc.h" #include "grph_object_id.h"
@@ -45,7 +46,6 @@#include "dce/dce_11_0_enum.h" #include "dce/dce_11_0_sh_mask.h" -#define EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK 0x007C/* Copied from atombios.h */ #define LINK_INFO (...) \ dm_logger_write(dc_ctx->logger, LOG_HW_HOTPLUG, \ __VA_ARGS__)
@@ -1696,7 +1696,7 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)if (dc_is_hdmi_signal (pipe_ctx->stream->signal)) {unsigned short masked_chip_caps = pipe_ctx->stream->sink->link->chip_caps &EXT_DISPLAY_PATH_CAPS__EXT_CHIP_MASK ; -if (masked_chip_caps == (0x2 <<2 )) { +if (masked_chip_caps ==EXT_DISPLAY_PATH_CAPS__HDMI20_TISN65DP159RSBT ) {/* DP159, Retimer settings */ eng_id = pipe_ctx->stream_res.stream_enc->id;
@@ -1707,7 +1707,7 @@ static void enable_link_hdmi(struct pipe_ctx *pipe_ctx)write_i2c_default_retimer_setting (pipe_ctx, is_vga_mode, is_over_340mhz); } - }else if (masked_chip_caps == (0x1 <<2 )) { + }else if (masked_chip_caps ==EXT_DISPLAY_PATH_CAPS__HDMI20_PI3EQX1204 ) {/* PI3EQX1204, Redriver settings */ write_i2c_redriver_setting (pipe_ctx, is_over_340mhz); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/29 drm/amd/display: Added disconnect dchub.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
Add disable ttu interface to dcn10, when remove mpc, disable ttu as well.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 9 +++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++++ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 2 ++ 3 files changed, 15 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +9 -0
@@ -56,6 +56,14 @@ void hubp1_set_blank(struct hubp *hubp, bool blank) } } +static void hubp1_disconnect (struct hubp *hubp) +{ +struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp); + +REG_UPDATE (DCHUBP_CNTL , +HUBP_TTU_DISABLE ,1 ); +} +static void hubp1_set_hubp_blank_en (struct hubp *hubp,bool blank) {struct dcn10_hubp *hubp1 =TO_DCN10_HUBP (hubp);
@@ -933,6 +941,7 @@ static struct hubp_funcs dcn10_hubp_funcs = { .set_hubp_blank_en = hubp1_set_hubp_blank_en, .set_cursor_attributes = hubp1_cursor_set_attributes, .set_cursor_position = hubp1_cursor_set_position, + .hubp_disconnect = hubp1_disconnect, };/*****************************************/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +4 -0
@@ -2019,6 +2019,7 @@ static void dcn10_apply_ctx_for_surface(struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];struct pipe_ctx *old_pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i]; +struct hubp *hubp = dc->res_pool->hubps[i];if (!pipe_ctx->plane_state && !old_pipe_ctx->plane_state)continue ;
@@ -2067,6 +2068,9 @@ static void dcn10_apply_ctx_for_surface("[debug_mpo: apply_ctx disconnect pending on mpcc %d]\n", old_pipe_ctx->mpcc->inst);*/ +if (hubp->funcs->hubp_disconnect) + hubp->funcs->hubp_disconnect (hubp); +if (dc->debug.sanity_checks)verify_allow_pstate_change_high (dc->hwseq);
drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h +2 -0
@@ -100,6 +100,8 @@ struct hubp_funcs {const struct dc_cursor_position *pos, const struct dc_cursor_mi_param *param); + void (*hubp_disconnect)(struct hubp *hubp); + };#endif
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/29 drm/amd/display: dal 3.1.09
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.08" +#define DC_VER "3.1.09"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/29 drm/amd/display: fix split recout calculation
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
Recout split rounding code was wrong
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -5
@@ -580,14 +580,12 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skipif (pipe_ctx->top_pipe && pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state) {if (stream->view_format ==VIEW_3D_FORMAT_TOP_AND_BOTTOM ) { - pipe_ctx->plane_res.scl_data.recout.height /=2 ; - pipe_ctx->plane_res.scl_data.recout.y += pipe_ctx->plane_res.scl_data.recout.height;/* Floor primary pipe, ceil 2ndary pipe */ - pipe_ctx->plane_res.scl_data.recout.height += pipe_ctx->plane_res.scl_data.recout.height %2 ; + pipe_ctx->plane_res.scl_data.recout.height = (pipe_ctx->plane_res.scl_data.recout.height +1 ) /2 ; + pipe_ctx->plane_res.scl_data.recout.y += pipe_ctx->plane_res.scl_data.recout.height; }else { - pipe_ctx->plane_res.scl_data.recout.width /=2 ; + pipe_ctx->plane_res.scl_data.recout.width = (pipe_ctx->plane_res.scl_data.recout.width +1 ) /2 ; pipe_ctx->plane_res.scl_data.recout.x += pipe_ctx->plane_res.scl_data.recout.width; - pipe_ctx->plane_res.scl_data.recout.width += pipe_ctx->plane_res.scl_data.recout.width %2 ; } }else if (pipe_ctx->bottom_pipe && pipe_ctx->bottom_pipe->plane_state == pipe_ctx->plane_state) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/29 drm/amd/display: Handle as MST first and then DP dongle if sink support both
In reply to a message not in the archiveFrom: Hersen Wu <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +16 -16
@@ -480,22 +480,6 @@ static void detect_dp( sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT ;detect_dp_sink_caps (link); -/* DP active dongles */ -if (is_dp_active_dongle (link)) { - link->type = dc_connection_active_dongle; -if (!link->dpcd_caps.sink_count.bits.SINK_COUNT) { -/* -* active dongle unplug processing for short irq -*/ -link_disconnect_sink (link); -return ; - } - -if (link->dpcd_caps.dongle_type != -DISPLAY_DONGLE_DP_HDMI_CONVERTER ) { - *converter_disable_audio = true; - } - }if (is_mst_supported (link)) { sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT_MST ; link->type = dc_connection_mst_branch;
@@ -535,6 +519,22 @@ static void detect_dp( sink_caps->signal =SIGNAL_TYPE_DISPLAY_PORT ; } } + +if (link->type != dc_connection_mst_branch && +is_dp_active_dongle (link)) { +/* DP active dongles */ + link->type = dc_connection_active_dongle; +if (!link->dpcd_caps.sink_count.bits.SINK_COUNT) { +/* +* active dongle unplug processing for short irq +*/ +link_disconnect_sink (link); +return ; + } + +if (link->dpcd_caps.dongle_type !=DISPLAY_DONGLE_DP_HDMI_CONVERTER ) + *converter_disable_audio = true; + } }else {/* DP passive dongles */ sink_caps->signal = dp_passive_dongle_detection(link->ddc,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/29 drm/amd/display: create new structure for hubbub
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
instantiating new structure hubbub in resource.c
--- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 88 ++++++----- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 162 ++++++++++++++++++++- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 45 +++--- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 38 +++++ drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + 5 files changed, 269 insertions(+), 65 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +52 -36
@@ -26,21 +26,18 @@#include "dm_services.h" #include "dcn10_hubp.h" #include "dcn10_hubbub.h" -#include "dcn10_hw_sequencer.h" -#include "dce110/dce110_hw_sequencer.h" -#include "dce/dce_hwseq.h" #include "reg_helper.h" #define CTX \ - hws->ctx + hubbub->ctx#define REG (reg)\ - hws->regs->reg + hubbub->regs->reg#undef FN#define FN (reg_name, field_name) \ - hws->shifts->field_name, hws->masks->field_name + hubbub->shifts->field_name, hubbub->masks->field_name -void dcn10_hubbub_wm_read_state (struct dce_hwseq *hws, +void hubbub1_wm_read_state (struct hubbub *hubbub,struct dcn_hubbub_wm *wm) {struct dcn_hubbub_wm_set *s;
@@ -79,7 +76,7 @@ void dcn10_hubbub_wm_read_state(struct dce_hwseq *hws, }void verify_allow_pstate_change_high ( -struct dce_hwseq *hws) +struct hubbub *hubbub) {/* pstate latency is ~20us so if we wait over 40us and pstate allow * still not asserted, we are probably stuck and going to hang
@@ -139,7 +136,7 @@ void verify_allow_pstate_change_high(if (debug_data & (1 <<30 )) {if (i > pstate_wait_expected_timeout_us) -dm_logger_write (hws->ctx->logger,LOG_WARNING , +dm_logger_write (hubbub->ctx->logger,LOG_WARNING ,"pstate took longer than expected ~%dus\n" , i);
@@ -160,10 +157,10 @@ void verify_allow_pstate_change_high( forced_pstate_allow = true;if (should_log_hw_state) { -dcn10_log_hw_state (hws->ctx->dc); +dcn10_log_hw_state (hubbub->ctx->dc); } -dm_logger_write (hws->ctx->logger,LOG_WARNING , +dm_logger_write (hubbub->ctx->logger,LOG_WARNING ,"pstate TEST_DEBUG_DATA: 0x%X\n" , debug_data);BREAK_TO_DEBUGGER ();
@@ -186,11 +183,11 @@ static uint32_t convert_and_clamp(void program_watermarks ( -struct dce_hwseq *hws, +struct hubbub *hubbub,struct dcn_watermark_set *watermarks,unsigned int refclk_mhz) { -uint32_t force_en = hws->ctx->dc->debug.disable_stutter ?1 :0 ; +uint32_t force_en = hubbub->ctx->dc->debug.disable_stutter ?1 :0 ;/* * Need to clamp to max of the register values (i.e. no wrap) * for dcn1, all wm registers are 21-bit wide
@@ -206,7 +203,7 @@ void program_watermarks( refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.urgent_ns, prog_wm_value);
@@ -214,7 +211,7 @@ void program_watermarks( prog_wm_value =convert_and_clamp (watermarks->a.pte_meta_urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.pte_meta_urgent_ns, prog_wm_value);
@@ -224,7 +221,7 @@ void program_watermarks( watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_EXIT_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -234,7 +231,7 @@ void program_watermarks( watermarks->a.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n" , watermarks->a.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -244,7 +241,7 @@ void program_watermarks( watermarks->a.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_A , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_A calculated =%d\n" "HW register value = 0x%x\n\n" , watermarks->a.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -254,7 +251,7 @@ void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->b.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.urgent_ns, prog_wm_value);
@@ -264,7 +261,7 @@ void program_watermarks( watermarks->b.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.pte_meta_urgent_ns, prog_wm_value);
@@ -275,7 +272,7 @@ void program_watermarks( watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -285,7 +282,7 @@ void program_watermarks( watermarks->b.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_B calculated =%d\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -295,7 +292,7 @@ void program_watermarks( watermarks->b.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_B , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_B calculated =%d\n\n" "HW register value = 0x%x\n" , watermarks->b.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -304,7 +301,7 @@ void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->c.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.urgent_ns, prog_wm_value);
@@ -314,7 +311,7 @@ void program_watermarks( watermarks->c.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.pte_meta_urgent_ns, prog_wm_value);
@@ -325,7 +322,7 @@ void program_watermarks( watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -335,7 +332,7 @@ void program_watermarks( watermarks->c.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_C calculated =%d\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -345,7 +342,7 @@ void program_watermarks( watermarks->c.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_C , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_C calculated =%d\n\n" "HW register value = 0x%x\n" , watermarks->c.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -354,7 +351,7 @@ void program_watermarks( prog_wm_value =convert_and_clamp ( watermarks->d.urgent_ns, refclk_mhz,0x1fffff );REG_WRITE (DCHUBBUB_ARB_DATA_URGENCY_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"URGENCY_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.urgent_ns, prog_wm_value);
@@ -363,7 +360,7 @@ void program_watermarks( watermarks->d.pte_meta_urgent_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_PTE_META_URGENCY_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"PTE_META_URGENCY_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.pte_meta_urgent_ns, prog_wm_value);
@@ -374,7 +371,7 @@ void program_watermarks( watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_ENTER_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.cstate_pstate.cstate_enter_plus_exit_ns, prog_wm_value);
@@ -384,7 +381,7 @@ void program_watermarks( watermarks->d.cstate_pstate.cstate_exit_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"SR_EXIT_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n" , watermarks->d.cstate_pstate.cstate_exit_ns, prog_wm_value);
@@ -395,7 +392,7 @@ void program_watermarks( watermarks->d.cstate_pstate.pstate_change_ns, refclk_mhz, 0x1fffff);REG_WRITE (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D , prog_wm_value); -dm_logger_write (hws->ctx->logger,LOG_BANDWIDTH_CALCS , +dm_logger_write (hubbub->ctx->logger,LOG_BANDWIDTH_CALCS ,"DRAM_CLK_CHANGE_WATERMARK_D calculated =%d\n" "HW register value = 0x%x\n\n" , watermarks->d.cstate_pstate.pstate_change_ns, prog_wm_value);
@@ -419,8 +416,8 @@ void program_watermarks(#endif } -void dcn10_update_dchub ( -struct dce_hwseq *hws, +void hubbub1_update_dchub ( +struct hubbub *hubbub,struct dchub_init_data *dh_data) {/* TODO: port code from dal2 */
@@ -475,7 +472,7 @@ void dcn10_update_dchub( dh_data->dchub_info_valid = false; } -void toggle_watermark_change_req (struct dce_hwseq *hws) +void toggle_watermark_change_req (struct hubbub *hubbub) {uint32_t watermark_change_req;
@@ -491,4 +488,23 @@ void toggle_watermark_change_req(struct dce_hwseq *hws) DCHUBBUB_ARB_WATERMARK_CHANGE_REQUEST, watermark_change_req); } +static const struct hubbub_funcs hubbub1_funcs = { + .update_dchub = hubbub1_update_dchub +}; + +void hubbub1_construct (struct hubbub *hubbub, +struct dc_context *ctx, +const struct dcn_hubbub_registers *hubbub_regs, +const struct dcn_hubbub_shift *hubbub_shift, +const struct dcn_hubbub_mask *hubbub_mask) +{ + hubbub->ctx = ctx; + + hubbub->funcs = &hubbub1_funcs; + + hubbub->regs = hubbub_regs; + hubbub->shifts = hubbub_shift; + hubbub->masks = hubbub_mask; + +}
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +156 -6
187 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +22 -23
176 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +38 -0
@@ -48,6 +48,7 @@#include "dce110/dce110_resource.h" #include "dce112/dce112_resource.h" #include "dcn10_hubp.h" +#include "dcn10_hubbub.h" #include "vega10/soc15ip.h"
@@ -388,6 +389,19 @@ static const struct dcn_mi_mask hubp_mask = {HUBP_MASK_SH_LIST_DCN10 (_MASK) }; + +static const struct dcn_hubbub_registers hubbub_reg = { +HUBBUB_REG_LIST_DCN10 (0 ) +}; + +static const struct dcn_hubbub_shift hubbub_shift = { +HUBBUB_MASK_SH_LIST_DCN10 (__SHIFT) +}; + +static const struct dcn_hubbub_mask hubbub_mask = { +HUBBUB_MASK_SH_LIST_DCN10 (_MASK) +}; +#define clk_src_regs (index, pllid)\ [index] = {\ CS_COMMON_REG_LIST_DCN1_0(index, pllid),\
@@ -519,6 +533,22 @@ static struct mpc *dcn10_mpc_create(struct dc_context *ctx)return &mpc10->base; } +static struct hubbub *dcn10_hubbub_create (struct dc_context *ctx) +{ +struct hubbub *hubbub =kzalloc (sizeof (struct hubbub ), +GFP_KERNEL ); + +if (!hubbub) +return NULL ; + +hubbub1_construct (hubbub, ctx, + &hubbub_reg, + &hubbub_shift, + &hubbub_mask); + +return hubbub; +} +static struct timing_generator *dcn10_timing_generator_create (struct dc_context *ctx,uint32_t instance)
@@ -1401,6 +1431,7 @@ static bool construct(dm_error ("DC: failed to create tg!\n" ); goto fail; } +/* check next valid pipe */ j++; }
@@ -1421,6 +1452,13 @@ static bool construct( goto fail; } + pool->base.hubbub =dcn10_hubbub_create (ctx); +if (pool->base.mpc ==NULL ) { +BREAK_TO_DEBUGGER (); +dm_error ("DC: failed to create mpc!\n" ); + goto fail; + } +if (!resource_construct (num_virtual_links, dc, &pool->base, (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? &res_create_funcs : &res_create_maximus_funcs)))
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -0
@@ -139,6 +139,7 @@ struct resource_pool {struct timing_generator *timing_generators[MAX_PIPES ];struct stream_encoder *stream_enc[MAX_PIPES *2 ]; +struct hubbub *hubbub;struct mpc *mpc;struct pp_smu_funcs_rv *pp_smu;struct pp_smu_display_requirement_rv pp_smu_req;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/29 drm/amd/display: Apply VQ adjustments in MPO case
In reply to a message not in the archiveFrom: SivapiriyanKumarasamy <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +- drivers/gpu/drm/amd/display/dc/dc.h | 7 ++ drivers/gpu/drm/amd/display/dc/dc_types.h | 5 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 31 +++++++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 47 ++++++++++---- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 44 ++++++++++--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 75 +++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 10 ++- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 14 ++++ drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 6 +- 11 files changed, 211 insertions(+), 38 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -1090,6 +1090,7 @@ static enum surface_update_type get_plane_info_update_type( temp_plane_info.plane_size = u->surface->plane_size; temp_plane_info.rotation = u->surface->rotation; temp_plane_info.stereo_format = u->surface->stereo_format; + temp_plane_info.input_csc_enabled = u->surface->input_csc_color_matrix.enable_adjustment;if (surface_index ==0 ) temp_plane_info.visible = u->plane_info->visible;
@@ -1170,7 +1171,8 @@ static enum surface_update_type det_surface_update( overall_type = type;if (u->in_transfer_func || - u->hdr_static_metadata) { + u->hdr_static_metadata || + u->input_csc_color_matrix) {if (overall_type <UPDATE_TYPE_MED ) overall_type =UPDATE_TYPE_MED ; }
drivers/gpu/drm/amd/display/dc/dc.h +7 -0
@@ -431,6 +431,9 @@ struct dc_plane_state {struct dc_gamma *gamma_correction;struct dc_transfer_func *in_transfer_func; +struct dc_bias_and_scale *bias_and_scale; +struct csc_transform input_csc_color_matrix; +struct fixed31_32 coeff_reduction_factor;// sourceContentAttribute cache bool is_source_input_valid;
@@ -468,6 +471,7 @@ struct dc_plane_info {bool horizontal_mirror;bool visible;bool per_pixel_alpha; +bool input_csc_enabled; };struct dc_scaling_info {
@@ -491,6 +495,9 @@ struct dc_surface_update {struct dc_gamma *gamma;struct dc_transfer_func *in_transfer_func;struct dc_hdr_static_metadata *hdr_static_metadata; + +struct csc_transform *input_csc_color_matrix; +struct fixed31_32 *coeff_reduction_factor; };/*
drivers/gpu/drm/amd/display/dc/dc_types.h +0 -5
@@ -638,11 +638,6 @@ struct colorspace_transform {bool enable_remap; }; -struct csc_transform { -uint16_t matrix[12 ]; -bool enable_adjustment; -}; -enum i2c_mot_mode {I2C_MOT_UNDEF ,I2C_MOT_TRUE ,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +26 -5
@@ -264,8 +264,10 @@ static void dpp1_set_degamma_format_float(void dpp1_cnv_setup (struct dpp *dpp_base, -enum surface_pixel_format input_format, -enum expansion_mode mode) +enum surface_pixel_format format, +enum expansion_mode mode, +struct csc_transform input_csc_color_matrix, +enum dc_color_space input_color_space) {uint32_t pixel_format;uint32_t alpha_en;
@@ -275,8 +277,10 @@ void dpp1_cnv_setup (bool is_float;struct dcn10_dpp *dpp =TO_DCN10_DPP (dpp_base);bool force_disable_cursor = false; +struct out_csc_color_matrix tbl_entry; +int i =0 ; -dpp1_setup_format_flags (input_format, &fmt); +dpp1_setup_format_flags (format, &fmt); alpha_en =1 ; pixel_format =0 ; color_space =COLOR_SPACE_SRGB ;
@@ -306,7 +310,7 @@ void dpp1_cnv_setup (dpp1_set_degamma_format_float (dpp_base, is_float); -switch (input_format) { +switch (format) {case SURFACE_PIXEL_FORMAT_GRPH_ARGB1555 : pixel_format =1 ;break ;
@@ -362,7 +366,23 @@ void dpp1_cnv_setup ( CNVC_SURFACE_PIXEL_FORMAT, pixel_format);REG_UPDATE (FORMAT_CONTROL ,FORMAT_CONTROL__ALPHA_EN , alpha_en); -dpp1_program_input_csc (dpp_base, color_space, select); +// if input adjustments exist, program icsc with those values + +if (input_csc_color_matrix.enable_adjustment + == true) { +for (i =0 ; i <12 ; i++) + tbl_entry.regval[i] = input_csc_color_matrix.matrix[i]; + + tbl_entry.color_space = input_color_space; + +if (color_space >=COLOR_SPACE_YCBCR601 ) + select =INPUT_CSC_SELECT_ICSC ; +else + select =INPUT_CSC_SELECT_BYPASS ; + +dpp1_program_input_csc (dpp_base, color_space, select, &tbl_entry); + }else +dpp1_program_input_csc (dpp_base, color_space, select,NULL );if (force_disable_cursor) { REG_UPDATE(CURSOR_CONTROL,
@@ -435,6 +455,7 @@ static const struct dpp_funcs dcn10_dpp_funcs = { .opp_program_regamma_luta_settings = dpp1_cm_program_regamma_luta_settings, .opp_program_regamma_pwl = dpp1_cm_set_regamma_pwl, .opp_set_regamma_mode = dpp1_cm_set_regamma_mode, + .ipp_program_bias_and_scale = dpp1_program_bias_and_scale, .ipp_set_degamma = dpp1_set_degamma, .ipp_program_input_lut = dpp1_program_input_lut, .ipp_program_degamma_pwl = dpp1_set_degamma_pwl,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +36 -11
95 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +35 -9
63 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +74 -1
107 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +8 -2
@@ -98,6 +98,10 @@ struct dpp_funcs {struct dpp *dpp_base, enum opp_regamma mode); +void (*ipp_program_bias_and_scale)( +struct dpp *dpp, +struct dc_bias_and_scale *params); +void (*ipp_set_degamma)(struct dpp *dpp_base,enum ipp_degamma_mode mode);
@@ -111,8 +115,10 @@ struct dpp_funcs {void (*ipp_setup)(struct dpp *dpp_base, -enum surface_pixel_format input_format, -enum expansion_mode mode); +enum surface_pixel_format format, +enum expansion_mode mode, +struct csc_transform input_csc_color_matrix, +enum dc_color_space input_color_space);void (*ipp_full_bypass)(struct dpp *dpp_base);
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +14 -0
@@ -138,4 +138,18 @@ enum opp_regamma {OPP_REGAMMA_USER }; +struct csc_transform { +uint16_t matrix[12 ]; +bool enable_adjustment; +}; + +struct dc_bias_and_scale { +uint16_t scale_red; +uint16_t bias_red; +uint16_t scale_green; +uint16_t bias_green; +uint16_t scale_blue; +uint16_t bias_blue; +}; +#endif /* __DAL_HW_SHARED_H__ */
drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h +4 -2
@@ -85,8 +85,10 @@ struct ipp_funcs {/* setup ipp to expand/convert input to pixel processor internal format */ void (*ipp_setup)(struct input_pixel_processor *ipp, -enum surface_pixel_format input_format, -enum expansion_mode mode); +enum surface_pixel_format format, +enum expansion_mode mode, +struct csc_transform input_csc_color_matrix, +enum dc_color_space input_color_space);/* DCE function to setup IPP. TODO: see if we can consolidate to setup */ void (*ipp_program_prescale)(
drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +4 -2
@@ -250,8 +250,10 @@ struct transform_funcs {void (*ipp_setup)(struct transform *xfm_base, -enum surface_pixel_format input_format, -enum expansion_mode mode); +enum surface_pixel_format format, +enum expansion_mode mode, +struct csc_transform input_csc_color_matrix, +enum dc_color_space input_color_space);void (*ipp_full_bypass)(struct transform *xfm_base);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/29 drm/amd/display: Move hdr_metadata from plane to stream
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
Need to move HDR Metadata from Surface to Stream since there is only one infoframe possible per stream.
Also cleaning up some duplicate definitions.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 19 +++++++--- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 4 +++ drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 41 +++++++++------------- drivers/gpu/drm/amd/display/dc/dc.h | 35 +++++------------- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 9 +++++ .../drm/amd/display/dc/dce/dce_stream_encoder.c | 11 +++++- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 +- 8 files changed, 65 insertions(+), 60 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +15 -4
@@ -960,6 +960,7 @@ bool dc_commit_planes_to_stream( flip_addr[i].address = plane_states[i]->address; flip_addr[i].flip_immediate = plane_states[i]->flip_immediate; plane_info[i].color_space = plane_states[i]->color_space; + plane_info[i].input_tf = plane_states[i]->input_tf; plane_info[i].format = plane_states[i]->format; plane_info[i].plane_size = plane_states[i]->plane_size; plane_info[i].rotation = plane_states[i]->rotation;
@@ -1085,12 +1086,12 @@ static enum surface_update_type get_plane_info_update_type(/* Full update parameters */ temp_plane_info.color_space = u->surface->color_space; + temp_plane_info.input_tf = u->surface->input_tf; temp_plane_info.dcc = u->surface->dcc; temp_plane_info.horizontal_mirror = u->surface->horizontal_mirror; temp_plane_info.plane_size = u->surface->plane_size; temp_plane_info.rotation = u->surface->rotation; temp_plane_info.stereo_format = u->surface->stereo_format; - temp_plane_info.input_csc_enabled = u->surface->input_csc_color_matrix.enable_adjustment;if (surface_index ==0 ) temp_plane_info.visible = u->plane_info->visible;
@@ -1171,7 +1172,6 @@ static enum surface_update_type det_surface_update( overall_type = type;if (u->in_transfer_func || - u->hdr_static_metadata || u->input_csc_color_matrix) {if (overall_type <UPDATE_TYPE_MED ) overall_type =UPDATE_TYPE_MED ;
@@ -1303,14 +1303,25 @@ static void commit_planes_for_stream(struct dc *dc, pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state)) dc->hwss.set_input_transfer_func( pipe_ctx, pipe_ctx->plane_state); + } + } + +if (update_type >UPDATE_TYPE_FAST ) { +for (j =0 ; j < dc->res_pool->pipe_count; j++) { +struct pipe_ctx *pipe_ctx = + &context->res_ctx.pipe_ctx[j]; + +if (!pipe_ctx->stream) +continue ;if (stream_update !=NULL && - stream_update->out_transfer_func !=NULL ) { + stream_update->out_transfer_func !=NULL ) { dc->hwss.set_output_transfer_func ( pipe_ctx, pipe_ctx->stream); } -if (srf_updates[i].hdr_static_metadata) { +if (stream_update !=NULL && + stream_update->hdr_static_metadata) {resource_build_info_frame (pipe_ctx); dc->hwss.update_info_frame (pipe_ctx); }
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +4 -0
@@ -137,6 +137,7 @@ void pre_surface_trace("plane_state->tiling_info.gfx8.pipe_config = %d;\n" "plane_state->tiling_info.gfx8.array_mode = %d;\n" "plane_state->color_space = %d;\n" +"plane_state->input_tf = %d;\n" "plane_state->dcc.enable = %d;\n" "plane_state->format = %d;\n" "plane_state->rotation = %d;\n"
@@ -144,6 +145,7 @@ void pre_surface_trace( plane_state->tiling_info.gfx8.pipe_config, plane_state->tiling_info.gfx8.array_mode, plane_state->color_space, + plane_state->input_tf, plane_state->dcc.enable, plane_state->format, plane_state->rotation,
@@ -184,6 +186,7 @@ void update_surface_trace(if (update->plane_info) {SURFACE_TRACE ("plane_info->color_space = %d;\n" +"plane_info->input_tf = %d;\n" "plane_info->format = %d;\n" "plane_info->plane_size.grph.surface_pitch = %d;\n" "plane_info->plane_size.grph.surface_size.height = %d;\n"
@@ -192,6 +195,7 @@ void update_surface_trace("plane_info->plane_size.grph.surface_size.y = %d;\n" "plane_info->rotation = %d;\n" , update->plane_info->color_space, + update->plane_info->input_tf, update->plane_info->format, update->plane_info->plane_size.grph.surface_pitch, update->plane_info->plane_size.grph.surface_size.height,
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +16 -25
107 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc.h +9 -26
@@ -334,24 +334,6 @@ enum color_transfer_func {transfer_func_gamma_26 }; -enum color_color_space { - color_space_unsupported, - color_space_srgb, - color_space_bt601, - color_space_bt709, - color_space_xv_ycc_bt601, - color_space_xv_ycc_bt709, - color_space_xr_rgb, - color_space_bt2020, - color_space_adobe, - color_space_dci_p3, - color_space_sc_rgb_ms_ref, - color_space_display_native, - color_space_app_ctrl, - color_space_dolby_vision, - color_space_custom_coordinates -}; -struct dc_hdr_static_metadata {/* display chromaticities and white point in units of 0.00001 */ unsigned int chromaticity_green_x;
@@ -427,7 +409,6 @@ struct dc_plane_state {union dc_tiling_info tiling_info;struct dc_plane_dcc_param dcc; -struct dc_hdr_static_metadata hdr_static_ctx;struct dc_gamma *gamma_correction;struct dc_transfer_func *in_transfer_func;
@@ -435,13 +416,12 @@ struct dc_plane_state {struct csc_transform input_csc_color_matrix;struct fixed31_32 coeff_reduction_factor; -// sourceContentAttribute cache -bool is_source_input_valid; -struct dc_hdr_static_metadata source_input_mastering_info; -enum color_color_space source_input_color_space; -enum color_transfer_func source_input_tf; +// TODO: No longer used, remove +struct dc_hdr_static_metadata hdr_static_ctx;enum dc_color_space color_space; +enum color_transfer_func input_tf; +enum surface_pixel_format format;enum dc_rotation_angle rotation;enum plane_stereo_format stereo_format;
@@ -467,7 +447,8 @@ struct dc_plane_info {enum surface_pixel_format format;enum dc_rotation_angle rotation;enum plane_stereo_format stereo_format; -enum dc_color_space color_space;/*todo: wrong place, fits in scaling info*/ +enum dc_color_space color_space; +enum color_transfer_func input_tf;bool horizontal_mirror;bool visible;bool per_pixel_alpha;
@@ -488,13 +469,13 @@ struct dc_surface_update {struct dc_flip_addrs *flip_addr;struct dc_plane_info *plane_info;struct dc_scaling_info *scaling_info; +/* following updates require alloc/sleep/spin that is not isr safe, * null means no updates */ /* gamma TO BE REMOVED */ struct dc_gamma *gamma;struct dc_transfer_func *in_transfer_func; -struct dc_hdr_static_metadata *hdr_static_metadata;struct csc_transform *input_csc_color_matrix;struct fixed31_32 *coeff_reduction_factor;
@@ -591,6 +572,7 @@ struct dc_stream_state {struct freesync_context freesync_ctx; +struct dc_hdr_static_metadata hdr_static_metadata;struct dc_transfer_func *out_transfer_func;struct colorspace_transform gamut_remap_matrix;struct csc_transform csc_color_matrix;
@@ -631,6 +613,7 @@ struct dc_stream_update {struct rect src;struct rect dst;struct dc_transfer_func *out_transfer_func; +struct dc_hdr_static_metadata *hdr_static_metadata; }; bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +9 -0
@@ -492,15 +492,24 @@ struct dc_cursor_attributes {enum dc_color_space {COLOR_SPACE_UNKNOWN ,COLOR_SPACE_SRGB , +COLOR_SPACE_XR_RGB ,COLOR_SPACE_SRGB_LIMITED , +COLOR_SPACE_MSREF_SCRGB ,COLOR_SPACE_YCBCR601 ,COLOR_SPACE_YCBCR709 , +COLOR_SPACE_XV_YCC_709 , +COLOR_SPACE_XV_YCC_601 ,COLOR_SPACE_YCBCR601_LIMITED ,COLOR_SPACE_YCBCR709_LIMITED ,COLOR_SPACE_2020_RGB_FULLRANGE ,COLOR_SPACE_2020_RGB_LIMITEDRANGE ,COLOR_SPACE_2020_YCBCR ,COLOR_SPACE_ADOBERGB , +COLOR_SPACE_DCIP3 , +COLOR_SPACE_DISPLAYNATIVE , +COLOR_SPACE_DOLBYVISION , +COLOR_SPACE_APPCTRL , +COLOR_SPACE_CUSTOMPOINTS , };enum dc_dither_option {
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +10 -1
@@ -434,10 +434,19 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE :case COLOR_SPACE_2020_YCBCR : +case COLOR_SPACE_XR_RGB : +case COLOR_SPACE_MSREF_SCRGB :case COLOR_SPACE_ADOBERGB : -case COLOR_SPACE_UNKNOWN : +case COLOR_SPACE_DCIP3 : +case COLOR_SPACE_XV_YCC_709 : +case COLOR_SPACE_XV_YCC_601 :case COLOR_SPACE_YCBCR601_LIMITED :case COLOR_SPACE_YCBCR709_LIMITED : +case COLOR_SPACE_DISPLAYNATIVE : +case COLOR_SPACE_DOLBYVISION : +case COLOR_SPACE_APPCTRL : +case COLOR_SPACE_CUSTOMPOINTS : +case COLOR_SPACE_UNKNOWN :/* do nothing */ break ; }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -2
@@ -2277,8 +2277,7 @@ static void set_plane_config(dce_enable_fe_clock (dc->hwseq, pipe_ctx->pipe_idx, true);set_default_colors (pipe_ctx); -if (pipe_ctx->stream->csc_color_matrix.enable_adjustment - == true) { +if (pipe_ctx->stream->csc_color_matrix.enable_adjustment == true) { tbl_entry.color_space = pipe_ctx->stream->output_color_space;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -2
@@ -1556,8 +1556,7 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx,int i;struct out_csc_color_matrix tbl_entry; -if (pipe_ctx->stream->csc_color_matrix.enable_adjustment - == true) { +if (pipe_ctx->stream->csc_color_matrix.enable_adjustment == true) {enum dc_color_space color_space = pipe_ctx->stream->output_color_space;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/29 drm/amd/display: fix bug from last commit for hubbub
In reply to a message not in the archiveFrom: Yue Hin Lau <[email protected]>
fix memory leak
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +7 -1
@@ -730,6 +730,12 @@ static void destruct(struct dcn10_resource_pool *pool)kfree (TO_DCN10_MPC (pool->base.mpc)); pool->base.mpc =NULL ; } + +if (pool->base.hubbub !=NULL ) { +kfree (pool->base.hubbub); + pool->base.hubbub =NULL ; + } +for (i =0 ; i < pool->base.pipe_count; i++) {if (pool->base.opps[i] !=NULL ) pool->base.opps[i]->funcs->opp_destroy (&pool->base.opps[i]);
@@ -1453,7 +1459,7 @@ static bool construct( } pool->base.hubbub =dcn10_hubbub_create (ctx); -if (pool->base.mpc ==NULL ) { +if (pool->base.hubbub ==NULL ) {BREAK_TO_DEBUGGER ();dm_error ("DC: failed to create mpc!\n" ); goto fail;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/29 drm/amd/display: Don't reject 3D timings
In reply to a message not in the archiveFrom: Andrew Jiang <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c +0 -3
@@ -499,9 +499,6 @@ static bool tgn10_validate_timing( timing->timing_3d_format != TIMING_3D_FORMAT_INBAND_FA)return false; -if (timing->timing_3d_format !=TIMING_3D_FORMAT_NONE && - tg->ctx->dc->debug.disable_stereo_support) -return false;/* Temporarily blocking interlacing mode until it's supported */ if (timing->flags.INTERLACE ==1 )return false;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/29 drm/amd/display: fix split recout offset
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
Previous recout calculation fix changed recout size rounding and affected the offset when it should not have
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -2
@@ -580,12 +580,12 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skipif (pipe_ctx->top_pipe && pipe_ctx->top_pipe->plane_state == pipe_ctx->plane_state) {if (stream->view_format ==VIEW_3D_FORMAT_TOP_AND_BOTTOM ) { + pipe_ctx->plane_res.scl_data.recout.y += pipe_ctx->plane_res.scl_data.recout.height /2 ;/* Floor primary pipe, ceil 2ndary pipe */ pipe_ctx->plane_res.scl_data.recout.height = (pipe_ctx->plane_res.scl_data.recout.height +1 ) /2 ; - pipe_ctx->plane_res.scl_data.recout.y += pipe_ctx->plane_res.scl_data.recout.height; }else { + pipe_ctx->plane_res.scl_data.recout.x += pipe_ctx->plane_res.scl_data.recout.width /2 ; pipe_ctx->plane_res.scl_data.recout.width = (pipe_ctx->plane_res.scl_data.recout.width +1 ) /2 ; - pipe_ctx->plane_res.scl_data.recout.x += pipe_ctx->plane_res.scl_data.recout.width; } }else if (pipe_ctx->bottom_pipe && pipe_ctx->bottom_pipe->plane_state == pipe_ctx->plane_state) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/29 drm/amd/display: correct DP is always in full range or bt609
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
--- .../drm/amd/display/dc/dce/dce_stream_encoder.c | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +17 -8
@@ -297,6 +297,8 @@ static void dce110_stream_encoder_dp_set_stream_attribute(uint32_t h_back_porch;uint8_t synchronous_clock =0 ;/* asynchronous mode */ uint8_t colorimetry_bpc; +uint8_t dynamic_range_rgb =0 ;/*full range*/ +uint8_t dynamic_range_ycbcr =1 ;/*bt709*/ #endif struct dce110_stream_encoder *enc110 =DCE110STRENC_FROM_STRENC (enc);
@@ -377,11 +379,7 @@ static void dce110_stream_encoder_dp_set_stream_attribute( }/* set dynamic range and YCbCr range */ -if (enc110->se_mask->DP_DYN_RANGE && enc110->se_mask->DP_YCBCR_RANGE) -REG_UPDATE_2 ( -DP_PIXEL_FORMAT , -DP_DYN_RANGE ,0 , -DP_YCBCR_RANGE ,0 ); +#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )switch (crtc_timing->display_color_depth) {
@@ -410,29 +408,37 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_SRGB : misc0 = misc0 |0x0 ; misc1 = misc1 & ~0x80 ;/* bit7 = 0*/ + dynamic_range_rgb =0 ;/*full range*/ break ;case COLOR_SPACE_SRGB_LIMITED : misc0 = misc0 |0x8 ;/* bit3=1 */ misc1 = misc1 & ~0x80 ;/* bit7 = 0*/ + dynamic_range_rgb =1 ;/*limited range*/ break ;case COLOR_SPACE_YCBCR601 : +case COLOR_SPACE_YCBCR601_LIMITED : misc0 = misc0 |0x8 ;/* bit3=1, bit4=0 */ misc1 = misc1 & ~0x80 ;/* bit7 = 0*/ + dynamic_range_ycbcr =0 ;/*bt601*/ if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) misc0 = misc0 |0x2 ;/* bit2=0, bit1=1 */ else if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR444 ) misc0 = misc0 |0x4 ;/* bit2=1, bit1=0 */ break ;case COLOR_SPACE_YCBCR709 : +case COLOR_SPACE_YCBCR709_LIMITED : misc0 = misc0 |0x18 ;/* bit3=1, bit4=1 */ misc1 = misc1 & ~0x80 ;/* bit7 = 0*/ + dynamic_range_ycbcr =1 ;/*bt709*/ if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR422 ) misc0 = misc0 |0x2 ;/* bit2=0, bit1=1 */ else if (crtc_timing->pixel_encoding ==PIXEL_ENCODING_YCBCR444 ) misc0 = misc0 |0x4 ;/* bit2=1, bit1=0 */ break ; -case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_RGB_LIMITEDRANGE : + dynamic_range_rgb =1 ;/*limited range*/ +break ; +case COLOR_SPACE_2020_RGB_FULLRANGE :case COLOR_SPACE_2020_YCBCR :case COLOR_SPACE_XR_RGB :case COLOR_SPACE_MSREF_SCRGB :
@@ -440,8 +446,6 @@ static void dce110_stream_encoder_dp_set_stream_attribute(case COLOR_SPACE_DCIP3 :case COLOR_SPACE_XV_YCC_709 :case COLOR_SPACE_XV_YCC_601 : -case COLOR_SPACE_YCBCR601_LIMITED : -case COLOR_SPACE_YCBCR709_LIMITED :case COLOR_SPACE_DISPLAYNATIVE :case COLOR_SPACE_DOLBYVISION :case COLOR_SPACE_APPCTRL :
@@ -450,6 +454,11 @@ static void dce110_stream_encoder_dp_set_stream_attribute(/* do nothing */ break ; } +if (enc110->se_mask->DP_DYN_RANGE && enc110->se_mask->DP_YCBCR_RANGE) +REG_UPDATE_2 ( +DP_PIXEL_FORMAT , +DP_DYN_RANGE , dynamic_range_rgb, +DP_YCBCR_RANGE , dynamic_range_ycbcr);#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )if (REG (DP_MSA_COLORIMETRY ))
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/29 drm/amd/display: dal 3.1.10
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.09" +#define DC_VER "3.1.10"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/29 drm/amd/display: Move conn_state to header
In reply to a message not in the archiveWe'll need it in amdgpu_dm_mst_types.c as well.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ------------- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -13
@@ -1654,19 +1654,6 @@ static int dm_early_init(void *handle)return 0 ; } -struct dm_connector_state { -struct drm_connector_state base; - -enum amdgpu_rmx_type scaling; -uint8_t underscan_vborder; -uint8_t underscan_hborder; -bool underscan_enable; -struct mod_freesync_user_enable user_enable; -}; - -#define to_dm_connector_state (x)\ - container_of((x), struct dm_connector_state, base) -static bool modeset_required (struct drm_crtc_state *crtc_state,struct dc_stream_state *new_stream,struct dc_stream_state *old_stream)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +12 -0
@@ -222,6 +222,18 @@ struct dm_atomic_state {#define to_dm_atomic_state (x) container_of(x, struct dm_atomic_state, base) +struct dm_connector_state { +struct drm_connector_state base; + +enum amdgpu_rmx_type scaling; +uint8_t underscan_vborder; +uint8_t underscan_hborder; +bool underscan_enable; +struct mod_freesync_user_enable user_enable; +}; + +#define to_dm_connector_state (x)\ + container_of((x), struct dm_connector_state, base)void amdgpu_dm_connector_funcs_reset (struct drm_connector *connector); struct drm_connector_state *
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/29 drm/amd/display: Use plane pointer to avoid line breaks
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -4
@@ -1331,13 +1331,16 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) }for (i =0 ; i < dm->dc->caps.max_planes; i++) { - mode_info->planes[i] =kzalloc (sizeof (struct amdgpu_plane ), -GFP_KERNEL ); -if (!mode_info->planes[i]) { +struct amdgpu_plane *plane; + + plane =kzalloc (sizeof (struct amdgpu_plane ),GFP_KERNEL ); + mode_info->planes[i] = plane; + +if (!plane) {DRM_ERROR ("KMS: Failed to allocate plane\n" ); goto fail_free_planes; } - mode_info->planes[i]->base.type = mode_info->plane_type[i]; + plane->base.type = mode_info->plane_type[i];/* * HACK: IGT tests expect that each plane can only have one
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/29 drm/amd/display: Use single fail label in init_drm_dev
In reply to a message not in the archiveNo need for multiple labels as kfree will always do a NULL check before freeing the memory.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 24 +++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -13
@@ -1338,7 +1338,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)if (!plane) {DRM_ERROR ("KMS: Failed to allocate plane\n" ); - goto fail_free_planes; + goto fail; } plane->base.type = mode_info->plane_type[i];
@@ -1354,14 +1354,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)if (amdgpu_dm_plane_init (dm, mode_info->planes[i], possible_crtcs)) {DRM_ERROR ("KMS: Failed to initialize plane\n" ); - goto fail_free_planes; + goto fail; } }for (i =0 ; i < dm->dc->caps.max_streams; i++)if (amdgpu_dm_crtc_init (dm, &mode_info->planes[i]->base, i)) {DRM_ERROR ("KMS: Failed to initialize crtc\n" ); - goto fail_free_planes; + goto fail; } dm->display_indexes_num = dm->dc->caps.max_streams;
@@ -1378,20 +1378,20 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) aconnector =kzalloc (sizeof (*aconnector),GFP_KERNEL );if (!aconnector) - goto fail_free_planes; + goto fail; aencoder =kzalloc (sizeof (*aencoder),GFP_KERNEL );if (!aencoder) - goto fail_free_connector; + goto fail;if (amdgpu_dm_encoder_init (dm->ddev, aencoder, i)) {DRM_ERROR ("KMS: Failed to initialize encoder\n" ); - goto fail_free_encoder; + goto fail; }if (amdgpu_dm_connector_init (dm, aconnector, i, aencoder)) {DRM_ERROR ("KMS: Failed to initialize connector\n" ); - goto fail_free_encoder; + goto fail; } if (dc_link_detect(dc_get_link_at_index(dm->dc, i),
@@ -1416,14 +1416,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)case CHIP_VEGA10 :if (dce110_register_irq_handlers (dm->adev)) {DRM_ERROR ("DM: Failed to initialize IRQ\n" ); - goto fail_free_encoder; + goto fail; }break ;#if defined(CONFIG_DRM_AMD_DC_DCN1_0 )case CHIP_RAVEN :if (dcn10_register_irq_handlers (dm->adev)) {DRM_ERROR ("DM: Failed to initialize IRQ\n" ); - goto fail_free_encoder; + goto fail; }/* * Temporary disable until pplib/smu interaction is implemented
@@ -1433,17 +1433,15 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)#endif default :DRM_ERROR ("Usupported ASIC type: 0x%X\n" , adev->asic_type); - goto fail_free_encoder; + goto fail; }drm_mode_config_reset (dm->ddev);return 0 ; -fail_free_encoder: +fail:kfree (aencoder); -fail_free_connector:kfree (aconnector); -fail_free_planes:for (i =0 ; i < dm->dc->caps.max_planes; i++)kfree (mode_info->planes[i]);return -1 ;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/29 drm/amd/display: Explicitly call ->reset for each object
In reply to a message not in the archiveWe need to avoid calling reset after detection. This is much simpler if we call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +12 -2
@@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } -drm_mode_config_reset (dm->ddev); -return 0 ; fail:kfree (aencoder);
@@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,drm_plane_helper_add (&aplane->base, &dm_plane_helper_funcs); +/* Create (reset) the plane state */ +if (aplane->base.funcs->reset) + aplane->base.funcs->reset (&aplane->base); + +return res; }
@@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,drm_crtc_helper_add (&acrtc->base, &amdgpu_dm_crtc_helper_funcs); +/* Create (reset) the plane state */ +if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset (&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
@@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, &aconnector->base, &amdgpu_dm_connector_helper_funcs); +if (aconnector->base.funcs->reset) + aconnector->base.funcs->reset (&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,
Signature · 6 lines
2.14.1 _______________________________________________ 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): 20171026183525.7532-28-harry.wentland-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 27/29] drm/amd/display: Explicitly call ->reset for each object
Quoted 1 line · Harry Wentland
We need to avoid calling reset after detection.
Could you explain why please ?
Quoted 17 lines
This is much simpler
if we call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.Signed-off-by Harry Wentland <[email protected]>Reviewed-by Roman Li <[email protected]>Acked-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · line 1439
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-1@@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } -drm_mode_config_reset (dm->ddev);
This is a standard helper called by many drivers on driver init , it's also called in drm_atomic_helper_resume which we use on resume from suspend so now it's kind of asymmetrical behavior.
Thanks,
Andrey
Quoted 28 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9
-1-return 0 ; fail:kfree (aencoder);@@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,drm_plane_helper_add (&aplane->base, &dm_plane_helper_funcs); +/* Create (reset) the plane state */ +if (aplane->base.funcs->reset) + aplane->base.funcs->reset (&aplane->base); + +return res; }@@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,drm_crtc_helper_add (&acrtc->base, &amdgpu_dm_crtc_helper_funcs); +/* Create (reset) the plane state */ +if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset (&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, · line 3515
Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-0@@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, &aconnector->base, &amdgpu_dm_connector_helper_funcs); +if (aconnector->base.funcs->reset) + aconnector->base.funcs->reset (&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,
_______________________________________________
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): 3412bae6-030f-8b05-b54b-35848b0b6f9b-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 27/29] drm/amd/display: Explicitly call ->reset for each object
Quoted 6 lines · Andrey Grodzovsky
Quoted 1 line · Harry Wentland
We need to avoid calling reset after detection.
Could you explain why please ?
Reset creates new, clean atomic_state objects. In this case we want to attach the freesync_capable property on the atomic_state at detection (see next change to convert the property from legacy to atomic). Calling reset after detection would clear that.
Quoted 13 lines
Quoted 13 lines
This is much simpler
if we call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.Signed-off-by Harry Wentland <[email protected]>Reviewed-by Roman Li <[email protected]>Acked-by Harry Wentland <[email protected]>---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c| 14 ++++++++++++--1 file changed, 12 insertions(+), 2 deletions(-)
Quoted 12 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · line 1438
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } - drm_mode_config_reset(dm->ddev);This is a standard helper called by many drivers on driver init , it's also called in
drm_atomic_helper_resumewhich we use on resume from suspend so now it's kind of asymmetrical behavior.
I'll have to take a look at the resume case. It seems atomic never intended to deal with immutable properties that are set in the driver (like freesync_capable). We might have to revisit that but in light of the fact that we need to redo these properties anyways in a generic fashion for upstream freesync I was hesitant to spend too much time on our non-upstream version of the freesync properties.
Harry
Quoted 25 lines
Thanks,
AndreyQuoted 22 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-1- return 0;fail:
kfree(aencoder);drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, drm_plane_helper_add(&aplane->base, &dm_plane_helper_funcs);+ /* Create (reset) the plane state */ + if (
aplane->base.funcs->reset)
+aplane->base.funcs->reset(&aplane->base);drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0+ +return res;
}
@@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(structamdgpu_display_manager*dm,drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs);
+ /* Create (reset) the plane state */
+ if (acrtc->base.funcs->reset)
+acrtc->base.funcs->reset(&acrtc->base);
+
acrtc->max_cursor_width=dm->adev->dm.dc->caps.max_cursor_size;acrtc->max_cursor_height=dm->adev->dm.dc->caps.max_cursor_size;
@@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(structamdgpu_display_manager*dm,
Quoted 9 lines
Quoted 8 lines
&aconnector->base,&amdgpu_dm_connector_helper_funcs); + if (aconnector->base.funcs->reset)
+aconnector->base.funcs->reset(&aconnector->base); +
amdgpu_dm_connector_init_helper(
dm,
aconnector,
_______________________________________________
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): 1f2bdf92-84b9-0798-8f19-9079ac51a748-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 27/29] drm/amd/display: Explicitly call ->reset for each object
Quoted 6 lines · Harry Wentland
Quoted 4 lines · Andrey Grodzovsky
Quoted 1 line · Harry Wentland
We need to avoid calling reset after detection.
Could you explain why please ?
Reset creates new, clean
atomic_stateobjects. In this case we want to attach thefreesync_capableproperty on theatomic_stateat detection (see next change to convert the property from legacy to atomic). Calling reset after detection would clear that.
I see, maybe then add this explanation to the log message.
Thanks,
Andrey
Quoted 53 lines
Quoted 13 lines
Quoted 13 lines
This is much simpler
if we call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.Signed-off-by Harry Wentland <[email protected]>Reviewed-by Roman Li <[email protected]>Acked-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)Quoted 11 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) · line 1438
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -1436,8 +1436,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } -drm_mode_config_reset (dm->ddev);This is a standard helper called by many drivers on driver init , it's also called in
drm_atomic_helper_resumewhich we use on resume from suspend so now it's kind of asymmetrical behavior.I'll have to take a look at the resume case. It seems atomic never intended to deal with immutable properties that are set in the driver (like
freesync_capable). We might have to revisit that but in light of the fact that we need to redo these properties anyways in a generic fashion for upstream freesync I was hesitant to spend too much time on our non-upstream version of the freesync properties.Harry
Quoted 25 lines
Thanks,
AndreyQuoted 22 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7
-1-return 0 ; fail:kfree (aencoder);@@ -3105,6 +3103,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,drm_plane_helper_add (&aplane->base, &dm_plane_helper_funcs); +/* Create (reset) the plane state */ + if (aplane->base.funcs->reset) + aplane->base.funcs->reset(&aplane->base); + +return res; } @@ -3140,6 +3143,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, drm_crtc_helper_add(&acrtc->base, &amdgpu_dm_crtc_helper_funcs); +/* Create (reset) the plane state */ + if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset(&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size; @@ -3500,6 +3507,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, · line 3515
Quoted 8 lines
&aconnector->base, &amdgpu_dm_connector_helper_funcs);+ if (
aconnector->base.funcs->reset)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0+ aconnector->base.funcs->reset (&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,
_______________________________________________
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): ce79286f-20a4-293b-dcb2-c682be3596df-5C7GfCeVMHo@public.gmane.org
PATCH v2 1/1 drm/amd/display: Explicitly call ->reset for each object
We need to avoid calling reset after detection because the next commit adds freesync properties on the atomic_state which are set during detection. Calling reset after this clears them.
The easiest way to accomplish this right now is to call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.
v2: Provide better reason for this change in commit msg.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +12 -2
@@ -1438,8 +1438,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } -drm_mode_config_reset (dm->ddev); -return 0 ; fail:kfree (aencoder);
@@ -3115,6 +3113,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,drm_plane_helper_add (&aplane->base, &dm_plane_helper_funcs); +/* Create (reset) the plane state */ +if (aplane->base.funcs->reset) + aplane->base.funcs->reset (&aplane->base); + +return res; }
@@ -3150,6 +3153,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,drm_crtc_helper_add (&acrtc->base, &amdgpu_dm_crtc_helper_funcs); +/* Create (reset) the plane state */ +if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset (&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
@@ -3510,6 +3517,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, &aconnector->base, &amdgpu_dm_connector_helper_funcs); +if (aconnector->base.funcs->reset) + aconnector->base.funcs->reset (&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,
Signature · 6 lines
2.14.1 _______________________________________________ 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): 20171030151055.10626-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
Andrey Grodzovsky
Reviewed-byRe: [PATCH v2] drm/amd/display: Explicitly call ->reset for each object
Quoted 54 lines · Harry Wentland
We need to avoid calling reset after detection because the next commit adds freesync properties on the
atomic_statewhich are set during detection. Calling reset after this clears them.The easiest way to accomplish this right now is to call ->reset on the connector right after creation but before detection. To stay consistent call ->reset on every other object as well after creation.
v2: Provide better reason for this change in commit msg.
Signed-off-by Harry Wentland <[email protected]>Reviewed-by Roman Li <[email protected]>Acked-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9
-2@@ -1438,8 +1438,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev) goto fail; } -drm_mode_config_reset (dm->ddev); -return 0 ; fail:kfree (aencoder);@@ -3115,6 +3113,11 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,drm_plane_helper_add (&aplane->base, &dm_plane_helper_funcs); +/* Create (reset) the plane state */ +if (aplane->base.funcs->reset) + aplane->base.funcs->reset (&aplane->base); + +return res; }@@ -3150,6 +3153,10 @@ static int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,drm_crtc_helper_add (&acrtc->base, &amdgpu_dm_crtc_helper_funcs); +/* Create (reset) the plane state */ +if (acrtc->base.funcs->reset) + acrtc->base.funcs->reset (&acrtc->base); + acrtc->max_cursor_width = dm->adev->dm.dc->caps.max_cursor_size; acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, · line 3525
Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-0@@ -3510,6 +3517,9 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm, &aconnector->base, &amdgpu_dm_connector_helper_funcs); +if (aconnector->base.funcs->reset) + aconnector->base.funcs->reset (&aconnector->base); + amdgpu_dm_connector_init_helper( dm, aconnector,
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/29 drm/amd/display: Don't access legacy properties
In reply to a message not in the archiveWe'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.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 73 ++++++++++------------- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 1 + 2 files changed, 34 insertions(+), 40 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +33 -40
@@ -2462,23 +2462,6 @@ amdgpu_dm_connector_detect(struct drm_connector *connector, bool force) connector_status_disconnected); } -/* Compare user free sync property with immunable property free sync capable -* and if display is not free sync capable sets free sync property to 0 -*/ -static int -amdgpu_freesync_update_property_atomic (struct drm_connector *connector, -uint64_t val_capable) -{ -struct drm_device *dev = connector->dev; -struct amdgpu_device *adev = dev->dev_private; - -return drm_object_property_set_value (&connector->base, - adev->mode_info.freesync_property, - val_capable); - - -} - int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, struct drm_connector_state *connector_state, struct drm_property *property,
@@ -2532,8 +2515,8 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, dm_new_state->user_enable.enable_for_video = val; ret =0 ; }else if (property == adev->mode_info.freesync_capable_property) { - ret = -EINVAL ; -return ret; + dm_new_state->freesync_capable = val; + ret =0 ; }return ret;
@@ -2549,7 +2532,6 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector,struct dm_connector_state *dm_state =to_dm_connector_state (state);int ret = -EINVAL ; -int i;if (property == dev->mode_config.scaling_mode_property) {switch (dm_state->scaling) {
@@ -2577,14 +2559,12 @@ int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector, }else if (property == adev->mode_info.underscan_property) { *val = dm_state->underscan_enable; ret =0 ; - }else if ((property == adev->mode_info.freesync_property) || - (property == adev->mode_info.freesync_capable_property)) { -for (i =0 ; i < connector->base.properties->count; i++) { -if (connector->base.properties->properties[i] == property) { - *val = connector->base.properties->values[i]; - ret =0 ; - } - } + }else if (property == adev->mode_info.freesync_property) { + *val = dm_state->user_enable.enable_for_gaming; + ret =0 ; + }else if (property == adev->mode_info.freesync_capable_property) { + *val = dm_state->freesync_capable; + ret =0 ; }return ret; }
@@ -4843,17 +4823,24 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector, struct edid *edid) {int i; -uint64_t val_capable;bool edid_check_required;struct detailed_timing *timing;struct detailed_non_pixel *data;struct detailed_data_monitor_range *range;struct amdgpu_dm_connector *amdgpu_dm_connector =to_amdgpu_dm_connector (connector); +struct dm_connector_state *dm_con_state;struct drm_device *dev = connector->dev;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;if (!amdgpu_dm_connector->dc_sink) {DRM_ERROR ("dc_sink NULL, could not add free_sync module.\n" );
@@ -4872,7 +4859,7 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector, amdgpu_dm_connector); } } - val_capable =0 ; + dm_con_state->freesync_capable = false;if (edid_check_required == true && (edid->version >1 || (edid->version ==1 && edid->revision >1 ))) {for (i =0 ; i <4 ; i++) {
@@ -4908,21 +4895,20 @@ void amdgpu_dm_add_sink_to_freesync_module(struct drm_connector *connector, amdgpu_dm_connector->min_vfreq *1000000 ; amdgpu_dm_connector->caps.max_refresh_in_micro_hz = amdgpu_dm_connector->max_vfreq *1000000 ; - val_capable =1 ; + dm_con_state->freesync_capable = true; } } -drm_object_property_set_value (&connector->base, - adev->mode_info.freesync_capable_property, - val_capable); -amdgpu_freesync_update_property_atomic (connector, val_capable); + dm_con_state->user_enable.enable_for_gaming = dm_con_state->freesync_capable; + dm_con_state->user_enable.enable_for_static = dm_con_state->freesync_capable; + dm_con_state->user_enable.enable_for_video = dm_con_state->freesync_capable; }void amdgpu_dm_remove_sink_from_freesync_module (struct drm_connector *connector) {struct amdgpu_dm_connector *amdgpu_dm_connector =to_amdgpu_dm_connector (connector); - +struct dm_connector_state *dm_con_state;struct drm_device *dev = connector->dev;struct amdgpu_device *adev = dev->dev_private;
@@ -4931,15 +4917,22 @@ void amdgpu_dm_remove_sink_from_freesync_module(struct drm_connector *connector)return ; } +if (!connector->state) { +DRM_ERROR ("%s - Connector has no state" , __func__); +return ; + } + + dm_con_state =to_dm_connector_state (connector->state); + amdgpu_dm_connector->min_vfreq =0 ; amdgpu_dm_connector->max_vfreq =0 ; amdgpu_dm_connector->pixel_clock_mhz =0 ;memset (&amdgpu_dm_connector->caps,0 ,sizeof (amdgpu_dm_connector->caps)); -drm_object_property_set_value (&connector->base, - adev->mode_info.freesync_capable_property, -0 ); -amdgpu_freesync_update_property_atomic (connector,0 ); + dm_con_state->freesync_capable = false; + dm_con_state->user_enable.enable_for_gaming = false; + dm_con_state->user_enable.enable_for_static = false; + dm_con_state->user_enable.enable_for_video = false; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -0
@@ -230,6 +230,7 @@ struct dm_connector_state {uint8_t underscan_hborder;bool underscan_enable;struct mod_freesync_user_enable user_enable; +bool freesync_capable; };#define to_dm_connector_state (x)\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 29/29 drm/amd/display: Fix Freesync enablement
In reply to a message not in the archiveWith our recent change to save Freesync properties as part of the atomic state we removed the call to enable freesync when the property is being set. Apparently that is still needed.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +12 -0
@@ -2510,9 +2510,21 @@ int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector, dm_new_state->underscan_enable = val; ret =0 ; }else if (property == adev->mode_info.freesync_property) { +struct amdgpu_crtc *acrtc; +struct dm_crtc_state *acrtc_state; + dm_new_state->user_enable.enable_for_gaming = val; dm_new_state->user_enable.enable_for_static = val; dm_new_state->user_enable.enable_for_video = val; + +if (adev->dm.freesync_module && connector_state->crtc) { + acrtc =to_amdgpu_crtc (connector_state->crtc); + acrtc_state =to_dm_crtc_state (connector_state->crtc->state); +mod_freesync_set_user_enable (adev->dm.freesync_module, + &acrtc_state->stream,1 , + &dm_new_state->user_enable); + } + ret =0 ; }else if (property == adev->mode_info.freesync_capable_property) { dm_new_state->freesync_capable = val;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Andrey Grodzovsky
Reviewed-byPatches 1,2,6,24-26,28 are
Quoted 95 lines · Harry Wentland
* Remove annoyning Freesync warning
* Fix Freesync and amd-stg which was broken in last set of patches
* Fix issue with plugging in displays during S3
* Bunch of generic fixes found during Raven bringup
* Whole bunch of Raven fixes and workAndrew Jiang (3):
drm/amd/display: Reject PPLib clock values if they are invalid drm/amd/display: Use constants fromatom.hfor HDMI caps read drm/amd/display: Don't reject 3D timingsAnthony Koo (1):
drm/amd/display: Movehdr_metadatafrom plane to streamCharlene Liu (1):
drm/amd/display: correct DP is always in full range or bt609Dmytro Laktyushkin (2):
drm/amd/display: fix split recout calculation
drm/amd/display: fix split recout offsetEric Yang (1):
drm/amd/display: Add timing validation against dongle capHarry Wentland (7):
drm/amdgpu: Remove immutable flag fromfreesync_capableproperty drm/amd/display: Moveconn_stateto header drm/amd/display: Use plane pointer to avoid line breaks drm/amd/display: Use single fail label ininit_drm_devdrm/amd/display: Explicitly call ->reset for each object drm/amd/display: Don't access legacy properties drm/amd/display: Fix Freesync enablementHersen Wu (1):
drm/amd/display: Handle as MST first and then DP dongle if sink
support bothLeo (Sunpeng) Li (2):
drm/amd/display: Fix styling of freesync code incommit_taildrm/amd/display: Complete TODO item: use new DRM iteratorRoman Li (1):
drm/amd/display: Fix S3 topology changeSivapiriyanKumarasamy (1):
drm/amd/display: Apply VQ adjustments in MPO caseTony Cheng (3):
drm/amd/display: dal 3.1.08 drm/amd/display: dal 3.1.09 drm/amd/display: dal 3.1.10Yongqiang Sun (3):
drm/amd/display: Power down front end ininit_hw. drm/amd/display: Not reset front end when program back end. drm/amd/display: Added disconnect dchub.Yue Hin Lau (3):
drm/amd/display: create new files for hubbub functions drm/amd/display: create new structure for hubbub drm/amd/display: fix bug from last commit for hubbubdrivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 198 ++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 13 + drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 68 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 4 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 108 ++- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 21 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 51 +- drivers/gpu/drm/amd/display/dc/dc.h | 44 +- drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 9 + drivers/gpu/drm/amd/display/dc/dc_types.h | 5 - .../drm/amd/display/dc/dce/dce_stream_encoder.c | 34 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +- drivers/gpu/drm/amd/display/dc/dcn10/Makefile | 3 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 31 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 47 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 44 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 510 +++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 217 ++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 9 + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 841 +++++---------------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 1 + .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 44 ++ .../amd/display/dc/dcn10/dcn10_timing_generator.c | 3 - drivers/gpu/drm/amd/display/dc/inc/core_status.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 10 +- drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 2 + drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 14 + drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 6 +- 32 files changed, 1468 insertions(+), 906 deletions(-)
Quoted 3 lines
create mode 100644
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.ccreate mode 100644drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx