DC Changes Jan 31, 2019
Subsystems (3)
cover DC Changes Jan 31, 2019
Summary of Changes
*Fix a DP compliance test
*Refactoring some things (amdgpu_dm, DRR, init_hw, vupdate etc) *MST fixes
Anthony Koo (8):
drm/amd/display: fix issue with DC brightness low with VB drm/amd/display: link_rate_set should index into table drm/amd/display: interface to check if timing can be seamless drm/amd/display: refactor out programming of vupdate interrupt drm/amd/display: add way to determine if link is active drm/amd/display: add seamless boot flag to stream drm/amd/display: refactor programming of DRR drm/amd/display: refactor init_hw to isolate pipe related init
Chiawen Huang (1):
drm/amd/display: add gpio lock/unlock
Dmytro Laktyushkin (2):
drm/amd/display: add a debug flag to force odm combine drm/amd/display: add n_vid_mul and half pix_rate for odm
Eryk Brol (1):
drm/amd/display: DC VM Fixes
Ilya Bakoulin (1):
drm/amd/display: Check that vrefresh is in freesync range
Jerry (Fangzhi) Zuo (2):
drm/amd/display: Apply fake sink back to MST sequence drm/amd/display: Clear dc_sink after it gets released
John Barberiz (1):
drm/amd/display: Use udelay when waiting between aux retries
Josip Pavic (1):
drm/amd/display: Modify ABM 2.2 Max Reduction
Krunoslav Kovac (1):
drm/amd/display: DGAM enabled for HDR
Murton Liu (1):
drm/amd/display: PIP overlay corruption
Nicholas Kazlauskas (7):
drm/amd/display: Apply all surface updates onto surfaces drm/amd/display: Use the right surface for flip and FreeSync drm/amd/display: Reformat dm_determine_update_type_for_commit drm/amd/display: Initialize stream_update to zero drm/amd/display: Remove FreeSync timing changed debug output drm/amd/display: Disconnect mpcc when changing tg drm/amd/display: Don't re-program planes for DPMS changes
Paul Hsieh (1):
drm/amd/display: dmcu is blocking due to wrong disable ABM command
Steven Chiu (1):
drm/amd/display: 3.2.16
Su Sung Chung (1):
drm/amd/display: store timing sync info in dc_stream_status
Wenjing Liu (1):
drm/amd/display: determine if a pipe is synced by plane state
Wesley Chalmers (1):
drm/amd/display: Disable Stutter for Stereo 3D
Xiaodong Yan (1):
drm/amd/display: Add monitor patch for backlight
Yongqiang Sun (2):
drm/amd/display: make vline_config parameter const. drm/amd/display: Calc vline position in dc.
mmcgarri (1):
drm/amd/display:3.2.17
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 182 +++++++--------- .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 + drivers/gpu/drm/amd/display/dc/core/dc.c | 189 +++++++++++++++-- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 65 +++--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 35 +--- .../drm/amd/display/dc/core/dc_link_hwss.c | 4 + .../gpu/drm/amd/display/dc/core/dc_resource.c | 56 ++++- .../drm/amd/display/dc/core/dc_vm_helper.c | 18 +- drivers/gpu/drm/amd/display/dc/dc.h | 8 +- drivers/gpu/drm/amd/display/dc/dc_link.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 25 ++- drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +- .../drm/amd/display/dc/dce/dce_clock_source.c | 28 ++- .../display/dc/dce110/dce110_hw_sequencer.c | 50 +++-- .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 19 +- .../drm/amd/display/dc/dcn10/dcn10_hubbub.h | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 23 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 194 ++++++++--------- .../amd/display/dc/dcn10/dcn10_link_encoder.c | 10 + .../amd/display/dc/dcn10/dcn10_link_encoder.h | 2 + .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 197 ++++++++++++++++-- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 8 +- .../gpu/drm/amd/display/dc/gpio/gpio_base.c | 12 ++ .../drm/amd/display/dc/gpio/gpio_service.c | 28 +++ .../drm/amd/display/dc/gpio/gpio_service.h | 10 + .../gpu/drm/amd/display/dc/inc/clock_source.h | 4 + .../drm/amd/display/dc/inc/hw/link_encoder.h | 1 + .../amd/display/dc/inc/hw/timing_generator.h | 13 +- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + .../gpu/drm/amd/display/dc/inc/vm_helper.h | 7 +- .../drm/amd/display/include/gpio_interface.h | 8 + .../amd/display/modules/color/color_gamma.c | 89 ++++---- .../amd/display/modules/power/power_helpers.c | 38 ++-- 35 files changed, 933 insertions(+), 408 deletions(-)
Signature · 6 lines
2.17.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): 20190201152847.11151-1-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org
PATCH 1/35 drm/amd/display: Use udelay when waiting between aux retries
From: John Barberiz <[email protected]>
[Why]
"IRQ_HPD Pulse Length Test" DP compliance test fails. Test complains that certain DPCD registers are not read within 100 ms.
[How]
msleep is inaccurate for small values. Used udelay instead for accuracy.
--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +1 -1
@@ -516,7 +516,7 @@ bool dce_aux_transfer_with_retries(struct ddc_service *ddc, } } -msleep (1 ); +udelay (1000 ); }return false; }
Signature · 6 lines
2.17.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): 20190201152847.11151-2-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 4 lines · Bhawanpreet Lakha
From: John Barberiz <[email protected]> [How]
msleep is inaccurate for small values. Used udelay instead for accuracy.
Hi,
Should it be the case for non-DC displayport code too?
regards,
Signature · 5 lines
Sylvain _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 10 lines · On 2019-02-01 12:31 p.m., [email protected] wrote:
Quoted 4 lines · Bhawanpreet Lakha
From: John Barberiz <[email protected]> [How]
msleep is inaccurate for small values. Used udelay instead for accuracy.Hi,
Should it be the case for non-DC displayport code too?
I don't think we're actually using this code on Linux. It's part of the shared codebase with Windows. Apparently there msleep would often sleep longer than 1ms.
drm_dp_dpcd_access already has a tighter bound on the sleep between retries (500-600 us), so I imagine we're fine there.
Harry
Quoted 2 lines
regards,
_______________________________________________
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): fda8f6ec-5a75-6456-3034-f3714b304b77-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 7 lines · Harry
Quoted 6 lines · On 2019-02-01 12:31 p.m., [email protected] wrote:
Quoted 4 lines · Bhawanpreet Lakha
From: John Barberiz <[email protected]> [How]
msleep is inaccurate for small values. Used udelay instead for accuracy.
Quoted 8 lines
Quoted 4 lines
Hi,
Should it be the case for non-DC displayport code too?
I don't think we're actually using this code on Linux. It's part of the shared codebase with Windows. Apparently there msleep would often sleep longer than 1ms.
drm_dp_dpcd_accessalready has a tighter bound on the sleep between retries (500-600 us), so I imagine we're fine there.
Do you mean non-DC displayport related code is already using udelay instead of msleep on linux?
Signature · 5 lines
Sylvain _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 2 lines · On Fri, Feb 01, 2019 at 08:08:30PM +0000, [email protected] wrote:
Do you mean non-DC displayport related code is already using udelay instead of msleep on linux?
I grep-ed amdgpu displayport atombios code, got udelay(400) only. Did the same on drm *_dp_* files, got similar udelays with only a very slow msleep (which seems justified there).
But I did not get any udelays with the range of 1ms for "retries". Maybe it would be a good idea to a similar delay on non-DC displayport code? That would give more time to "slow" displayort monitors to timeout on their side.
Signature · 5 lines
Sylvain _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 4 lines · On 2019-02-01 3:47 p.m., [email protected] wrote:
Quoted 2 lines · On Fri, Feb 01, 2019 at 08:08:30PM +0000, [email protected] wrote:
Do you mean non-DC displayport related code is already using udelay instead of msleep on linux?
Quoted 8 lines
I grep-ed amdgpu displayport atombios code, got udelay(400) only. Did the same on drm *_dp_* files, got similar udelays with only a very slow msleep (which seems justified there).
But I did not get any udelays with the range of 1ms for "retries". Maybe it would be a good idea to a similar delay on non-DC displayport code? That would give more time to "slow" displayort monitors to timeout on their side.
DRM's AUX code uses usleep_range in drm_dp_dpcd_access.
Harry
_______________________________________________
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): 058665e8-0241-8fc1-8a2a-9f1d7484b29e-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 1 line · Harry
DRM's AUX code uses
usleep_rangeindrm_dp_dpcd_access.
My bad, forgot about the usleep_range switch. That said AUX_RETRY_INTERVAL is 500 us, with a usleep_range top bound of 600 us.
Then, it would mean DC DP timeout retries would happen after ~1ms, and drm ~600us. Additionaly, it seems that the number of retries are 3 in drm code and 7 in DC code.
I may be wrong, but it seems DC code is much more "insisting" on auxchannel (edid retrieval) and much more forgiving on monitor ability to timeout in time (~1ms).
If I did read the code the right way, it may be more reasonable to have similar behavior in drm code than in DC code, right?
Signature · 5 lines
Sylvain _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 10 lines · On 2019-02-01 5:55 p.m., [email protected] wrote:
Quoted 1 line · Harry
DRM's AUX code uses
usleep_rangeindrm_dp_dpcd_access.My bad, forgot about the
usleep_rangeswitch. That saidAUX_RETRY_INTERVALis 500 us, with ausleep_rangetop bound of 600 us.Then, it would mean DC DP timeout retries would happen after ~1ms, and drm ~600us. Additionaly, it seems that the number of retries are 3 in drm code and 7 in DC code.
DRM actually bumped this to 32 due to an issue with a Dell 4k display.
Quoted 7 lines
I may be wrong, but it seems DC code is much more "insisting" on auxchannel (edid retrieval) and much more forgiving on monitor ability to timeout in time (~1ms).
If I did read the code the right way, it may be more reasonable to have similar behavior in drm code than in DC code, right?
It depends. I wouldn't call one or the other more correct. I seem to remember that the DP spec is quite vague on these retries but I could be mistaken. Since our driver hasn't show any problems with the DRM code and I believe others (such as i915) also pass DP compliance without issues I wouldn't proactively change this.
Harry
_______________________________________________
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): e7211c67-8ea3-e8f5-8f91-d7af94c1a603-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 01/35] drm/amd/display: Use udelay when waiting between aux retries
Quoted 1 line · Harry
DRM actually bumped this to 32 due to an issue with a Dell 4k display.
As I feared there is a retry counter higher in the code. My bad.
Quoted 5 lines
It depends. I wouldn't call one or the other more correct. I seem to remember that the DP spec is quite vague on these retries but I could be mistaken. Since our driver hasn't show any problems with the DRM code and I believe others (such as i915) also pass DP compliance without issues I wouldn't proactively change this.
I reacted to this matter since my DP monitor had troubles getting out of DP off state (iiyama) with logs which did seem to point towards a failure of getting the EDID. It happens rarely, and I could not figure out a context to reproduce for sure. Could be gone for good with the latest fixes.
I guess fixes for popular and defective hardware (for instance that dell 4k) from a compliance stand point have to go in the code unfortunately.
regards,
Signature · 5 lines
Sylvain _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/35 drm/amd/display: Apply all surface updates onto surfaces
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Most surface updates weren't propagated onto the surface during dc_commit_updates_for_stream. This makes it more difficult for DC to determine the actual surface update type required.
[How]
Use copy_surface_update_to_plane to propagate the changes. The FreeSync surface timing information update for BTR has been moved out of amdgpu_dm.c into this function as well.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 -- drivers/gpu/drm/amd/display/dc/core/dc.c | 104 ++++++++++++++++-- 2 files changed, 96 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -9
@@ -4860,15 +4860,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, surface, flip->flip_addrs[flip_count].flip_timestamp_in_us); -/* Update surface timing information. */ - surface->time.time_elapsed_in_us[surface->time.index] = - flip->flip_addrs[flip_count].flip_timestamp_in_us - - surface->time.prev_update_time_in_us; - surface->time.prev_update_time_in_us = flip->flip_addrs[flip_count].flip_timestamp_in_us; - surface->time.index++; -if (surface->time.index >=DC_PLANE_UPDATE_TIMES_MAX ) - surface->time.index =0 ; - DRM_DEBUG_DRIVER("%s Flipping to hi: 0x%x, low: 0x%x\n", __func__, flip->flip_addrs[flip_count].address.grph.addr.high_part,
drivers/gpu/drm/amd/display/dc/core/dc.c +96 -8
116 lines not on this page · raw message
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/35 drm/amd/display: Use the right surface for flip and FreeSync
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
We were always passing the first surface on the stream status for flip updates when we should be using the surface associated with the plane.
[How]
Use the dc_plane_state from the plane that's being updated.
FreeSync should also only keep track of updates from the primary plane, so the check needed to be updated.
The acrtc->stream state doesn't need to be checked for NULL before updating FreeSync either since there needs to be a stream to be inside this function as a prerequisite.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -13
@@ -4742,7 +4742,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,unsigned long flags;struct amdgpu_bo *abo;uint64_t tiling_flags, dcc_address; -struct dc_stream_status *stream_status;uint32_t target, target_vblank;struct {
@@ -4773,7 +4772,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct drm_framebuffer *fb = new_plane_state->fb;struct amdgpu_framebuffer *afb =to_amdgpu_framebuffer (fb);bool pflip_needed; -struct dc_plane_state *surface, *dc_plane; +struct dc_plane_state *dc_plane;struct dm_plane_state *dm_new_plane_state =to_dm_plane_state (new_plane_state);if (plane->type ==DRM_PLANE_TYPE_CURSOR ) {
@@ -4836,28 +4835,20 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, timestamp_ns =ktime_get_ns (); flip->flip_addrs[flip_count].flip_timestamp_in_us =div_u64 (timestamp_ns,1000 ); flip->surface_updates[flip_count].flip_addr = &flip->flip_addrs[flip_count]; + flip->surface_updates[flip_count].surface = dc_plane; - stream_status =dc_stream_get_status (acrtc_state->stream); -if (!stream_status) { -DRM_ERROR ("No stream status for CRTC: id=%d\n" , - acrtc_attach->crtc_id); -continue ; - } - - surface = stream_status->plane_states[0 ]; - flip->surface_updates[flip_count].surface = surface;if (!flip->surface_updates[flip_count].surface) {DRM_ERROR ("No surface for CRTC: id=%d\n" , acrtc_attach->crtc_id);continue ; } -if (acrtc_state->stream) +if (plane == pcrtc->primary)update_freesync_state_on_stream ( dm, acrtc_state, acrtc_state->stream, - surface, + dc_plane, flip->flip_addrs[flip_count].flip_timestamp_in_us); DRM_DEBUG_DRIVER("%s Flipping to hi: 0x%x, low: 0x%x\n",
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/35 drm/amd/display: Reformat dm_determine_update_type_for_commit
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The indenting for this function is a few levels too deep and can be simplified a fair bit. This patch is in preparation for functional changes that fix update type determination to occur less frequently and more accurately.
[How]
Place checks early and exit/continue when possible. This isn't a functional change.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 126 +++++++++--------- 1 file changed, 65 insertions(+), 61 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +65 -61
@@ -5886,75 +5886,79 @@ dm_determine_update_type_for_commit(struct dc *dc, old_dm_crtc_state =to_dm_crtc_state (old_crtc_state); num_plane =0 ; -if (new_dm_crtc_state->stream) { - -for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, j) { - new_plane_crtc = new_plane_state->crtc; - old_plane_crtc = old_plane_state->crtc; - new_dm_plane_state =to_dm_plane_state (new_plane_state); - old_dm_plane_state =to_dm_plane_state (old_plane_state); - -if (plane->type ==DRM_PLANE_TYPE_CURSOR ) -continue ; - -if (!state->allow_modeset) -continue ; - -if (crtc == new_plane_crtc) { - updates[num_plane].surface = &surface[num_plane]; - -if (new_crtc_state->mode_changed) { - updates[num_plane].surface->src_rect = - new_dm_plane_state->dc_state->src_rect; - updates[num_plane].surface->dst_rect = - new_dm_plane_state->dc_state->dst_rect; - updates[num_plane].surface->rotation = - new_dm_plane_state->dc_state->rotation; - updates[num_plane].surface->in_transfer_func = - new_dm_plane_state->dc_state->in_transfer_func; - stream_update.dst = new_dm_crtc_state->stream->dst; - stream_update.src = new_dm_crtc_state->stream->src; - } - -if (new_crtc_state->color_mgmt_changed) { - updates[num_plane].gamma = - new_dm_plane_state->dc_state->gamma_correction; - updates[num_plane].in_transfer_func = - new_dm_plane_state->dc_state->in_transfer_func; - stream_update.gamut_remap = - &new_dm_crtc_state->stream->gamut_remap_matrix; - stream_update.out_transfer_func = - new_dm_crtc_state->stream->out_transfer_func; - } - - num_plane++; - } +if (!new_dm_crtc_state->stream) { +if (!new_dm_crtc_state->stream && old_dm_crtc_state->stream) { + update_type =UPDATE_TYPE_FULL ; + goto cleanup; } -if (num_plane >0 ) { - ret =dm_atomic_get_state (state, &dm_state); -if (ret) - goto cleanup; +continue ; + } - old_dm_state =dm_atomic_get_old_state (state); -if (!old_dm_state) { - ret = -EINVAL ; - goto cleanup; - } +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, j) { + new_plane_crtc = new_plane_state->crtc; + old_plane_crtc = old_plane_state->crtc; + new_dm_plane_state =to_dm_plane_state (new_plane_state); + old_dm_plane_state =to_dm_plane_state (old_plane_state); - status =dc_stream_get_status_from_state (old_dm_state->context, - new_dm_crtc_state->stream); +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) +continue ; - update_type =dc_check_update_surfaces_for_stream (dc, updates, num_plane, - &stream_update, status); +if (!state->allow_modeset) +continue ; -if (update_type >UPDATE_TYPE_MED ) { - update_type =UPDATE_TYPE_FULL ; - goto cleanup; - } +if (crtc != new_plane_crtc) +continue ; + + updates[num_plane].surface = &surface[num_plane]; + +if (new_crtc_state->mode_changed) { + updates[num_plane].surface->src_rect = + new_dm_plane_state->dc_state->src_rect; + updates[num_plane].surface->dst_rect = + new_dm_plane_state->dc_state->dst_rect; + updates[num_plane].surface->rotation = + new_dm_plane_state->dc_state->rotation; + updates[num_plane].surface->in_transfer_func = + new_dm_plane_state->dc_state->in_transfer_func; + stream_update.dst = new_dm_crtc_state->stream->dst; + stream_update.src = new_dm_crtc_state->stream->src; + } + +if (new_crtc_state->color_mgmt_changed) { + updates[num_plane].gamma = + new_dm_plane_state->dc_state->gamma_correction; + updates[num_plane].in_transfer_func = + new_dm_plane_state->dc_state->in_transfer_func; + stream_update.gamut_remap = + &new_dm_crtc_state->stream->gamut_remap_matrix; + stream_update.out_transfer_func = + new_dm_crtc_state->stream->out_transfer_func; } - }else if (!new_dm_crtc_state->stream && old_dm_crtc_state->stream) { + num_plane++; + } + +if (num_plane ==0 ) +continue ; + + ret =dm_atomic_get_state (state, &dm_state); +if (ret) + goto cleanup; + + old_dm_state =dm_atomic_get_old_state (state); +if (!old_dm_state) { + ret = -EINVAL ; + goto cleanup; + } + + status =dc_stream_get_status_from_state (old_dm_state->context, + new_dm_crtc_state->stream); + + update_type =dc_check_update_surfaces_for_stream (dc, updates, num_plane, + &stream_update, status); + +if (update_type >UPDATE_TYPE_MED ) { update_type =UPDATE_TYPE_FULL ; goto cleanup; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/35 drm/amd/display: Initialize stream_update to zero
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The stream_update struct is left unitialized but DC will access its fields. This usually results in global state validation occur during any atomic commit with state->allow_modeset = true.
[How]
Initialize the struct to zero for every stream we check.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -5868,7 +5868,6 @@ dm_determine_update_type_for_commit(struct dc *dc,struct dc_surface_update *updates;struct dc_plane_state *surface; -struct dc_stream_update stream_update;enum surface_update_type update_type =UPDATE_TYPE_FAST ; updates =kcalloc (MAX_SURFACES ,sizeof (*updates),GFP_KERNEL );
@@ -5882,6 +5881,8 @@ dm_determine_update_type_for_commit(struct dc *dc, }for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +struct dc_stream_update stream_update = {0 }; + new_dm_crtc_state =to_dm_crtc_state (new_crtc_state); old_dm_crtc_state =to_dm_crtc_state (old_crtc_state); num_plane =0 ;
Signature · 6 lines
2.17.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): 20190201152847.11151-6-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 05/35] drm/amd/display: Initialize stream_update to zero
Hi,
Recently several locations initing structs to zero have been changed to use memset [1]. Might want to do that here as well.
[1] https://lists.freedesktop.org/archives/amd-gfx/2019-February/031116.html
Regards
Nils
Den fre 1 feb. 2019 16:29 skrev Bhawanpreet Lakha <[email protected]
Quoted 43 lines
:
From: Nicholas Kazlauskas <[email protected]>
[Why]
Thestream_updatestruct is left unitialized but DC will access its fields. This usually results in global state validation occur during any atomic commit withstate->allow_modeset= true.[How]
Initialize the struct to zero for every stream we check.Change-Id Ib7f435cc2c045fc43496bea35d08a14ce8193c33Signed-off-by Nicholas Kazlauskas <[email protected]>Reviewed-by David Francis <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1@@ -5868,7 +5868,6 @@ dm_determine_update_type_for_commit(struct dc *dc,struct dc_surface_update *updates;struct dc_plane_state *surface; -struct dc_stream_update stream_update;enum surface_update_type update_type =UPDATE_TYPE_FAST ; updates =kcalloc (MAX_SURFACES ,sizeof (*updates),GFP_KERNEL );@@ -5882,6 +5881,8 @@ dm_determine_update_type_for_commit(struct dc *dc, }for_each_oldnew_crtc_in_state (state, crtc, old_crtc_state, new_crtc_state, i) { +struct dc_stream_update stream_update = {0 }; + new_dm_crtc_state =to_dm_crtc_state (new_crtc_state); old_dm_crtc_state =to_dm_crtc_state (old_crtc_state);num_plane = 0;
Quoted 8 lines
--
2.17.1_______________________________________________
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
PATCH 6/35 drm/amd/display: Remove FreeSync timing changed debug output
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
This provides little debug value and creates a lot of dmesg noise.
[How]
Remove it.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -6
@@ -4713,12 +4713,6 @@ static void update_freesync_state_on_stream( new_crtc_state->base.crtc->base.id, (int )new_crtc_state->base.vrr_enabled, (int)vrr_params.state); - -if (new_crtc_state->freesync_timing_changed) -DRM_DEBUG_KMS ("VRR timing update: crtc=%u min=%u max=%u\n" , - new_crtc_state->base.crtc->base.id, - vrr_params.adjust.v_total_min, - vrr_params.adjust.v_total_max); } static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/35 drm/amd/display: Add monitor patch for backlight
In reply to a message not in the archiveFrom: Xiaodong Yan <[email protected]>
off
[Why]
Different panel need different time from backlight disable to end of valid video data, if the time is too short, panel will flash when dpms off
[How]
Add monitor patch to control the time from backlight disable to end of valid video data,
--- drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +4 -0
@@ -119,6 +119,10 @@ bool edp_receiver_ready_T9(struct dc_link *link)break ;udelay (100 );//MAx T9 }while (++tries <50 ); + +if (link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off >0 ) +udelay (link->local_sink->edid_caps.panel_patch.extra_delay_backlight_off *1000 ); +return result; }bool edp_receiver_ready_T7 (struct dc_link *link)
drivers/gpu/drm/amd/display/dc/dc_types.h +1 -0
@@ -201,6 +201,7 @@ union display_content_support {struct dc_panel_patch {unsigned int dppowerup_delay;unsigned int extra_t12_ms; +unsigned int extra_delay_backlight_off; };struct dc_edid_caps {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/35 drm/amd/display: fix issue with DC brightness low with VB
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
The problem is that we accidentally stopped loading some of the IRAM bytes used for the backlight ramping mechanism. This happened when we started reserving some region of IRAM as DMCU FW write only.
[How]
This change will define a start+end region for the IRAM read only region. So the parameters needed for the backlight operation will be loaded since it will be defined outside of the read only region.
--- .../amd/display/modules/power/power_helpers.c | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +24 -10
@@ -67,9 +67,14 @@ static const unsigned char abm_config[abm_defines_max_config][abm_defines_max_le#define NUM_AGGR_LEVEL 4#define NUM_POWER_FN_SEGS 8#define NUM_BL_CURVE_SEGS 16 -#define IRAM_RESERVE_AREA_START 0xF0 // reserve 0xF0~0xFF are write by DMCU only#define IRAM_SIZE 256 +#define IRAM_RESERVE_AREA_START_V2 0xF0 // reserve 0xF0~0xF6 are write by DMCU only +#define IRAM_RESERVE_AREA_END_V2 0xF6 // reserve 0xF0~0xF6 are write by DMCU only + +#define IRAM_RESERVE_AREA_START_V2_2 0xF0 // reserve 0xF0~0xFF are write by DMCU only +#define IRAM_RESERVE_AREA_END_V2_2 0xFF // reserve 0xF0~0xFF are write by DMCU only +#pragma pack(push, 1)/* NOTE: iRAM is 256B in size */ struct iram_table_v_2 {
@@ -148,8 +153,10 @@ struct iram_table_v_2_2 {uint16_t dmcu_version;/* 0xf4 */ uint8_t dmcu_state;/* 0xf6 */ -uint16_t blRampReduction;/* 0xf7 */ -uint16_t blRampStart;/* 0xf9 */ +uint8_t dummy1;/* 0xf7 */ +uint8_t dummy2;/* 0xf8 */ +uint8_t dummy3;/* 0xf9 */ +uint8_t dummy4;/* 0xfa */ uint8_t dummy5;/* 0xfb */ uint8_t dummy6;/* 0xfc */ uint8_t dummy7;/* 0xfd */
@@ -420,11 +427,6 @@ void fill_iram_v_2_2(struct iram_table_v_2_2 *ram_table, struct dmcu_iram_parame ram_table->deviation_gain[2 ] =0xb3 ; ram_table->deviation_gain[3 ] =0xb3 ; - ram_table->blRampReduction = -cpu_to_be16 (params.backlight_ramping_reduction); - ram_table->blRampStart = -cpu_to_be16 (params.backlight_ramping_start); - ram_table->min_reduction[0 ][0 ] = min_reduction_table_v_2_2[abm_config[set][0 ]]; ram_table->min_reduction[1 ][0 ] = min_reduction_table_v_2_2[abm_config[set][0 ]]; ram_table->min_reduction[2 ][0 ] = min_reduction_table_v_2_2[abm_config[set][0 ]];
@@ -561,6 +563,7 @@ bool dmcu_load_iram(struct dmcu *dmcu, struct dmcu_iram_parameters params) {unsigned char ram_table[IRAM_SIZE ]; +bool result = false;if (dmcu ==NULL )return false;
@@ -572,10 +575,21 @@ bool dmcu_load_iram(struct dmcu *dmcu,if (dmcu->dmcu_version.abm_version ==0x22 ) {fill_iram_v_2_2 ((struct iram_table_v_2_2 *)ram_table, params); + + result = dmcu->funcs->load_iram ( + dmcu,0 , (char *)(&ram_table),IRAM_RESERVE_AREA_START_V2_2 ); }else {fill_iram_v_2 ((struct iram_table_v_2 *)ram_table, params); + + result = dmcu->funcs->load_iram ( + dmcu,0 , (char *)(&ram_table),IRAM_RESERVE_AREA_START_V2 ); + +if (result) + result = dmcu->funcs->load_iram ( + dmcu,IRAM_RESERVE_AREA_END_V2 +1 , + (char *)(&ram_table) +IRAM_RESERVE_AREA_END_V2 +1 , +sizeof (ram_table) -IRAM_RESERVE_AREA_END_V2 -1 ); } -return dmcu->funcs->load_iram ( - dmcu,0 , (char *)(&ram_table),IRAM_RESERVE_AREA_START ); +return result; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/35 drm/amd/display: dmcu is blocking due to wrong disable ABM command
In reply to a message not in the archiveFrom: Paul Hsieh <[email protected]>
[Why]
Second screen to clone/extend mode, driver will send ABM pipe command to DMCU. Change mode from clone/extend to second screen only, driver send ABM level command to disable ABM but this command will not clear ABM pipe data. At this time, change second screen to PC screen only, driver will send first command "ABM_LEVEL", it will turn on ABM with incorrect ABM pile so that DMCU is blocking.
[How]
When driver try to disable ABM, change command from "ABM LEVEL" to "ABM PIPE" so that it will clear ABM pile data.
--- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +2 -2
@@ -314,8 +314,8 @@ static bool dce_abm_immediate_disable(struct abm *abm)/* setDMCUParam_ABMLevel */ REG_UPDATE_2 (MASTER_COMM_CMD_REG , -MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_LEVEL_SET , -MASTER_COMM_CMD_REG_BYTE2 ,MCP_DISABLE_ABM_IMMEDIATELY ); +MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_PIPE_SET , +MASTER_COMM_CMD_REG_BYTE1 ,MCP_DISABLE_ABM_IMMEDIATELY );/* notifyDMCUMsg */ REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 );
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/35 drm/amd/display: Check that vrefresh is in freesync range
In reply to a message not in the archiveFrom: Ilya Bakoulin <[email protected]>
[Why]
Setting monitor refresh rate below freesync range would cause the monitor to go blank indefinitely with freesync enabled
[How]
Set vrr_supported and ignore_msa_timing_param according to whether the refresh rate is above or below the minimum freesync frequency.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -5
@@ -3113,9 +3113,6 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,update_stream_signal (stream, sink); -if (dm_state && dm_state->freesync_capable) - stream->ignore_msa_timing_param = true; - finish:if (sink && sink->sink_signal ==SIGNAL_TYPE_VIRTUAL && aconnector->base.force !=DRM_FORCE_ON )dc_sink_release (sink);
@@ -5451,10 +5448,13 @@ static void get_freesync_config_for_crtc(struct mod_freesync_config config = {0 };struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (new_con_state->base.connector); +struct drm_display_mode *mode = &new_crtc_state->base.mode; - new_crtc_state->vrr_supported = new_con_state->freesync_capable; + new_crtc_state->vrr_supported = new_con_state->freesync_capable && + aconnector->min_vfreq <=drm_mode_vrefresh (mode); -if (new_con_state->freesync_capable) { +if (new_crtc_state->vrr_supported) { + new_crtc_state->stream->ignore_msa_timing_param = true; config.state = new_crtc_state->base.vrr_enabled ?VRR_STATE_ACTIVE_VARIABLE :VRR_STATE_INACTIVE ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/35 drm/amd/display: DGAM enabled for HDR
In reply to a message not in the archiveFrom: Krunoslav Kovac <[email protected]>
[Why]
On HW that doesn't have input LUT, we may combine degamma with OS ramp Problem here is that it assumes DGAM is inverse of PQ or SRGB. It doesn't handle linear case, it would default to sRGB and always enable DGAM..
[How] Add handling for linear case. Also check for null ramp and instead of blowing up, assume it's identity.
--- .../amd/display/modules/color/color_gamma.c | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-)
drivers/gpu/drm/amd/display/modules/color/color_gamma.c +52 -37
@@ -1765,68 +1765,85 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf, {struct dc_transfer_func_distributed_points *tf_pts = &input_tf->tf_pts;struct dividers dividers; -struct pwl_float_data *rgb_user =NULL ;struct pwl_float_data_ex *curve =NULL ;struct gamma_pixel *axis_x =NULL ;struct pixel_gamma_point *coeff =NULL ;enum dc_transfer_func_predefined tf =TRANSFER_FUNCTION_SRGB ; +uint32_t i;bool ret = false;if (input_tf->type ==TF_TYPE_BYPASS )return false; -/* we can use hardcoded curve for plain SRGB TF */ +/* we can use hardcoded curve for plain SRGB TF +* If linear, it's bypass if on user ramp +*/ if (input_tf->type ==TF_TYPE_PREDEFINED && - input_tf->tf ==TRANSFER_FUNCTION_SRGB && - !mapUserRamp) + (input_tf->tf ==TRANSFER_FUNCTION_SRGB || + input_tf->tf ==TRANSFER_FUNCTION_LINEAR ) && + !mapUserRamp)return true; input_tf->type =TF_TYPE_DISTRIBUTED_POINTS ; - rgb_user =kvcalloc (ramp->num_entries + _EXTRA_POINTS, -sizeof (*rgb_user), -GFP_KERNEL ); -if (!rgb_user) - goto rgb_user_alloc_fail; +if (mapUserRamp && ramp && ramp->type ==GAMMA_RGB_256 ) { + rgb_user =kvcalloc (ramp->num_entries + _EXTRA_POINTS, +sizeof (*rgb_user), +GFP_KERNEL ); +if (!rgb_user) + goto rgb_user_alloc_fail; + + axis_x =kvcalloc (ramp->num_entries + _EXTRA_POINTS,sizeof (*axis_x), +GFP_KERNEL ); +if (!axis_x) + goto axis_x_alloc_fail; + + dividers.divider1 =dc_fixpt_from_fraction (3 ,2 ); + dividers.divider2 =dc_fixpt_from_int (2 ); + dividers.divider3 =dc_fixpt_from_fraction (5 ,2 ); + +build_evenly_distributed_points ( + axis_x, + ramp->num_entries, + dividers); + +scale_gamma (rgb_user, ramp, dividers); + } + curve =kvcalloc (MAX_HW_POINTS + _EXTRA_POINTS,sizeof (*curve), -GFP_KERNEL ); +GFP_KERNEL );if (!curve) goto curve_alloc_fail; - axis_x =kvcalloc (ramp->num_entries + _EXTRA_POINTS,sizeof (*axis_x), -GFP_KERNEL ); -if (!axis_x) - goto axis_x_alloc_fail; + coeff =kvcalloc (MAX_HW_POINTS + _EXTRA_POINTS,sizeof (*coeff), -GFP_KERNEL ); +GFP_KERNEL );if (!coeff) goto coeff_alloc_fail; - dividers.divider1 =dc_fixpt_from_fraction (3 ,2 ); - dividers.divider2 =dc_fixpt_from_int (2 ); - dividers.divider3 =dc_fixpt_from_fraction (5 ,2 ); - tf = input_tf->tf; -build_evenly_distributed_points ( - axis_x, - ramp->num_entries, - dividers); - -if (ramp->type ==GAMMA_RGB_256 && mapUserRamp) -scale_gamma (rgb_user, ramp, dividers); -else if (ramp->type ==GAMMA_RGB_FLOAT_1024 ) -scale_gamma_dx (rgb_user, ramp, dividers); -if (tf ==TRANSFER_FUNCTION_PQ )build_de_pq (curve,MAX_HW_POINTS , coordinates_x); -else +else if (tf ==TRANSFER_FUNCTION_SRGB || + tf ==TRANSFER_FUNCTION_BT709 )build_degamma (curve,MAX_HW_POINTS , coordinates_x, - tf ==TRANSFER_FUNCTION_SRGB ? true:false); + tf ==TRANSFER_FUNCTION_SRGB ? true : false); +else if (tf ==TRANSFER_FUNCTION_LINEAR ) { +// just copy coordinates_x into curve + i =0 ; +while (i !=MAX_HW_POINTS +1 ) { + curve[i].r = coordinates_x[i].x; + curve[i].g = curve[i].r; + curve[i].b = curve[i].r; + i++; + } + }else + goto invalid_tf_fail; tf_pts->end_exponent =0 ; tf_pts->x_point_at_y1_red =1 ;
@@ -1836,23 +1853,21 @@ bool mod_color_calculate_degamma_params(struct dc_transfer_func *input_tf,map_regamma_hw_to_x_user (ramp, coeff, rgb_user, coordinates_x, axis_x, curve,MAX_HW_POINTS , tf_pts, - mapUserRamp && ramp->type !=GAMMA_CUSTOM ); -if (ramp->type ==GAMMA_CUSTOM ) -apply_lut_1d (ramp,MAX_HW_POINTS , tf_pts); + mapUserRamp && ramp && ramp->type ==GAMMA_RGB_256 ); ret = true; +invalid_tf_fail:kvfree (coeff); coeff_alloc_fail: -kvfree (axis_x); -axis_x_alloc_fail:kvfree (curve); curve_alloc_fail: +kvfree (axis_x); +axis_x_alloc_fail:kvfree (rgb_user); rgb_user_alloc_fail:return ret; - }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/35 drm/amd/display: determine if a pipe is synced by plane state
In reply to a message not in the archiveFrom: Wenjing Liu <[email protected]>
[why]is_blanked is not a general indicator of if a pipe is synced for all asics.
plane state is more accurate and applicable for all asics.
[how]
Remove is_blanked call and
add checking plane_state against NULL instead.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -4
@@ -907,11 +907,11 @@ static void program_timing_sync( } } -/* set first unblanked pipe as master */ +/* set first pipe with plane as master */ for (j =0 ; j < group_size; j++) {struct pipe_ctx *temp; -if (pipe_set[j]->stream_res.tg->funcs->is_blanked && !pipe_set[j]->stream_res.tg->funcs->is_blanked (pipe_set[j]->stream_res.tg)) { +if (pipe_set[j]->plane_state) {if (j ==0 )break ;
@@ -922,9 +922,9 @@ static void program_timing_sync( } } -/* remove any other unblanked pipes as they have already been synced */ +/* remove any other pipes with plane as they have already been synced */ for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->stream_res.tg->funcs->is_blanked && !pipe_set[j]->stream_res.tg->funcs->is_blanked (pipe_set[j]->stream_res.tg)) { +if (pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/35 drm/amd/display: 3.2.16
In reply to a message not in the archiveFrom: Steven Chiu <[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
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.15" +#define DC_VER "3.2.16"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/35 drm/amd/display: add gpio lock/unlock
In reply to a message not in the archiveFrom: Chiawen Huang <[email protected]>
[Why]
When querying HPD via GPIO flow,
it will create a new gpio object then free in the end of query. There is a irql issue for HPD querying at ISR level.
[How]
Therefore, creating the HPD gpio object in dc_link and set it as unlcok in default.
1. reducing unnecessary malloc/free when HPD querying.
2. reducing init GPIO flow.
3. add lock/unlock to prevent multi gpio service running.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 47 +++++++++---------- drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + .../gpu/drm/amd/display/dc/gpio/gpio_base.c | 12 +++++ .../drm/amd/display/dc/gpio/gpio_service.c | 28 +++++++++++ .../drm/amd/display/dc/gpio/gpio_service.h | 10 ++++ .../drm/amd/display/include/gpio_interface.h | 8 ++++ 6 files changed, 81 insertions(+), 25 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +22 -25
@@ -76,6 +76,12 @@ static void destruct(struct dc_link *link) {int i; +if (link->hpd_gpio !=NULL ) { +dal_gpio_close (link->hpd_gpio); +dal_gpio_destroy_irq (&link->hpd_gpio); + link->hpd_gpio =NULL ; + } +if (link->ddc)dal_ddc_service_destroy (&link->ddc);
@@ -931,18 +937,11 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)bool dc_link_get_hpd_state (struct dc_link *dc_link) { -struct gpio *hpd_pin;uint32_t state; - hpd_pin =get_hpd_gpio (dc_link->ctx->dc_bios, - dc_link->link_id, dc_link->ctx->gpio_service); -if (hpd_pin ==NULL ) -ASSERT (false); - -dal_gpio_open (hpd_pin,GPIO_MODE_INTERRUPT ); -dal_gpio_get_value (hpd_pin, &state); -dal_gpio_close (hpd_pin); -dal_gpio_destroy_irq (&hpd_pin); +dal_gpio_lock_pin (dc_link->hpd_gpio); +dal_gpio_get_value (dc_link->hpd_gpio, &state); +dal_gpio_unlock_pin (dc_link->hpd_gpio);return state; }
@@ -1098,7 +1097,6 @@ static bool construct( const struct link_init_data *init_params) {uint8_t i; -struct gpio *hpd_gpio =NULL ;struct ddc_service_init_data ddc_service_init_data = { {0 } };struct dc_context *dc_ctx = init_params->ctx;struct encoder_init_data enc_init_data = {0 };
@@ -1128,10 +1126,11 @@ static bool construct(if (link->dc->res_pool->funcs->link_init) link->dc->res_pool->funcs->link_init (link); - hpd_gpio =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service); - -if (hpd_gpio !=NULL ) - link->irq_source_hpd =dal_irq_get_source (hpd_gpio); + link->hpd_gpio =get_hpd_gpio (link->ctx->dc_bios, link->link_id, link->ctx->gpio_service); +dal_gpio_open (link->hpd_gpio,GPIO_MODE_INTERRUPT ); +dal_gpio_unlock_pin (link->hpd_gpio); +if (link->hpd_gpio !=NULL ) + link->irq_source_hpd =dal_irq_get_source (link->hpd_gpio);switch (link->link_id.id) {case CONNECTOR_ID_HDMI_TYPE_A :
@@ -1149,18 +1148,18 @@ static bool construct(case CONNECTOR_ID_DISPLAY_PORT : link->connector_signal =SIGNAL_TYPE_DISPLAY_PORT ; -if (hpd_gpio !=NULL ) +if (link->hpd_gpio !=NULL ) link->irq_source_hpd_rx = -dal_irq_get_rx_source (hpd_gpio); +dal_irq_get_rx_source (link->hpd_gpio);break ;case CONNECTOR_ID_EDP : link->connector_signal =SIGNAL_TYPE_EDP ; -if (hpd_gpio !=NULL ) { +if (link->hpd_gpio !=NULL ) { link->irq_source_hpd =DC_IRQ_SOURCE_INVALID ; link->irq_source_hpd_rx = -dal_irq_get_rx_source (hpd_gpio); +dal_irq_get_rx_source (link->hpd_gpio); }break ;case CONNECTOR_ID_LVDS :
@@ -1171,10 +1170,7 @@ static bool construct( goto create_fail; } -if (hpd_gpio !=NULL ) { -dal_gpio_destroy_irq (&hpd_gpio); - hpd_gpio =NULL ; - } +/* TODO: #DAL3 Implement id to str function.*/ LINK_INFO("Connector[%d] description:"
@@ -1277,8 +1273,9 @@ static bool construct( ddc_create_fail: create_fail: -if (hpd_gpio !=NULL ) { -dal_gpio_destroy_irq (&hpd_gpio); +if (link->hpd_gpio !=NULL ) { +dal_gpio_destroy_irq (&link->hpd_gpio); + link->hpd_gpio =NULL ; }return false;
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -0
@@ -125,6 +125,7 @@ struct dc_link {struct dc_link_status link_status;struct link_trace link_trace; +struct gpio *hpd_gpio; };const struct dc_link_status *dc_link_get_status (const struct dc_link *dc_link);
drivers/gpu/drm/amd/display/dc/gpio/gpio_base.c +12 -0
@@ -101,6 +101,18 @@ enum gpio_mode dal_gpio_get_mode(return gpio->mode; } +enum gpio_result dal_gpio_lock_pin ( +struct gpio *gpio) +{ +return dal_gpio_service_lock (gpio->service, gpio->id, gpio->en); +} + +enum gpio_result dal_gpio_unlock_pin ( +struct gpio *gpio) +{ +return dal_gpio_service_unlock (gpio->service, gpio->id, gpio->en); +} +enum gpio_result dal_gpio_change_mode (struct gpio *gpio,enum gpio_mode mode)
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +28 -0
@@ -192,6 +192,34 @@ static void set_pin_free( service->busyness[id][en] = false; } +enum gpio_result dal_gpio_service_lock ( +struct gpio_service *service, +enum gpio_id id, +uint32_t en) +{ +if (!service->busyness[id]) { +ASSERT_CRITICAL (false); +return GPIO_RESULT_OPEN_FAILED ; + } + +set_pin_busy (service, id, en); +return GPIO_RESULT_OK ; +} + +enum gpio_result dal_gpio_service_unlock ( +struct gpio_service *service, +enum gpio_id id, +uint32_t en) +{ +if (!service->busyness[id]) { +ASSERT_CRITICAL (false); +return GPIO_RESULT_OPEN_FAILED ; + } + +set_pin_free (service, id, en); +return GPIO_RESULT_OK ; +} + enum gpio_result dal_gpio_service_open( struct gpio_service *service, enum gpio_id id,
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.h +10 -0
@@ -52,4 +52,14 @@ void dal_gpio_service_close(struct gpio_service *service, struct hw_gpio_pin **ptr); +enum gpio_result dal_gpio_service_lock ( +struct gpio_service *service, +enum gpio_id id, +uint32_t en); + +enum gpio_result dal_gpio_service_unlock ( +struct gpio_service *service, +enum gpio_id id, +uint32_t en); +#endif
drivers/gpu/drm/amd/display/include/gpio_interface.h +8 -0
@@ -59,6 +59,14 @@ enum gpio_result dal_gpio_change_mode(struct gpio *gpio, enum gpio_mode mode); +/* Lock Pin */ +enum gpio_result dal_gpio_lock_pin ( +struct gpio *gpio); + +/* Unlock Pin */ +enum gpio_result dal_gpio_unlock_pin ( +struct gpio *gpio); +/* Get the GPIO id */ enum gpio_id dal_gpio_get_id (const struct gpio *gpio);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/35 drm/amd/display: make vline_config parameter const.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1560,11 +1560,11 @@ static void commit_planes_do_stream_update(struct dc *dc,if (stream_update->vline0_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE0 , stream->vline0_config); + pipe_ctx->stream_res.tg,VLINE0 , &stream->vline0_config);if (stream_update->vline1_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE1 , stream->vline1_config); + pipe_ctx->stream_res.tg,VLINE1 , &stream->vline1_config); if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +4 -4
@@ -95,19 +95,19 @@ static void optc1_disable_stereo(struct timing_generator *optc)void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config) +const struct vline_config *vline_config) {struct optc *optc1 =DCN10TG_FROM_TG (optc);switch (vline) {case VLINE0 :REG_SET_2 (OTG_VERTICAL_INTERRUPT0_POSITION ,0 , -OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config.start_line, -OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config.end_line); +OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config->start_line, +OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config->end_line);break ;case VLINE1 :REG_SET (OTG_VERTICAL_INTERRUPT1_POSITION ,0 , -OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config.start_line); +OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config->start_line);break ;default :break ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1 -1
@@ -485,7 +485,7 @@ void optc1_program_timing(void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -1
@@ -151,7 +151,7 @@ struct timing_generator_funcs { bool use_vbios);void (*program_vline_interrupt)(struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
Signature · 6 lines
2.17.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): 20190201152847.11151-16-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 15/35] drm/amd/display: make vline_config parameter const.
Hi,
It seems the commit title is a little confusing. The change is to now pass by (const) reference rather than by value.
Regards
Nils
Den fre 1 feb. 2019 16:29 skrev Bhawanpreet Lakha <[email protected]
Quoted 111 lines
:
From: Yongqiang Sun <[email protected]>
Change-Id Icfe018c7579ad2b3ef65195f578b8e44422d53f3Signed-off-by Yongqiang Sun <[email protected]>Reviewed-by Aric Cyr <[email protected]>--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/display/dc/core/dc.c +0
-0@@ -1560,11 +1560,11 @@ static void commit_planes_do_stream_update(struct dc *dc, if (stream_update->vline0_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt)pipe_ctx->stream_res.tg->funcs->program_vline_interrupt(
-pipe_ctx->stream_res.tg, VLINE0,stream->vline0_config);
+pipe_ctx->stream_res.tg, VLINE0,&stream->vline0_config);if (stream_update->vline1_config &&
pipe_ctx->stream_res.tg->funcs->program_vline_interrupt)pipe_ctx->stream_res.tg->funcs->program_vline_interrupt(
-pipe_ctx->stream_res.tg, VLINE1,stream->vline1_config);
+pipe_ctx->stream_res.tg, VLINE1,&stream->vline1_config);if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +3
-3@@ -95,19 +95,19 @@ static void optc1_disable_stereo(struct timing_generator *optc)void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config) +const struct vline_config *vline_config) {struct optc *optc1 =DCN10TG_FROM_TG (optc);switch (vline) {case VLINE0 :REG_SET_2 (OTG_VERTICAL_INTERRUPT0_POSITION ,0 , -OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config.start_line, -OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config.end_line); +OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config->start_line, +OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config->end_line);break ;case VLINE1 :REG_SET(OTG_VERTICAL_INTERRUPT1_POSITION, 0,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +1
-1- OTG_VERTICAL_INTERRUPT1_LINE_START, vline_config.start_line); + OTG_VERTICAL_INTERRUPT1_LINE_START, vline_config->start_line);break ;default :break ;drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1
-1@@ -485,7 +485,7 @@ void optc1_program_timing(void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);void optc1_program_global_sync (struct timing_generator *optc);drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1
-2@@ -151,7 +151,7 @@ struct timing_generator_funcs { bool use_vbios);void (*program_vline_interrupt)(struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg); --2.17.1
Quoted 5 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): CA+nq7DtCqojJynhoxwyPnUGXf4gPzkrypi7dUT_ahQ9DDygqKQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
PATCH 15/35 drm/amd/display: pass vline_config parameter by reference.
From: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1560,11 +1560,11 @@ static void commit_planes_do_stream_update(struct dc *dc,if (stream_update->vline0_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE0 , stream->vline0_config); + pipe_ctx->stream_res.tg,VLINE0 , &stream->vline0_config);if (stream_update->vline1_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE1 , stream->vline1_config); + pipe_ctx->stream_res.tg,VLINE1 , &stream->vline1_config); if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +4 -4
@@ -95,19 +95,19 @@ static void optc1_disable_stereo(struct timing_generator *optc)void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config) +const struct vline_config *vline_config) {struct optc *optc1 =DCN10TG_FROM_TG (optc);switch (vline) {case VLINE0 :REG_SET_2 (OTG_VERTICAL_INTERRUPT0_POSITION ,0 , -OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config.start_line, -OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config.end_line); +OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config->start_line, +OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config->end_line);break ;case VLINE1 :REG_SET (OTG_VERTICAL_INTERRUPT1_POSITION ,0 , -OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config.start_line); +OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config->start_line);break ;default :break ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1 -1
@@ -485,7 +485,7 @@ void optc1_program_timing(void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -1
@@ -151,7 +151,7 @@ struct timing_generator_funcs { bool use_vbios);void (*program_vline_interrupt)(struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
Signature · 6 lines
2.17.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): 20190204154522.22215-15-Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org
PATCH 15/35 drm/amd/display: pass vline_config parameter by reference.
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Bhawanpreet Lakha <[email protected]>
Sent: February 4, 2019 10:45 AM
To: [email protected]
Cc: Sun, Yongqiang
Subject: [PATCH 15/35] drm/amd/display: pass vline_config parameter by reference.
From: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 8 ++++---- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -2
@@ -1560,11 +1560,11 @@ static void commit_planes_do_stream_update(struct dc *dc,if (stream_update->vline0_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE0 , stream->vline0_config); + pipe_ctx->stream_res.tg,VLINE0 , &stream->vline0_config);if (stream_update->vline1_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE1 , stream->vline1_config); + pipe_ctx->stream_res.tg,VLINE1 , &stream->vline1_config); if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +4 -4
@@ -95,19 +95,19 @@ static void optc1_disable_stereo(struct timing_generator *optc)void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config) +const struct vline_config *vline_config) {struct optc *optc1 =DCN10TG_FROM_TG (optc);switch (vline) {case VLINE0 :REG_SET_2 (OTG_VERTICAL_INTERRUPT0_POSITION ,0 , -OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config.start_line, -OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config.end_line); +OTG_VERTICAL_INTERRUPT0_LINE_START , vline_config->start_line, +OTG_VERTICAL_INTERRUPT0_LINE_END , vline_config->end_line);break ;case VLINE1 :REG_SET (OTG_VERTICAL_INTERRUPT1_POSITION ,0 , -OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config.start_line); +OTG_VERTICAL_INTERRUPT1_LINE_START , vline_config->start_line);break ;default :break ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1 -1
@@ -485,7 +485,7 @@ void optc1_program_timing(void optc1_program_vline_interrupt (struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +1 -1
@@ -151,7 +151,7 @@ struct timing_generator_funcs { bool use_vbios);void (*program_vline_interrupt)(struct timing_generator *optc,enum vline_select vline, -struct vline_config vline_config); +const struct vline_config *vline_config);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives.. Using amd-gfx: To post a message to all the list members, send email to [email protected] You can subscribe to the list, or change your existing subscription, in the sections below.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/35 drm/amd/display: Modify ABM 2.2 Max Reduction
In reply to a message not in the archiveFrom: Josip Pavic <[email protected]>
[Why]
Reduced backlight for ABM 2.2 at levels 1 and 2 is desired for power savings.
[How]
Reduce the max reduction parameters for ABM 2.2
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 -2
@@ -47,10 +47,10 @@ static const unsigned char min_reduction_table_v_2_2[13] = {/* Possible ABM 2.2 Max Reduction configs from least aggressive to most aggressive * 0 1 2 3 4 5 6 7 8 9 10 11 12 -* 96.1 89.8 85.1 80.3 69.4 64.7 54.9 45.1 30.2 25.1 19.6 12.5 12.5 % +* 96.1 89.8 74.9 69.4 64.7 52.2 48.6 39.6 30.2 25.1 19.6 12.5 12.5 % */ static const unsigned char max_reduction_table_v_2_2[13 ] = { -0xf5 ,0xe5 ,0xd9 ,0xcd ,0xb1 ,0xa5 ,0x8c ,0x73 ,0x4d ,0x40 ,0x32 ,0x20 ,0x20 }; +0xf5 ,0xe5 ,0xbf ,0xb1 ,0xa5 ,0x85 ,0x7c ,0x65 ,0x4d ,0x40 ,0x32 ,0x20 ,0x20 };/* Predefined ABM configuration sets. We may have different configuration sets * in order to satisfy different power/quality requirements.
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/35 drm/amd/display: store timing sync info in dc_stream_status
In reply to a message not in the archiveFrom: Su Sung Chung <[email protected]>
in program_timing_sync, after all the pipes are grouped, store timing sync info in dc_stream_status
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 16 +++++++++++++++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +15 -1
@@ -869,8 +869,9 @@ static void program_timing_sync(struct dc *dc, struct dc_state *ctx) { - int i, j; + int i, j, k;int group_index =0 ; +int num_group =0 ;int pipe_count = dc->res_pool->pipe_count;struct pipe_ctx *unsynced_pipes[MAX_PIPES ] = {NULL };
@@ -922,6 +923,18 @@ static void program_timing_sync( } } + +for (k =0 ; k < group_size; k++) { +struct dc_stream_status *status =dc_stream_get_status_from_state (ctx, pipe_set[k]->stream); + + status->timing_sync_info.group_id = num_group; + status->timing_sync_info.group_size = group_size; +if (k ==0 ) + status->timing_sync_info.master = true; +else + status->timing_sync_info.master = false; + + }/* remove any other pipes with plane as they have already been synced */ for (j = j +1 ; j < group_size; j++) {if (pipe_set[j]->plane_state) {
@@ -936,6 +949,7 @@ static void program_timing_sync( dc, group_index, group_size, pipe_set); group_index++; } + num_group++; } }
drivers/gpu/drm/amd/display/dc/dc_stream.h +6 -0
@@ -32,11 +32,17 @@/******************************************************************************* * Stream Interfaces ******************************************************************************/ +struct timing_sync_info { +int group_id; +int group_size; +bool master; +};struct dc_stream_status {int primary_otg_inst;int stream_enc_inst;int plane_count; +struct timing_sync_info timing_sync_info;struct dc_plane_state *plane_states[MAX_SURFACE_NUM ]; };
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/35 drm/amd/display: add a debug flag to force odm combine
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
Adding a bit vector to allow forcing odm on specific otgs
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -255,6 +255,7 @@ struct dc_debug_options {bool scl_reset_length10;bool hdmi20_disable;bool skip_detection_link_training; +unsigned int force_odm_combine;//bit vector based on otg inst unsigned int force_fclk_khz; };
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/35 drm/amd/display: Apply fake sink back to MST sequence
In reply to a message not in the archiveFrom: "Jerry (Fangzhi) Zuo" <[email protected]>
[Why]
It fixes the failure to create stream for sink in the scenario when hotplug SST and MST in sequence, and disconnect MST.
[How]
Add the fake sink back after the majority of MST rework is done.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +++----- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -5
@@ -3042,11 +3042,9 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, drm_connector = &aconnector->base;if (!aconnector->dc_sink) { -if (!aconnector->mst_port) { - sink =create_fake_sink (aconnector); -if (!sink) -return stream; - } + sink =create_fake_sink (aconnector); +if (!sink) +return stream; }else { sink = aconnector->dc_sink; }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -0
@@ -173,6 +173,9 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) aconnector->edid = edid; } +if (aconnector->dc_sink && aconnector->dc_sink->sink_signal ==SIGNAL_TYPE_VIRTUAL ) +dc_sink_release (aconnector->dc_sink); +if (!aconnector->dc_sink) {struct dc_sink *dc_sink;struct dc_sink_init_data init_params = {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/35 drm/amd/display: Disconnect mpcc when changing tg
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
This fixes an mpc programming error for the following sequence of atomic commits when pipe split is enabled:
Commit 1: CRTC0 (plane 4, plane 3)
Pipe 0: old_plane_state = A0, new_plane_state = A1, new_tg = T0
Pipe 1: old_plane_state = B0, new_plane_state = B1, new_tg = T0
Pipe 2: old_plane_state = A0, new_plane_state = A1, new_tg = T0
Pipe 3: old_plane_state = B0, new_plane_state = B1, new_tg = T0
Commit 2: CRTC0 (plane 3), CRTC1 (plane 2)
Pipe 0: old_plane_state = A1, new_plane_state = A2, new_tg = T0
Pipe 1: old_plane_state = B1, new_plane_state = B2, new_tg = T1
Pipe 2: old_plane_state = A1, new_plane_state = NULL, new_tg = NULL Pipe 3: old_plane_state = B1, new_plane_state = NULL, new_tg = NULL
In the second commit the assertion for mpcc in use is hit because mpcc disconnect never occurs for pipe 1. This is because the stream changes for pipe 1 and the opp_list is empty.
This sequence occurs when running the "igt@kms_plane_multiple@atomic-pipe-A-tiling-none" test with two displays connected.
[How]
Expand the reset condition to include:
"old_pipe_ctx->stream_res.tg != new_pipe_ctx->stream_res.tg"
...but only when the plane state is non-NULL for both old and new.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +4 -3
@@ -2334,9 +2334,10 @@ static void dcn10_apply_ctx_for_surface( } } -if (!pipe_ctx->plane_state && - old_pipe_ctx->plane_state && - old_pipe_ctx->stream_res.tg == tg) { +if ((!pipe_ctx->plane_state || + pipe_ctx->stream_res.tg != old_pipe_ctx->stream_res.tg) && + old_pipe_ctx->plane_state && + old_pipe_ctx->stream_res.tg == tg) { dc->hwss.plane_atomic_disconnect (dc, old_pipe_ctx); removed_pipe[i] = true;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/35 drm/amd/display: Don't re-program planes for DPMS changes
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
There are opt1c lock warnings and CRTC read timeouts when running the "igt@kms_plane@plane-position-hole-dpms-pipe-*" tests. These are caused by trying to reprogram planes that are not in the current context.
DPMS off removes the stream from the context. In this case:
new_crtc_state->active_changed = truenew_crtc_state->mode_changed = false
The planes are reprogrammed before the stream is removed from the context because stream_state->mode_changed = false.
For DPMS adds the stream and planes back to the context:
new_crtc_state->active_changed = truenew_crtc_state->mode_changed = false
The planes are also reprogrammed here before the stream is added to the context because stream_state->mode_changed = true. They were not previously in the current context so warnings occur here.
[How]
Set stream_state->mode_changed = true whennew_crtc_state->active_changed = true too.
This prevents reprogramming before the context is applied in DC. The programming will be done after the context is applied.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -4976,7 +4976,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,static void amdgpu_dm_crtc_copy_transient_flags (struct drm_crtc_state *crtc_state,struct dc_stream_state *stream_state) { - stream_state->mode_changed = crtc_state->mode_changed; + stream_state->mode_changed = + crtc_state->mode_changed || crtc_state->active_changed; } static int amdgpu_dm_atomic_commit(struct drm_device *dev,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/35 drm/amd/display: Clear dc_sink after it gets released
In reply to a message not in the archiveFrom: "Jerry (Fangzhi) Zuo" <[email protected]>
[Why]
The dc_sink was released but the pointer on the aconnector was not cleared.
[How]
Clear it.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +3 -1
@@ -173,8 +173,10 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) aconnector->edid = edid; } -if (aconnector->dc_sink && aconnector->dc_sink->sink_signal ==SIGNAL_TYPE_VIRTUAL ) +if (aconnector->dc_sink && aconnector->dc_sink->sink_signal ==SIGNAL_TYPE_VIRTUAL ) {dc_sink_release (aconnector->dc_sink); + aconnector->dc_sink =NULL ; + }if (!aconnector->dc_sink) {struct dc_sink *dc_sink;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/35 drm/amd/display: Calc vline position in dc.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
We need to calcualte vline position in DC for DCN.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 8 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 15 ++-- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 80 ++++++++++++++++++- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 6 +- .../amd/display/dc/inc/hw/timing_generator.h | 8 +- 5 files changed, 97 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -4
@@ -1572,13 +1572,13 @@ static void commit_planes_do_stream_update(struct dc *dc, stream_update->adjust->v_total_min, stream_update->adjust->v_total_max); -if (stream_update->vline0_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) +if (stream_update->periodic_vsync_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE0 , &stream->vline0_config); + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing,VLINE0 , &stream->periodic_vsync_config); -if (stream_update->vline1_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) +if (stream_update->enhanced_sync_config && pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( - pipe_ctx->stream_res.tg,VLINE1 , &stream->vline1_config); + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing,VLINE1 , &stream->enhanced_sync_config); if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||
drivers/gpu/drm/amd/display/dc/dc_stream.h +8 -7
@@ -51,11 +51,12 @@ struct freesync_context {bool dummy; }; -struct vline_config { -unsigned int start_line; -unsigned int end_line; +union vline_config { +unsigned int line_number; +unsigned long long delta_in_ns; }; +struct dc_stream_state {// sink is deprecated, new code should not reference // this pointer
@@ -105,8 +106,8 @@ struct dc_stream_state {/* DMCU info */ unsigned int abm_level; -struct vline_config vline0_config; -struct vline_config vline1_config; +union vline_config periodic_vsync_config; +union vline_config enhanced_sync_config;/* from core_stream struct */ struct dc_context *ctx;
@@ -155,8 +156,8 @@ struct dc_stream_update {struct dc_info_packet *hdr_static_metadata;unsigned int *abm_level; -struct vline_config *vline0_config; -struct vline_config *vline1_config; +union vline_config *periodic_vsync_config; +union vline_config *enhanced_sync_config;struct dc_crtc_timing_adjust *adjust;struct dc_info_packet *vrr_infopacket;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +76 -4
98 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +4 -2
@@ -483,9 +483,11 @@ void optc1_program_timing(const struct dc_crtc_timing *dc_crtc_timing, bool use_vbios); -void optc1_program_vline_interrupt (struct timing_generator *optc, +void optc1_program_vline_interrupt ( +struct timing_generator *optc, +const struct dc_crtc_timing *dc_crtc_timing,enum vline_select vline, -const struct vline_config *vline_config); +const union vline_config *vline_config);void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +5 -3
@@ -134,7 +134,7 @@ struct dc_crtc_timing;struct drr_params ; -struct vline_config ; +union vline_config ;enum vline_select {
@@ -149,9 +149,11 @@ struct timing_generator_funcs {void (*program_timing)(struct timing_generator *tg,const struct dc_crtc_timing *timing,bool use_vbios); -void (*program_vline_interrupt)(struct timing_generator *optc, +void (*program_vline_interrupt)( +struct timing_generator *optc, +const struct dc_crtc_timing *dc_crtc_timing,enum vline_select vline, -const struct vline_config *vline_config); +const union vline_config *vline_config);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/35 drm/amd/display: Disable Stutter for Stereo 3D
In reply to a message not in the archiveFrom: Wesley Chalmers <[email protected]>
[WHY]
Bandwidth calculation formulas currently do not take Stereo 3D + Stutter properly into account. Disable stutter feature when we detect a Stereo 3D mode as a temporary workaround.
--- .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 19 ++++++++++-------- .../drm/amd/display/dc/dcn10/dcn10_hubbub.h | 2 +- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 20 ++++++++++++++++++- 3 files changed, 31 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +11 -8
@@ -88,11 +88,18 @@ void hubbub1_wm_read_state(struct hubbub *hubbub, s->dram_clk_chanage =REG_READ (DCHUBBUB_ARB_ALLOW_DRAM_CLK_CHANGE_WATERMARK_D ); } -void hubbub1_disable_allow_self_refresh (struct hubbub *hubbub) +void hubbub1_allow_self_refresh_control (struct hubbub *hubbub,bool allow) {struct dcn10_hubbub *hubbub1 =TO_DCN10_HUBBUB (hubbub); -REG_UPDATE (DCHUBBUB_ARB_DRAM_STATE_CNTL , -DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE ,0 ); + +/* +* DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE = 1 means do not allow stutter +* DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE = 0 means allow stutter +*/ + +REG_UPDATE_2 (DCHUBBUB_ARB_DRAM_STATE_CNTL , +DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE ,0 , +DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE , !allow); }bool hububu1_is_allow_self_refresh_enabled (struct hubbub *hubbub)
@@ -262,8 +269,6 @@ void hubbub1_program_watermarks( bool safe_to_lower) {struct dcn10_hubbub *hubbub1 =TO_DCN10_HUBBUB (hubbub); - -uint32_t force_en = hubbub1->base.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
@@ -537,9 +542,7 @@ void hubbub1_program_watermarks(REG_UPDATE (DCHUBBUB_ARB_DF_REQ_OUTSTAND ,DCHUBBUB_ARB_MIN_REQ_OUTSTAND ,68 ); -REG_UPDATE_2 (DCHUBBUB_ARB_DRAM_STATE_CNTL , -DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_VALUE ,0 , -DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE , force_en); +hubbub1_allow_self_refresh_control (hubbub, !hubbub->ctx->dc->debug.disable_stutter);#if 0 REG_UPDATE_2(DCHUBBUB_ARB_WATERMARK_CHANGE_CNTL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +1 -1
@@ -204,7 +204,7 @@ void hubbub1_program_watermarks(unsigned int refclk_mhz, bool safe_to_lower); -void hubbub1_disable_allow_self_refresh (struct hubbub *hubbub); +void hubbub1_allow_self_refresh_control (struct hubbub *hubbub,bool allow);bool hububu1_is_allow_self_refresh_enabled (struct hubbub *hubub);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +19 -1
@@ -1011,7 +1011,7 @@ static void dcn10_init_hw(struct dc *dc)*/ if (allow_self_fresh_force_enable == false &&hububu1_is_allow_self_refresh_enabled (dc->res_pool->hubbub)) -hubbub1_disable_allow_self_refresh (dc->res_pool->hubbub); +hubbub1_allow_self_refresh_control (dc->res_pool->hubbub, true);disable_vga (dc->hwseq); }
@@ -2384,6 +2384,22 @@ static void dcn10_apply_ctx_for_surface(hubbub1_wm_change_req_wa (dc->res_pool->hubbub); } +static void dcn10_stereo_hw_frame_pack_wa (struct dc *dc,struct dc_state *context) +{ +uint8_t i; + +for (i =0 ; i < context->stream_count; i++) { +if (context->streams[i]->timing.timing_3d_format + ==TIMING_3D_FORMAT_HW_FRAME_PACKING ) { +/* +* Disable stutter +*/ +hubbub1_allow_self_refresh_control (dc->res_pool->hubbub, false); +break ; + } + } +} +static void dcn10_prepare_bandwidth (struct dc *dc,struct dc_state *context)
@@ -2405,6 +2421,7 @@ static void dcn10_prepare_bandwidth( &context->bw.dcn.watermarks, dc->res_pool->ref_clock_inKhz /1000 , true); +dcn10_stereo_hw_frame_pack_wa (dc, context);if (dc->debug.pplib_wm_report_mode ==WM_REPORT_OVERRIDE )dcn_bw_notify_pplib_of_wm_ranges (dc);
@@ -2434,6 +2451,7 @@ static void dcn10_optimize_bandwidth( &context->bw.dcn.watermarks, dc->res_pool->ref_clock_inKhz /1000 , true); +dcn10_stereo_hw_frame_pack_wa (dc, context);if (dc->debug.pplib_wm_report_mode ==WM_REPORT_OVERRIDE )dcn_bw_notify_pplib_of_wm_ranges (dc);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/35 drm/amd/display: DC VM Fixes
In reply to a message not in the archiveFrom: Eryk Brol <[email protected]>
[Why]VM_helper needs to be intialized with the dc struct in order to fix an unallocated memory issue. System aperture settings should be initialized to 0 and guarded with a check to make sure vm_config is valid.
[How]
Allocate and free memory for vm_helper with other dc members. Check whether the vm_config valid bit is set before initializing aperture settings.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 - .../gpu/drm/amd/display/dc/core/dc_vm_helper.c | 18 +++++++----------- drivers/gpu/drm/amd/display/dc/dc.h | 1 - drivers/gpu/drm/amd/display/dc/inc/vm_helper.h | 7 ++++--- 4 files changed, 11 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -1
@@ -621,7 +621,6 @@ static bool construct(struct dc *dc,#endif enum dce_version dc_version =DCE_VERSION_UNKNOWN ; - dc_dceip =kzalloc (sizeof (*dc_dceip),GFP_KERNEL );if (!dc_dceip) {dm_error ("%s: failed to create dceip\n" , __func__);
drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c +7 -11
@@ -112,16 +112,12 @@ uint8_t get_vmid_for_ptb(struct vm_helper *vm_helper, int64_t ptb, uint8_t hubp_return vmid; } -struct vm_helper init_vm_helper (unsigned int num_vmid,unsigned int num_hubp) +void init_vm_helper (struct vm_helper *vm_helper,unsigned int num_vmid,unsigned int num_hubp) { -static uint64_t ptb_assigned_to_vmid[MAX_VMID ]; -static struct vmid_usage hubp_vmid_usage[MAX_HUBP ]; - -return (struct vm_helper ){ - .num_vmid = num_vmid, - .num_hubp = num_hubp, - .num_vmids_available = num_vmid -1 , - .ptb_assigned_to_vmid = ptb_assigned_to_vmid, - .hubp_vmid_usage = hubp_vmid_usage - }; + vm_helper->num_vmid = num_vmid; + vm_helper->num_hubp = num_hubp; + vm_helper->num_vmids_available = num_vmid -1 ; + +memset (vm_helper->hubp_vmid_usage,0 ,sizeof (vm_helper->hubp_vmid_usage[0 ]) *MAX_HUBP ); +memset (vm_helper->ptb_assigned_to_vmid,0 ,sizeof (vm_helper->ptb_assigned_to_vmid[0 ]) *MAX_VMID ); }
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -265,7 +265,6 @@ struct dc_debug_data {uint32_t auxErrorCount; }; -struct dc_state ;struct resource_pool ;struct dce_hwseq ;
drivers/gpu/drm/amd/display/dc/inc/vm_helper.h +4 -3
@@ -39,8 +39,8 @@ struct vm_helper {unsigned int num_vmid;unsigned int num_hubp;unsigned int num_vmids_available; -uint64_t *ptb_assigned_to_vmid; -struct vmid_usage *hubp_vmid_usage; +uint64_t ptb_assigned_to_vmid[MAX_VMID ]; +struct vmid_usage hubp_vmid_usage[MAX_HUBP ]; }; uint8_t get_vmid_for_ptb(
@@ -48,7 +48,8 @@ uint8_t get_vmid_for_ptb(int64_t ptb, uint8_t pipe_idx); -struct vm_helper init_vm_helper ( +void init_vm_helper ( +struct vm_helper *vm_helper,unsigned int num_vmid,unsigned int num_hubp);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/35 drm/amd/display: link_rate_set should index into table
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Current implementation that maps link_rate_set value to actual link rate is incorrect.
[How]
Fix this implementation, such that link_rate_set indexes into the supported_link_rate table.
--- .../gpu/drm/amd/display/dc/core/dc_link_dp.c | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -34
@@ -2538,7 +2538,6 @@ void detect_edp_sink_caps(struct dc_link *link)uint32_t entry;uint32_t link_rate_in_khz;enum dc_link_rate link_rate =LINK_RATE_UNKNOWN ; -uint8_t link_rate_set =0 ;retrieve_link_cap (link);
@@ -2558,39 +2557,7 @@ void detect_edp_sink_caps(struct dc_link *link) link_rate =linkRateInKHzToLinkRateMultiplier (link_rate_in_khz);if (link->reported_link_cap.link_rate < link_rate) { link->reported_link_cap.link_rate = link_rate; - -switch (link_rate) { -case LINK_RATE_LOW : - link_rate_set =1 ; -break ; -case LINK_RATE_RATE_2 : - link_rate_set =2 ; -break ; -case LINK_RATE_RATE_3 : - link_rate_set =3 ; -break ; -case LINK_RATE_HIGH : - link_rate_set =4 ; -break ; -case LINK_RATE_RBR2 : - link_rate_set =5 ; -break ; -case LINK_RATE_RATE_6 : - link_rate_set =6 ; -break ; -case LINK_RATE_HIGH2 : - link_rate_set =7 ; -break ; -case LINK_RATE_HIGH3 : - link_rate_set =8 ; -break ; -default : - link_rate_set =0 ; -break ; - } - -if (link->dpcd_caps.link_rate_set < link_rate_set) - link->dpcd_caps.link_rate_set = link_rate_set; + link->dpcd_caps.link_rate_set = entry; } } }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/35 drm/amd/display: PIP overlay corruption
In reply to a message not in the archiveFrom: Murton Liu <[email protected]>
[Why]
When moving mouse onto or off of pip plane, screen would flash briefly due to garbage negative pos values being programmed for cursor. Also, text flashes due to PIP flips taking too long.
[How]
When negative pos value seen, default to 0 and adjust by modifying cursor hotspot. For flip issue, only do post update when optimize required vs all the time.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 23 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1125,6 +1125,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)int i;struct dc_state *context = dc->current_state; +if (dc->optimized_required == false) +return true; +post_surface_trace (dc);for (i =0 ; i < dc->res_pool->pipe_count; i++)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +21 -2
@@ -1150,9 +1150,28 @@ void hubp1_cursor_set_position(REG_UPDATE (CURSOR_CONTROL ,CURSOR_ENABLE , cur_en); -REG_SET_2 (CURSOR_POSITION ,0 , -CURSOR_X_POSITION , pos->x, +//account for cases where we see negative offset relative to overlay plane +if (src_x_offset <0 && src_y_offset <0 ) { +REG_SET_2 (CURSOR_POSITION ,0 , +CURSOR_X_POSITION ,0 , +CURSOR_Y_POSITION ,0 ); + x_hotspot -= src_x_offset; + y_hotspot -= src_y_offset; + }else if (src_x_offset <0 ) { +REG_SET_2 (CURSOR_POSITION ,0 , +CURSOR_X_POSITION ,0 ,CURSOR_Y_POSITION , pos->y); + x_hotspot -= src_x_offset; + }else if (src_y_offset <0 ) { +REG_SET_2 (CURSOR_POSITION ,0 , +CURSOR_X_POSITION , pos->x, +CURSOR_Y_POSITION ,0 ); + y_hotspot -= src_y_offset; + }else { +REG_SET_2 (CURSOR_POSITION ,0 , +CURSOR_X_POSITION , pos->x, +CURSOR_Y_POSITION , pos->y); + } REG_SET_2(CURSOR_HOT_SPOT, 0, CURSOR_HOT_SPOT_X, x_hotspot,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/35 drm/amd/display:3.2.17
In reply to a message not in the archiveFrom: mmcgarri <[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
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.16" +#define DC_VER "3.2.17"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 29/35 drm/amd/display: interface to check if timing can be seamless
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Need to figure out whether a timing we want to commit matches something that GOP already programmed, in which case we can decide to some optimizations
[How]
1. Add way to check for DIG FE
2. Add way to check for matching OTG timing
3. Add way to check for matching pixel clock (if possible)
- Currently only support DP for pixel clock, since it is easy to calc
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 46 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 4 ++ .../drm/amd/display/dc/dce/dce_clock_source.c | 28 ++++++++- .../amd/display/dc/dcn10/dcn10_link_encoder.c | 10 ++++ .../amd/display/dc/dcn10/dcn10_link_encoder.h | 2 + .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 59 +++++++++++++++++++ .../gpu/drm/amd/display/dc/inc/clock_source.h | 4 ++ .../drm/amd/display/dc/inc/hw/link_encoder.h | 1 + .../amd/display/dc/inc/hw/timing_generator.h | 2 + 9 files changed, 154 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +46 -0
@@ -969,6 +969,52 @@ static bool context_changed(return false; } +bool dc_validate_seamless_boot_timing (struct dc *dc, +const struct dc_sink *sink, +struct dc_crtc_timing *crtc_timing) +{ +struct timing_generator *tg; +struct dc_link *link = sink->link; +unsigned int inst; + +/* Check for enabled DIG to identify enabled display */ +if (!link->link_enc->funcs->is_dig_enabled (link->link_enc)) +return false; + +/* Check for which front end is used by this encoder. +* Note the inst is 1 indexed, where 0 is undefined. +* Note that DIG_FE can source from different OTG but our +* current implementation always map 1-to-1, so this code makes +* the same assumption and doesn't check OTG source. +*/ + inst = link->link_enc->funcs->get_dig_frontend (link->link_enc) -1 ; + +/* Instance should be within the range of the pool */ +if (inst >= dc->res_pool->pipe_count) +return false; + + tg = dc->res_pool->timing_generators[inst]; + +if (!tg->funcs->is_matching_timing) +return false; + +if (!tg->funcs->is_matching_timing (tg, crtc_timing)) +return false; + +if (dc_is_dp_signal (link->connector_signal)) { +unsigned int pix_clk_100hz; + + dc->res_pool->dp_clock_source->funcs->get_pixel_clk_frequency_100hz ( + dc->res_pool->dp_clock_source, + inst, &pix_clk_100hz); + +if (crtc_timing->pix_clk_100hz != pix_clk_100hz) +return false; + } + +return true; +} + bool dc_enable_stereo( struct dc *dc, struct dc_state *context,
drivers/gpu/drm/amd/display/dc/dc.h +4 -0
@@ -594,6 +594,10 @@ struct dc_validation_set {uint8_t plane_count; }; +bool dc_validate_seamless_boot_timing (struct dc *dc, +const struct dc_sink *sink, +struct dc_crtc_timing *crtc_timing); +enum dc_status dc_validate_plane (struct dc *dc,const struct dc_plane_state *plane_state);void get_clock_requirements_for_state (struct dc_state *state,struct AsicStateEx *info);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +26 -2
@@ -977,6 +977,28 @@ static bool dce110_clock_source_power_down(return bp_result ==BP_RESULT_OK ; } +static bool get_pixel_clk_frequency_100hz ( +struct clock_source *clock_source, +unsigned int inst, +unsigned int *pixel_clk_khz) +{ +struct dce110_clk_src *clk_src =TO_DCE110_CLK_SRC (clock_source); +unsigned int clock_hz =0 ; + +if (clock_source->id ==CLOCK_SOURCE_ID_DP_DTO ) { + clock_hz =REG_READ (PHASE [inst]); + +/* NOTE: There is agreement with VBIOS here that MODULO is +* programmed equal to DPREFCLK, in which case PHASE will be +* equivalent to pixel clock. +*/ + *pixel_clk_khz = clock_hz /100 ; +return true; + } + +return false; +} +/*****************************************/ /* Constructor */ /*****************************************/
@@ -984,12 +1006,14 @@ static bool dce110_clock_source_power_down(static const struct clock_source_funcs dce112_clk_src_funcs = { .cs_power_down = dce110_clock_source_power_down, .program_pix_clk = dce112_program_pix_clk, - .get_pix_clk_dividers = dce112_get_pix_clk_dividers + .get_pix_clk_dividers = dce112_get_pix_clk_dividers, + .get_pixel_clk_frequency_100hz = get_pixel_clk_frequency_100hz };static const struct clock_source_funcs dce110_clk_src_funcs = { .cs_power_down = dce110_clock_source_power_down, .program_pix_clk = dce110_program_pix_clk, - .get_pix_clk_dividers = dce110_get_pix_clk_dividers + .get_pix_clk_dividers = dce110_get_pix_clk_dividers, + .get_pixel_clk_frequency_100hz = get_pixel_clk_frequency_100hz };
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +10 -0
@@ -85,6 +85,7 @@ static const struct link_encoder_funcs dcn10_lnk_enc_funcs = { .enable_hpd = dcn10_link_encoder_enable_hpd, .disable_hpd = dcn10_link_encoder_disable_hpd, .is_dig_enabled = dcn10_is_dig_enabled, + .get_dig_frontend = dcn10_get_dig_frontend, .destroy = dcn10_link_encoder_destroy };
@@ -495,6 +496,15 @@ bool dcn10_is_dig_enabled(struct link_encoder *enc)return value; } +unsigned int dcn10_get_dig_frontend (struct link_encoder *enc) +{ +struct dcn10_link_encoder *enc10 =TO_DCN10_LINK_ENC (enc); +uint32_t value; + +REG_GET (DIG_BE_CNTL ,DIG_FE_SOURCE_SELECT , &value); +return value; +} +static void link_encoder_disable (struct dcn10_link_encoder *enc10) {/* reset training pattern */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h +2 -0
@@ -336,6 +336,8 @@ void dcn10_psr_program_secondary_packet(struct link_encoder *enc,bool dcn10_is_dig_enabled (struct link_encoder *enc); +unsigned int dcn10_get_dig_frontend (struct link_encoder *enc); +void dcn10_aux_initialize (struct dcn10_link_encoder *enc10);#endif /* __DC_LINK_ENCODER__DCN10_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +59 -0
71 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/clock_source.h +4 -0
@@ -166,6 +166,10 @@ struct clock_source_funcs { struct clock_source *, struct pixel_clk_params *, struct pll_settings *); +bool (*get_pixel_clk_frequency_100hz)( +struct clock_source *clock_source, +unsigned int inst, +unsigned int *pixel_clk_khz); };struct clock_source {
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +1 -0
@@ -153,6 +153,7 @@ struct link_encoder_funcs {void (*enable_hpd)(struct link_encoder *enc);void (*disable_hpd)(struct link_encoder *enc);bool (*is_dig_enabled)(struct link_encoder *enc); +unsigned int (*get_dig_frontend)(struct link_encoder *enc);void (*destroy)(struct link_encoder **enc); };
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +2 -0
@@ -170,6 +170,8 @@ struct timing_generator_funcs {bool (*get_otg_active_size)(struct timing_generator *optc,uint32_t *otg_active_width,uint32_t *otg_active_height); +bool (*is_matching_timing)(struct timing_generator *tg, +const struct dc_crtc_timing *otg_timing);void (*set_early_control)(struct timing_generator *tg,uint32_t early_cntl); void (*wait_for_state)(struct timing_generator *tg,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 30/35 drm/amd/display: refactor out programming of vupdate interrupt
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
More clearly isolate the code that is involved in programming of vupdate interrupt
[How]
Add function for programming of vupdate interrupt. Call it after timing is programmed.
--- .../display/dc/dce110/dce110_hw_sequencer.c | 5 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 51 +++++++++++++++---- .../amd/display/dc/inc/hw/timing_generator.h | 3 ++ 3 files changed, 48 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +5 -0
@@ -1341,6 +1341,11 @@ static enum dc_status apply_single_controller_ctx_to_hw(/* */ dc->hwss.enable_stream_timing (pipe_ctx, context, dc); +if (pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt) + pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt ( + pipe_ctx->stream_res.tg, + &stream->timing); +if (pipe_ctx->stream->signal !=SIGNAL_TYPE_VIRTUAL ) pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg( pipe_ctx->stream_res.stream_enc,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +40 -11
74 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +3 -0
@@ -154,6 +154,9 @@ struct timing_generator_funcs {const struct dc_crtc_timing *dc_crtc_timing, enum vline_select vline, const union vline_config *vline_config); + +void (*program_vupdate_interrupt)(struct timing_generator *optc, +const struct dc_crtc_timing *dc_crtc_timing);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 31/35 drm/amd/display: add way to determine if link is active
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Need to understand whether link is active aside from stream state. This could be used to check what links are enabled by GOP.
[How]
Store link_active state in link status and initialize it by checking if the DIG is enabled.
Keep it updated on every link enable and disable
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++++ drivers/gpu/drm/amd/display/dc/dc_link.h | 1 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 +++++ 3 files changed, 10 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -0
@@ -2612,6 +2612,8 @@ void core_link_enable_stream( } } + stream->link->link_status.link_active = true; + core_dc->hwss.enable_audio_stream (pipe_ctx);/* turn off otg test pattern if enable */
@@ -2646,6 +2648,8 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx, int option) core_dc->hwss.disable_stream (pipe_ctx, option);disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); + + pipe_ctx->stream->link->link_status.link_active = false; }void core_link_set_avmute (struct pipe_ctx *pipe_ctx,bool enable)
drivers/gpu/drm/amd/display/dc/dc_link.h +1 -0
@@ -30,6 +30,7 @@#include "grph_object_defs.h" struct dc_link_status { +bool link_active;struct dpcd_caps *dpcd_caps; };
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -0
@@ -1027,6 +1027,11 @@ static void dcn10_init_hw(struct dc *dc) dc->hwss.edp_power_control (link, true); link->link_enc->funcs->hw_init (link->link_enc); + +/* Check for enabled DIG to identify enabled display */ +if (link->link_enc->funcs->is_dig_enabled && + link->link_enc->funcs->is_dig_enabled (link->link_enc)) + link->link_status.link_active = true; } }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 32/35 drm/amd/display: add seamless boot flag to stream
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
If we determine the stream we are trying to commit matches HW, we want to try to optimize.
[How]
Try to acquire the HW resources that are already enabled and optimize.
Also skip backend reprogramming
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc_link.c | 14 ++++- .../gpu/drm/amd/display/dc/core/dc_resource.c | 56 ++++++++++++++++++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 4 +- .../display/dc/dce110/dce110_hw_sequencer.c | 4 +- 5 files changed, 75 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1096,6 +1096,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cconst struct dc_link *link = context->streams[i]->link;struct dc_stream_status *status; +if (context->streams[i]->apply_seamless_boot_optimization) + context->streams[i]->apply_seamless_boot_optimization = false; +if (!context->streams[i]->mode_changed)continue ;
drivers/gpu/drm/amd/display/dc/core/dc_link.c +12 -2
@@ -2579,13 +2579,23 @@ void core_link_enable_stream( &stream->timing);if (!IS_FPGA_MAXIMUS_DC (core_dc->ctx->dce_environment)) { +bool apply_edp_fast_boot_optimization = + pipe_ctx->stream->apply_edp_fast_boot_optimization; + + pipe_ctx->stream->apply_edp_fast_boot_optimization = false; +resource_build_info_frame (pipe_ctx); core_dc->hwss.update_info_frame (pipe_ctx); +/* Do not touch link on seamless boot optimization. */ +if (pipe_ctx->stream->apply_seamless_boot_optimization) { + pipe_ctx->stream->dpms_off = false; +return ; + } +/* eDP lit up by bios already, no need to enable again. */ if (pipe_ctx->stream->signal ==SIGNAL_TYPE_EDP && - pipe_ctx->stream->apply_edp_fast_boot_optimization) { - pipe_ctx->stream->apply_edp_fast_boot_optimization = false; + apply_edp_fast_boot_optimization) { pipe_ctx->stream->dpms_off = false;return ; }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +54 -2
68 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_stream.h +3 -1
@@ -119,7 +119,6 @@ struct dc_stream_state {int phy_pix_clk;enum signal_type signal;bool dpms_off; -bool apply_edp_fast_boot_optimization;void *dm_stream_context;
@@ -146,6 +145,9 @@ struct dc_stream_state {uint8_t otg_offset; } out; +bool apply_edp_fast_boot_optimization; +bool apply_seamless_boot_optimization; +uint32_t stream_id; };
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
@@ -1339,7 +1339,9 @@ static enum dc_status apply_single_controller_ctx_to_hw( }/* */ - dc->hwss.enable_stream_timing (pipe_ctx, context, dc); +/* Do not touch stream timing on seamless boot optimization. */ +if (!pipe_ctx->stream->apply_seamless_boot_optimization) + dc->hwss.enable_stream_timing (pipe_ctx, context, dc);if (pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt) pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt(
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 33/35 drm/amd/display: refactor programming of DRR
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Keep enable_stream_timing programming only timing related stuff.
[How]
Move DRR and static screen mask programming from enable_stream_timing to outside in apply_single_controller_ctx_to_hw
--- .../display/dc/dce110/dce110_hw_sequencer.c | 31 +++++++++---------- .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 15 --------- 2 files changed, 15 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +15 -16
@@ -1250,8 +1250,6 @@ static enum dc_status dce110_enable_stream_timing(struct pipe_ctx *pipe_ctx_old = &dc->current_state->res_ctx. pipe_ctx[pipe_ctx->pipe_idx];struct tg_color black_color = {0 }; -struct drr_params params = {0 }; -unsigned int event_triggers =0 ;if (!pipe_ctx_old->stream) {
@@ -1280,20 +1278,6 @@ static enum dc_status dce110_enable_stream_timing( pipe_ctx->stream_res.tg, &stream->timing, true); - - params.vertical_total_min = stream->adjust.v_total_min; - params.vertical_total_max = stream->adjust.v_total_max; -if (pipe_ctx->stream_res.tg->funcs->set_drr) - pipe_ctx->stream_res.tg->funcs->set_drr ( - pipe_ctx->stream_res.tg, ¶ms); - -// DRR should set trigger event to monitor surface update event -if (stream->adjust.v_total_min !=0 && - stream->adjust.v_total_max !=0 ) - event_triggers =0x80 ; -if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control) - pipe_ctx->stream_res.tg->funcs->set_static_screen_control ( - pipe_ctx->stream_res.tg, event_triggers); }if (!pipe_ctx_old->stream) {
@@ -1313,6 +1297,8 @@ static enum dc_status apply_single_controller_ctx_to_hw( struct dc *dc) {struct dc_stream_state *stream = pipe_ctx->stream; +struct drr_params params = {0 }; +unsigned int event_triggers =0 ;if (pipe_ctx->stream_res.audio !=NULL ) {struct audio_output audio_output;
@@ -1348,6 +1334,19 @@ static enum dc_status apply_single_controller_ctx_to_hw( pipe_ctx->stream_res.tg, &stream->timing); + params.vertical_total_min = stream->adjust.v_total_min; + params.vertical_total_max = stream->adjust.v_total_max; +if (pipe_ctx->stream_res.tg->funcs->set_drr) + pipe_ctx->stream_res.tg->funcs->set_drr ( + pipe_ctx->stream_res.tg, ¶ms); + +// DRR should set trigger event to monitor surface update event +if (stream->adjust.v_total_min !=0 && stream->adjust.v_total_max !=0 ) + event_triggers =0x80 ; +if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control) + pipe_ctx->stream_res.tg->funcs->set_static_screen_control ( + pipe_ctx->stream_res.tg, event_triggers); +if (pipe_ctx->stream->signal !=SIGNAL_TYPE_VIRTUAL ) pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg( pipe_ctx->stream_res.stream_enc,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +0 -15
@@ -636,8 +636,6 @@ static enum dc_status dcn10_enable_stream_timing(struct dc_stream_state *stream = pipe_ctx->stream;enum dc_color_space color_space;struct tg_color black_color = {0 }; -struct drr_params params = {0 }; -unsigned int event_triggers =0 ;/* by upper caller loop, pipe0 is parent pipe and be called first. * back end is set up by for pipe0. Other children pipe share back end
@@ -705,19 +703,6 @@ static enum dc_status dcn10_enable_stream_timing(return DC_ERROR_UNEXPECTED ; } - params.vertical_total_min = stream->adjust.v_total_min; - params.vertical_total_max = stream->adjust.v_total_max; -if (pipe_ctx->stream_res.tg->funcs->set_drr) - pipe_ctx->stream_res.tg->funcs->set_drr ( - pipe_ctx->stream_res.tg, ¶ms); - -// DRR should set trigger event to monitor surface update event -if (stream->adjust.v_total_min !=0 && stream->adjust.v_total_max !=0 ) - event_triggers =0x80 ; -if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control) - pipe_ctx->stream_res.tg->funcs->set_static_screen_control ( - pipe_ctx->stream_res.tg, event_triggers); -/* TODO program crtc source select for non-virtual signal*/ /* TODO program FMT */ /* TODO setup link_enc */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 34/35 drm/amd/display: refactor init_hw to isolate pipe related init
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Pipe related init is possible to optimized if we know what we intend to program, and if we can determine it matches what is already programmed for the pipe.
[How]
First step is to isolate the pipe related init code
--- .../display/dc/dce110/dce110_hw_sequencer.c | 6 + .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 159 +++++++++--------- .../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + 3 files changed, 85 insertions(+), 82 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -0
@@ -2275,6 +2275,11 @@ static void dce110_enable_per_frame_crtc_position_reset( } +static void init_pipes (struct dc *dc,struct dc_state *context) +{ +// Do nothing +} +static void init_hw (struct dc *dc) {int i;
@@ -2642,6 +2647,7 @@ static const struct hw_sequencer_funcs dce110_funcs = { .program_gamut_remap = program_gamut_remap, .program_output_csc = program_output_csc, .init_hw = init_hw, + .init_pipes = init_pipes, .apply_ctx_to_hw = dce110_apply_ctx_to_hw, .apply_ctx_for_surface = dce110_apply_ctx_for_surface, .update_plane_addr = update_plane_addr,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +77 -82
214 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +2 -0
@@ -70,6 +70,8 @@ struct hw_sequencer_funcs {void (*init_hw)(struct dc *dc); +void (*init_pipes)(struct dc *dc,struct dc_state *context); +enum dc_status (*apply_ctx_to_hw)(struct dc *dc,struct dc_state *context);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 35/35 drm/amd/display: add n_vid_mul and half pix_rate for odm
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
Dp needs half container rate to properly support odm
--- .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 7 +++++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -2
@@ -1032,8 +1032,7 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,struct dc_link *link = stream->link;/* only 3 items below are used by unblank */ - params.pixel_clk_khz = - pipe_ctx->stream->timing.pix_clk_100hz /10 ; + params.pixel_clk_khz = pipe_ctx->stream->timing.pix_clk_100hz /10 ; params.link_settings.link_rate = link_settings->link_rate;if (dc_is_dp_signal (pipe_ctx->stream->signal))
@@ -1043,6 +1042,7 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx, link->dc->hwss.edp_backlight_control (link, true); } } +void dce110_blank_stream (struct pipe_ctx *pipe_ctx) {struct dc_stream_state *stream = pipe_ctx->stream;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +5 -2
@@ -390,7 +390,7 @@ void optc1_program_timing( h_div_2 =optc1_is_two_pixels_per_containter (&patched_crtc_timing);REG_UPDATE (OTG_H_TIMING_CNTL , -OTG_H_TIMING_DIV_BY2 , h_div_2); +OTG_H_TIMING_DIV_BY2 , h_div_2 || optc1->comb_opp_id !=0xf ); }
@@ -1531,10 +1531,13 @@ void dcn10_timing_generator_init(struct optc *optc1) optc1->min_v_blank_interlace =5 ; optc1->min_h_sync_width =8 ; optc1->min_v_sync_width =1 ; + optc1->comb_opp_id =0xf ; }bool optc1_is_two_pixels_per_containter (const struct dc_crtc_timing *timing) { -return timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 ; +bool two_pix = timing->pixel_encoding ==PIXEL_ENCODING_YCBCR420 ; + +return two_pix; }
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +1 -1
@@ -435,7 +435,7 @@ struct optc {const struct dcn_optc_shift *tg_shift;const struct dcn_optc_mask *tg_mask; -enum controller_id controller_id; +int comb_opp_id;uint32_t max_h_total;uint32_t max_v_total;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx