All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Yongqiang Sun <yongqiang.sun@amd.com>,
	Tony Cheng <Tony.Cheng@amd.com>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sasha Levin <sashal@kernel.org>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 4.19 40/47] drm/amd/display: Not doing optimize bandwidth if flip pending.
Date: Sat, 18 Apr 2020 10:42:20 -0400	[thread overview]
Message-ID: <20200418144227.9802-40-sashal@kernel.org> (raw)
In-Reply-To: <20200418144227.9802-1-sashal@kernel.org>

From: Yongqiang Sun <yongqiang.sun@amd.com>

[ Upstream commit 9941b8129030c9202aaf39114477a0e58c0d6ffc ]

[Why]
In some scenario like 1366x768 VSR enabled connected with a 4K monitor
and playing 4K video in clone mode, underflow will be observed due to
decrease dppclk when previouse surface scan isn't finished

[How]
In this use case, surface flip is switching between 4K and 1366x768,
1366x768 needs smaller dppclk, and when decrease the clk and previous
surface scan is for 4K and scan isn't done, underflow will happen.  Not
doing optimize bandwidth in case of flip pending.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 2b2efe443c36d..b64ad9e1f0c38 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -996,6 +996,26 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
 	return (result == DC_OK);
 }
 
+static bool is_flip_pending_in_pipes(struct dc *dc, struct dc_state *context)
+{
+	int i;
+	struct pipe_ctx *pipe;
+
+	for (i = 0; i < MAX_PIPES; i++) {
+		pipe = &context->res_ctx.pipe_ctx[i];
+
+		if (!pipe->plane_state)
+			continue;
+
+		/* Must set to false to start with, due to OR in update function */
+		pipe->plane_state->status.is_flip_pending = false;
+		dc->hwss.update_pending_status(pipe);
+		if (pipe->plane_state->status.is_flip_pending)
+			return true;
+	}
+	return false;
+}
+
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
 	int i;
@@ -1003,6 +1023,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
 	post_surface_trace(dc);
 
+	if (is_flip_pending_in_pipes(dc, context))
+		return true;
+
 	for (i = 0; i < dc->res_pool->pipe_count; i++)
 		if (context->res_ctx.pipe_ctx[i].stream == NULL ||
 		    context->res_ctx.pipe_ctx[i].plane_state == NULL) {
-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	amd-gfx@lists.freedesktop.org,
	Yongqiang Sun <yongqiang.sun@amd.com>,
	dri-devel@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Tony Cheng <Tony.Cheng@amd.com>
Subject: [PATCH AUTOSEL 4.19 40/47] drm/amd/display: Not doing optimize bandwidth if flip pending.
Date: Sat, 18 Apr 2020 10:42:20 -0400	[thread overview]
Message-ID: <20200418144227.9802-40-sashal@kernel.org> (raw)
In-Reply-To: <20200418144227.9802-1-sashal@kernel.org>

From: Yongqiang Sun <yongqiang.sun@amd.com>

[ Upstream commit 9941b8129030c9202aaf39114477a0e58c0d6ffc ]

[Why]
In some scenario like 1366x768 VSR enabled connected with a 4K monitor
and playing 4K video in clone mode, underflow will be observed due to
decrease dppclk when previouse surface scan isn't finished

[How]
In this use case, surface flip is switching between 4K and 1366x768,
1366x768 needs smaller dppclk, and when decrease the clk and previous
surface scan is for 4K and scan isn't done, underflow will happen.  Not
doing optimize bandwidth in case of flip pending.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 2b2efe443c36d..b64ad9e1f0c38 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -996,6 +996,26 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
 	return (result == DC_OK);
 }
 
+static bool is_flip_pending_in_pipes(struct dc *dc, struct dc_state *context)
+{
+	int i;
+	struct pipe_ctx *pipe;
+
+	for (i = 0; i < MAX_PIPES; i++) {
+		pipe = &context->res_ctx.pipe_ctx[i];
+
+		if (!pipe->plane_state)
+			continue;
+
+		/* Must set to false to start with, due to OR in update function */
+		pipe->plane_state->status.is_flip_pending = false;
+		dc->hwss.update_pending_status(pipe);
+		if (pipe->plane_state->status.is_flip_pending)
+			return true;
+	}
+	return false;
+}
+
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
 	int i;
@@ -1003,6 +1023,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
 	post_surface_trace(dc);
 
+	if (is_flip_pending_in_pipes(dc, context))
+		return true;
+
 	for (i = 0; i < dc->res_pool->pipe_count; i++)
 		if (context->res_ctx.pipe_ctx[i].stream == NULL ||
 		    context->res_ctx.pipe_ctx[i].plane_state == NULL) {
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
	amd-gfx@lists.freedesktop.org,
	Yongqiang Sun <yongqiang.sun@amd.com>,
	dri-devel@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Tony Cheng <Tony.Cheng@amd.com>
Subject: [PATCH AUTOSEL 4.19 40/47] drm/amd/display: Not doing optimize bandwidth if flip pending.
Date: Sat, 18 Apr 2020 10:42:20 -0400	[thread overview]
Message-ID: <20200418144227.9802-40-sashal@kernel.org> (raw)
In-Reply-To: <20200418144227.9802-1-sashal@kernel.org>

From: Yongqiang Sun <yongqiang.sun@amd.com>

[ Upstream commit 9941b8129030c9202aaf39114477a0e58c0d6ffc ]

[Why]
In some scenario like 1366x768 VSR enabled connected with a 4K monitor
and playing 4K video in clone mode, underflow will be observed due to
decrease dppclk when previouse surface scan isn't finished

[How]
In this use case, surface flip is switching between 4K and 1366x768,
1366x768 needs smaller dppclk, and when decrease the clk and previous
surface scan is for 4K and scan isn't done, underflow will happen.  Not
doing optimize bandwidth in case of flip pending.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 2b2efe443c36d..b64ad9e1f0c38 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -996,6 +996,26 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
 	return (result == DC_OK);
 }
 
