Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752895AbdDDIvf (ORCPT ); Tue, 4 Apr 2017 04:51:35 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36300 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbdDDIuD (ORCPT ); Tue, 4 Apr 2017 04:50:03 -0400 Date: Tue, 4 Apr 2017 10:49:53 +0200 From: Daniel Vetter To: Neil Armstrong Cc: airlied@linux.ie, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 01/13] drm/meson: Use crtc_state for hdisplay and fix atomic flush/enable sync for vsync commit Message-ID: <20170404084945.l7r7wkpjl664vrac@phenom.ffwll.local> Mail-Followup-To: Neil Armstrong , airlied@linux.ie, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org References: <1490109950-21421-1-git-send-email-narmstrong@baylibre.com> <1490109950-21421-2-git-send-email-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490109950-21421-2-git-send-email-narmstrong@baylibre.com> X-Operating-System: Linux phenom 4.9.0-2-amd64 User-Agent: NeoMutt/20170306 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2359 Lines: 71 On Tue, Mar 21, 2017 at 04:25:38PM +0100, Neil Armstrong wrote: > 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. Would have done this as 2 patches ... either way ack. -Daniel > > Signed-off-by: Neil Armstrong > --- > 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 -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch