From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mikko Perttunen <cyndis-/1wQRMveznE@public.gmane.org>,
Erik Faye-Lund
<kusmabite-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
DRI Development
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: [PATCH v3 08/20] drm/tegra: dc: Disable plane if it is invisible
Date: Thu, 15 Jun 2017 02:18:31 +0300 [thread overview]
Message-ID: <413bf65cb0ae08b9acbaf4490713ca848a4cf521.1497480757.git.digetx@gmail.com> (raw)
In-Reply-To: <cover.1497480751.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
In-Reply-To: <cover.1497480751.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Tegra20 if plane has width or height equal to 0, it will be infinitely
wide or tall. Let's disable the plane if it is invisible on atomic state
committing to fix the issue. The Rockchip DRM driver does the same.
Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Erik Faye-Lund <kusmabite-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/gpu/drm/tegra/dc.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index a7a7cce1afd0..c875f11786b9 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -559,6 +559,23 @@ static int tegra_plane_atomic_check(struct drm_plane *plane,
return 0;
}
+static void tegra_dc_disable_window(struct tegra_dc *dc, int index)
+{
+ unsigned long flags;
+ u32 value;
+
+ spin_lock_irqsave(&dc->lock, flags);
+
+ value = WINDOW_A_SELECT << index;
+ tegra_dc_writel(dc, value, DC_CMD_DISPLAY_WINDOW_HEADER);
+
+ value = tegra_dc_readl(dc, DC_WIN_WIN_OPTIONS);
+ value &= ~WIN_ENABLE;
+ tegra_dc_writel(dc, value, DC_WIN_WIN_OPTIONS);
+
+ spin_unlock_irqrestore(&dc->lock, flags);
+}
+
static void tegra_plane_atomic_update(struct drm_plane *plane,
struct drm_plane_state *old_state)
{
@@ -573,6 +590,9 @@ static void tegra_plane_atomic_update(struct drm_plane *plane,
if (!plane->state->crtc || !plane->state->fb)
return;
+ if (!plane->state->visible)
+ return tegra_dc_disable_window(dc, p->index);
+
memset(&window, 0, sizeof(window));
window.src.x = plane->state->src.x1 >> 16;
window.src.y = plane->state->src.y1 >> 16;
@@ -612,8 +632,6 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane,
{
struct tegra_plane *p = to_tegra_plane(plane);
struct tegra_dc *dc;
- unsigned long flags;
- u32 value;
/* rien ne va plus */
if (!old_state || !old_state->crtc)
@@ -621,16 +639,7 @@ static void tegra_plane_atomic_disable(struct drm_plane *plane,
dc = to_tegra_dc(old_state->crtc);
- spin_lock_irqsave(&dc->lock, flags);
-
- value = WINDOW_A_SELECT << p->index;
- tegra_dc_writel(dc, value, DC_CMD_DISPLAY_WINDOW_HEADER);
-
- value = tegra_dc_readl(dc, DC_WIN_WIN_OPTIONS);
- value &= ~WIN_ENABLE;
- tegra_dc_writel(dc, value, DC_WIN_WIN_OPTIONS);
-
- spin_unlock_irqrestore(&dc->lock, flags);
+ tegra_dc_disable_window(dc, p->index);
}
static const struct drm_plane_helper_funcs tegra_primary_plane_helper_funcs = {
--
2.13.0
next prev parent reply other threads:[~2017-06-14 23:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 23:18 [PATCH v3 00/20] Tegra DRM fixes Dmitry Osipenko
[not found] ` <cover.1497480751.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-14 23:18 ` [PATCH v3 01/20] drm/tegra: Fix lockup on a use of staging API Dmitry Osipenko
[not found] ` <7b70a506a9d2355ea6ff19a8c4f4d726b67719b3.1497480754.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-15 12:11 ` Thierry Reding
2017-06-14 23:18 ` [PATCH v3 02/20] drm/tegra: Correct idr_alloc() minimum id Dmitry Osipenko
[not found] ` <9c19a44219acd988e678cf9abe21363911184625.1497480754.git.digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-15 12:13 ` Thierry Reding
2017-06-14 23:18 ` [PATCH v3 03/20] drm/tegra: Check for malformed offsets and sizes in the 'submit' IOCTL Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 04/20] drm/tegra: Correct copying of waitchecks and disable them " Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 05/20] drm/tegra: Check syncpoint ID " Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 06/20] drm/tegra: dc: Avoid reset asserts on Tegra20 Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 07/20] drm/tegra: dc: Apply clipping to the plane Dmitry Osipenko
2017-06-14 23:18 ` Dmitry Osipenko [this message]
2017-06-14 23:18 ` [PATCH v3 09/20] gpu: host1x: Initialize firewall class to the jobs one Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 10/20] gpu: host1x: Correct host1x_job_pin() error handling Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 11/20] gpu: host1x: Do not leak BO's phys address to userspace Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 12/20] gpu: host1x: Forbid relocation address shifting in the firewall Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 13/20] gpu: host1x: Forbid RESTART opcode " Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 14/20] gpu: host1x: Forbid unrelated SETCLASS " Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 15/20] gpu: host1x: Correct swapped arguments in the is_addr_reg() definition Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 16/20] gpu: host1x: Check waits in the firewall Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 17/20] gpu: host1x: Remove unused 'struct host1x_cmdbuf' Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 18/20] gpu: host1x: Remove unused host1x_cdma_stop() definition Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 19/20] gpu: host1x: Refactor channel allocation code Dmitry Osipenko
2017-06-14 23:18 ` [PATCH v3 20/20] gpu: host1x: At first try a non-blocking allocation for the gather copy Dmitry Osipenko
2017-06-15 13:33 ` [PATCH v3 00/20] Tegra DRM fixes Thierry Reding
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=413bf65cb0ae08b9acbaf4490713ca848a4cf521.1497480757.git.digetx@gmail.com \
--to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=cyndis-/1wQRMveznE@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=kusmabite-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).