+static bool is_flip_pending_in_pipes(struct dc *dc, struct dc_state *context)
+{
+	int i;
+	struct pipe_ctx *pipe;
+
+	for (i = 0; i < MAX_PIPES; i++) {
+		pipe = &context->res_ctx.pipe_ctx[i];
+
+		if (!pipe->plane_state)
+			continue;
+
+		/* Must set to false to start with, due to OR in update function */
+		pipe->plane_state->status.is_flip_pending = false;
+		dc->hwss.update_pending_status(pipe);
+		if (pipe->plane_state->status.is_flip_pending)
+			return true;
+	}
+	return false;
+}
+
 bool dc_post_update_surfaces_to_stream(struct dc *dc)
 {
 	int i;
@@ -1003,6 +1023,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
 	post_surface_trace(dc);
 
+	if (is_flip_pending_in_pipes(dc, context))
+		return true;
+
 	for (i = 0; i < dc->res_pool->pipe_count; i++)
 		if (context->res_ctx.pipe_ctx[i].stream == NULL ||
 		    context->res_ctx.pipe_ctx[i].plane_state == NULL) {
-- 
2.20.1

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

  parent reply	other threads:[~2020-04-18 14:43 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 14:41 [PATCH AUTOSEL 4.19 01/47] iommu/amd: Fix the configuration of GCR3 table root pointer Sasha Levin
2020-04-18 14:41 ` Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 02/47] watchdog: reset last_hw_keepalive time at start Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 03/47] ovl: fix value of i_ino for lower hardlink corner case Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 04/47] iommu/vt-d: Fix mm reference leak Sasha Levin
2020-04-18 14:41   ` Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 05/47] scsi: lpfc: Fix kasan slab-out-of-bounds error in lpfc_unreg_login Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 06/47] scsi: lpfc: Fix crash in target side cable pulls hitting WAIT_FOR_UNREG Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 07/47] ceph: return ceph_mdsc_do_request() errors from __get_parent() Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 08/47] ceph: don't skip updating wanted caps when cap is stale Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 09/47] pwm: rcar: Fix late Runtime PM enablement Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 10/47] ASoC: dpcm: allow start or stop during pause for backend Sasha Levin
2020-04-18 14:41   ` Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 11/47] scsi: iscsi: Report unbind session event when the target has been removed Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 12/47] ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map() Sasha Levin
2020-04-18 14:41   ` Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 13/47] nvme: fix deadlock caused by ANA update wrong locking Sasha Levin
2020-04-18 14:41   ` Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 14/47] kernel/gcov/fs.c: gcov_seq_next() should increase position index Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 15/47] selftests: kmod: fix handling test numbers above 9 Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 16/47] ipc/util.c: sysvipc_find_ipc() should increase position index Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 17/47] kconfig: qconf: Fix a few alignment issues Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 18/47] KVM: s390: vsie: Fix possible race when shadowing region 3 tables Sasha Levin
2020-04-18 14:41 ` [PATCH AUTOSEL 4.19 19/47] s390/cio: avoid duplicated 'ADD' uevents Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 20/47] loop: Better discard support for block devices Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 21/47] pwm: pca9685: Fix PWM/GPIO inter-operation Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 22/47] Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled" Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 23/47] drm/amdkfd: kfree the wrong pointer Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 24/47] pwm: renesas-tpu: Fix late Runtime PM enablement Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 25/47] pwm: bcm2835: Dynamically allocate base Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 26/47] drm/vc4: Fix HDMI mode validation Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 27/47] libnvdimm: Out of bounds read in __nd_ioctl() Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 28/47] ocfs2: no need try to truncate file beyond i_size Sasha Levin
2020-04-18 14:42   ` [Ocfs2-devel] " Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 29/47] hfsplus: fix crash and filesystem corruption when deleting files Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 30/47] ALSA: hda/realtek - Add quirk for MSI GL63 Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 31/47] perf/core: Disable page faults when getting phys address Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 32/47] libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 33/47] ALSA: ice1724: Fix invalid access for enumerated ctl items Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 34/47] ALSA: hda: Fix potential access overflow in beep helper Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 35/47] KVM: s390: vsie: Fix delivery of addressing exceptions Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 36/47] ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN MPWIN895CL tablet Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 37/47] ipmi: fix hung processes in __get_guid() Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 38/47] scsi: mpt3sas: Fix kernel panic observed on soft HBA unplug Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 39/47] xhci: Ensure link state is U3 after setting USB_SS_PORT_LS_U3 Sasha Levin
2020-04-18 14:42 ` Sasha Levin [this message]
2020-04-18 14:42   ` [PATCH AUTOSEL 4.19 40/47] drm/amd/display: Not doing optimize bandwidth if flip pending Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 41/47] powerpc/powernv/ioda: Fix ref count for devices with their own PE Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-21 11:06   ` Frederic Barrat
2020-04-21 11:06     ` Frederic Barrat
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 42/47] pci/hotplug/pnv-php: Remove erroneous warning Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 43/47] ocxl: Add PCI hotplug dependency to Kconfig Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 44/47] tracing/selftests: Turn off timeout setting Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 45/47] virtio-blk: improve virtqueue error to BLK_STS Sasha Levin
2020-04-18 14:42   ` Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 46/47] scsi: smartpqi: fix call trace in device discovery Sasha Levin
2020-04-18 14:42 ` [PATCH AUTOSEL 4.19 47/47] PCI/ASPM: Allow re-enabling Clock PM Sasha Levin

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=20200418144227.9802-40-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Tony.Cheng@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yongqiang.sun@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.