All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qingqing Zhuo <qingqing.zhuo@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Eryk.Brol@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	Qingqing.Zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	Wayne Lin <Wayne.Lin@amd.com>,
	Bhawanpreet.Lakha@amd.com, bindu.r@amd.com
Subject: [PATCH 04/13] drm/amd/display: Fix to be able to stop crc calculation
Date: Tue,  8 Dec 2020 14:28:35 -0500	[thread overview]
Message-ID: <20201208192844.23580-5-qingqing.zhuo@amd.com> (raw)
In-Reply-To: <20201208192844.23580-1-qingqing.zhuo@amd.com>

From: Wayne Lin <Wayne.Lin@amd.com>

[Why]
Find out when we try to disable CRC calculation,
crc generation is still enabled. Main reason is
that dc_stream_configure_crc() will never get
called when the source is AMDGPU_DM_PIPE_CRC_SOURCE_NONE.

[How]
Add checking condition that when source is
AMDGPU_DM_PIPE_CRC_SOURCE_NONE, we should also call
dc_stream_configure_crc() to disable crc calculation.
Also, clean up crc window when disable crc calculation.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
index ff6db26626ea..7b886a779a8c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
@@ -81,6 +81,14 @@ const char *const *amdgpu_dm_crtc_get_crc_sources(struct drm_crtc *crtc,
 	return pipe_crc_sources;
 }
 
+static void amdgpu_dm_set_crc_window_default(struct dm_crtc_state *dm_crtc_state)
+{
+	dm_crtc_state->crc_window.x_start = 0;
+	dm_crtc_state->crc_window.y_start = 0;
+	dm_crtc_state->crc_window.x_end = 0;
+	dm_crtc_state->crc_window.y_end = 0;
+}
+
 bool amdgpu_dm_crc_window_is_default(struct dm_crtc_state *dm_crtc_state)
 {
 	bool ret = true;
@@ -141,7 +149,10 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
 	mutex_lock(&adev->dm.dc_lock);
 
 	/* Enable CRTC CRC generation if necessary. */
-	if (dm_is_crc_source_crtc(source)) {
+	if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
+		if (!enable)
+			amdgpu_dm_set_crc_window_default(dm_crtc_state);
+
 		if (!amdgpu_dm_crc_window_is_default(dm_crtc_state)) {
 			crc_window = &tmp_window;
 
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-12-08 19:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 19:28 [PATCH 00/13] DC Patches December 14th, 2020 Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 01/13] drm/amd/display: Change pstate expected timeout warning to 180us on linux Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 02/13] drm/amd/display: Add missing DP_SEC register definitions and masks Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 03/13] drm/amd/display: HP Reverb G2 VR fails to light up Qingqing Zhuo
2020-12-08 19:28 ` Qingqing Zhuo [this message]
2020-12-08 19:28 ` [PATCH 05/13] drm/amd/display: add dcn30_link_encoder_validate_output_with_stream to header Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 06/13] drm/amd/display: Add DP info frame update for dcn30 Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 07/13] drm/amd/display: delay fp2 programming until vactive before lock Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 08/13] drm/amd/display: updated wm table for Renoir Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 09/13] drm/amd/display: Only update FP2 for full updates Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 10/13] drm/amd/display: Fix OGAM LUT calculation precision Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 11/13] drm/amd/display: Fix cleanup typo in MPCC visual confirm Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 12/13] drm/amd/display: [FW Promotion] Release 0.0.46 Qingqing Zhuo
2020-12-08 19:28 ` [PATCH 13/13] drm/amd/display: 3.2.116 Qingqing Zhuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201208192844.23580-5-qingqing.zhuo@amd.com \
    --to=qingqing.zhuo@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Eryk.Brol@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bindu.r@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.