dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: airlied@linux.ie
Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	dri-devel@lists.freedesktop.org,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: [PATCH v2 01/13] drm/meson: Use crtc_state for hdisplay and fix atomic flush/enable sync for vsync commit
Date: Tue, 21 Mar 2017 16:25:38 +0100	[thread overview]
Message-ID: <1490109950-21421-2-git-send-email-narmstrong@baylibre.com> (raw)
In-Reply-To: <1490109950-21421-1-git-send-email-narmstrong@baylibre.com>

Clean the crtc_enable by using the proper crtc_state instead of the state
of the primary plane state data.

Also fix the dependency to commit the plane changes even if enable is called
after the flush.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/meson/meson_crtc.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c
index 0fe49ec..c986eb0 100644
--- a/drivers/gpu/drm/meson/meson_crtc.c
+++ b/drivers/gpu/drm/meson/meson_crtc.c
@@ -82,11 +82,18 @@ static void meson_crtc_disable_vblank(struct drm_crtc *crtc)
 static void meson_crtc_enable(struct drm_crtc *crtc)
 {
 	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
-	struct drm_plane *plane = meson_crtc->priv->primary_plane;
+	struct drm_crtc_state *crtc_state = crtc->state;
 	struct meson_drm *priv = meson_crtc->priv;
 
+	DRM_DEBUG_DRIVER("\n");
+
+	if (!crtc_state) {
+		DRM_ERROR("Invalid crtc_state\n");
+		return;
+	}
+
 	/* Enable VPP Postblend */
-	writel(plane->state->crtc_w,
+	writel(crtc_state->mode.hdisplay,
 	       priv->io_base + _REG(VPP_POSTBLEND_H_SIZE));
 
 	writel_bits_relaxed(VPP_POSTBLEND_ENABLE, VPP_POSTBLEND_ENABLE,
@@ -101,6 +108,7 @@ static void meson_crtc_disable(struct drm_crtc *crtc)
 	struct meson_drm *priv = meson_crtc->priv;
 
 	priv->viu.osd1_enabled = false;
+	priv->viu.osd1_commit = false;
 
 	/* Disable VPP Postblend */
 	writel_bits_relaxed(VPP_POSTBLEND_ENABLE, 0,
@@ -137,8 +145,7 @@ static void meson_crtc_atomic_flush(struct drm_crtc *crtc,
 	struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
 	struct meson_drm *priv = meson_crtc->priv;
 
-	if (priv->viu.osd1_enabled)
-		priv->viu.osd1_commit = true;
+	priv->viu.osd1_commit = true;
 }
 
 static const struct drm_crtc_helper_funcs meson_crtc_helper_funcs = {
-- 
1.9.1

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

  reply	other threads:[~2017-03-21 15:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 15:25 [PATCH v2 00/13] drm/meson: Initial support for HDMI Output Neil Armstrong
2017-03-21 15:25 ` Neil Armstrong [this message]
2017-04-04  8:49   ` [PATCH v2 01/13] drm/meson: Use crtc_state for hdisplay and fix atomic flush/enable sync for vsync commit Daniel Vetter
2017-03-21 15:25 ` [PATCH v2 02/13] drm/meson: Add missing HDMI register Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 03/13] drm/meson: Add support for components Neil Armstrong
2017-04-04  8:59   ` Daniel Vetter
2017-04-04  9:08     ` Neil Armstrong
2017-04-04  9:09       ` Daniel Vetter
2017-03-21 15:25 ` [PATCH v2 04/13] drm/meson: venc_cvbs: no more return -ENODEV if CVBS is not available Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 05/13] drm/meson: add support for HDMI clock support Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 06/13] drm/meson: Add support for HDMI venc modes and settings Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 07/13] drm/meson: Add support for HDMI encoder and DW-HDMI bridge + PHY Neil Armstrong
2017-04-04  8:57   ` Daniel Vetter
2017-04-04  9:16     ` Neil Armstrong
2017-04-04 13:50       ` Daniel Vetter
2017-03-21 15:25 ` [PATCH v2 08/13] ARM64: dts: meson-gx: Add shared CMA dma memory pool Neil Armstrong
2017-04-04  8:41   ` Neil Armstrong
2017-04-04 11:57     ` Kevin Hilman
2017-03-21 15:25 ` [PATCH v2 09/13] ARM64: dts: meson-gx: Add support for HDMI output Neil Armstrong
     [not found]   ` <1490109950-21421-10-git-send-email-narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2017-04-04  8:10     ` Neil Armstrong
2017-04-04 11:57       ` Kevin Hilman
     [not found] ` <1490109950-21421-1-git-send-email-narmstrong-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2017-03-21 15:25   ` [PATCH v2 10/13] dt-bindings: Add bindings for the Amlogic Meson dw-hdmi extension Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 11/13] drm/meson: Convert existing documentation to actual kerneldoc Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 12/13] drm/meson: Add RST to bring together kerneldoc Neil Armstrong
2017-04-04  9:00   ` Daniel Vetter
2017-04-04  9:17     ` Neil Armstrong
2017-03-21 15:25 ` [PATCH v2 13/13] MAINTAINERS: update files for Amlogic DRM Driver Neil Armstrong
2017-04-04  9:01   ` Daniel Vetter
2017-04-04  9:18     ` Neil Armstrong
2017-04-04  9:04 ` [PATCH v2 00/13] drm/meson: Initial support for HDMI Output Daniel Vetter
2017-04-04  9:21   ` Neil Armstrong

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=1490109950-21421-2-git-send-email-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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).