From: Paul Cercueil <paul@crapouillou.net> To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>, Maxime Ripard <mripard@kernel.org> Cc: list@opendingux.net, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Neil Armstrong <narmstrong@baylibre.com>, Paul Cercueil <paul@crapouillou.net> Subject: [PATCH 06/11] drm/ingenic: Set DMA descriptor chain register when starting CRTC Date: Fri, 28 May 2021 00:21:00 +0100 [thread overview] Message-ID: <20210527232104.152577-7-paul@crapouillou.net> (raw) In-Reply-To: <20210527232104.152577-1-paul@crapouillou.net> Setting the DMA descriptor chain register in the probe function has been fine until now, because we only ever had one descriptor per foreground. As the driver will soon have real descriptor chains, and the DMA descriptor chain register updates itself to point to the current descriptor being processed, this register needs to be reset after a full modeset to point to the first descriptor of the chain. Signed-off-by: Paul Cercueil <paul@crapouillou.net> --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 639994329c60..5ba3283da97d 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -210,6 +210,10 @@ static void ingenic_drm_crtc_atomic_enable(struct drm_crtc *crtc, regmap_write(priv->map, JZ_REG_LCD_STATE, 0); + /* Set address of our DMA descriptor chain */ + regmap_write(priv->map, JZ_REG_LCD_DA0, dma_hwdesc_addr(priv, 0)); + regmap_write(priv->map, JZ_REG_LCD_DA1, dma_hwdesc_addr(priv, 1)); + regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, JZ_LCD_CTRL_ENABLE | JZ_LCD_CTRL_DISABLE, JZ_LCD_CTRL_ENABLE); @@ -1218,10 +1222,6 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) } } - /* Set address of our DMA descriptor chain */ - regmap_write(priv->map, JZ_REG_LCD_DA0, dma_hwdesc_phys_f0); - regmap_write(priv->map, JZ_REG_LCD_DA1, dma_hwdesc_phys_f1); - /* Enable OSD if available */ if (soc_info->has_osd) regmap_write(priv->map, JZ_REG_LCD_OSDC, JZ_LCD_OSDC_OSDEN); -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: Paul Cercueil <paul@crapouillou.net> To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>, Maxime Ripard <mripard@kernel.org> Cc: Neil Armstrong <narmstrong@baylibre.com>, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net>, list@opendingux.net Subject: [PATCH 06/11] drm/ingenic: Set DMA descriptor chain register when starting CRTC Date: Fri, 28 May 2021 00:21:00 +0100 [thread overview] Message-ID: <20210527232104.152577-7-paul@crapouillou.net> (raw) In-Reply-To: <20210527232104.152577-1-paul@crapouillou.net> Setting the DMA descriptor chain register in the probe function has been fine until now, because we only ever had one descriptor per foreground. As the driver will soon have real descriptor chains, and the DMA descriptor chain register updates itself to point to the current descriptor being processed, this register needs to be reset after a full modeset to point to the first descriptor of the chain. Signed-off-by: Paul Cercueil <paul@crapouillou.net> --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 639994329c60..5ba3283da97d 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -210,6 +210,10 @@ static void ingenic_drm_crtc_atomic_enable(struct drm_crtc *crtc, regmap_write(priv->map, JZ_REG_LCD_STATE, 0); + /* Set address of our DMA descriptor chain */ + regmap_write(priv->map, JZ_REG_LCD_DA0, dma_hwdesc_addr(priv, 0)); + regmap_write(priv->map, JZ_REG_LCD_DA1, dma_hwdesc_addr(priv, 1)); + regmap_update_bits(priv->map, JZ_REG_LCD_CTRL, JZ_LCD_CTRL_ENABLE | JZ_LCD_CTRL_DISABLE, JZ_LCD_CTRL_ENABLE); @@ -1218,10 +1222,6 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) } } - /* Set address of our DMA descriptor chain */ - regmap_write(priv->map, JZ_REG_LCD_DA0, dma_hwdesc_phys_f0); - regmap_write(priv->map, JZ_REG_LCD_DA1, dma_hwdesc_phys_f1); - /* Enable OSD if available */ if (soc_info->has_osd) regmap_write(priv->map, JZ_REG_LCD_OSDC, JZ_LCD_OSDC_OSDEN); -- 2.30.2
next prev parent reply other threads:[~2021-05-27 23:22 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-27 23:20 [PATCH 00/11] ingenic-drm cleanups and doublescan feature Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-05-27 23:20 ` [PATCH 01/11] drm/ingenic: Remove dead code Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-05-27 23:20 ` [PATCH 02/11] drm/ingenic: Simplify code by using hwdescs array Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-05-27 23:20 ` [PATCH 03/11] drm/ingenic: Add support for private objects Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-05-27 23:20 ` [PATCH 04/11] drm/ingenic: Move no_vblank to private state Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-06-01 15:48 ` Daniel Vetter 2021-06-01 15:48 ` Daniel Vetter 2021-06-10 15:09 ` Paul Cercueil 2021-06-10 15:09 ` Paul Cercueil 2021-06-11 9:05 ` Daniel Vetter 2021-06-11 9:05 ` Daniel Vetter 2021-05-27 23:20 ` [PATCH 05/11] drm/ingenic: Move IPU scale settings " Paul Cercueil 2021-05-27 23:20 ` Paul Cercueil 2021-05-27 23:21 ` Paul Cercueil [this message] 2021-05-27 23:21 ` [PATCH 06/11] drm/ingenic: Set DMA descriptor chain register when starting CRTC Paul Cercueil 2021-05-27 23:21 ` [PATCH 07/11] drm/ingenic: Upload palette before frame Paul Cercueil 2021-05-27 23:21 ` Paul Cercueil 2021-05-27 23:21 ` [PATCH 08/11] drm/ingenic: Support custom GEM object Paul Cercueil 2021-05-27 23:21 ` Paul Cercueil 2021-05-27 23:21 ` [PATCH 09/11] drm/ingenic: Add ingenic_drm_gem_fb_destroy() function Paul Cercueil 2021-05-27 23:21 ` Paul Cercueil 2021-05-27 23:22 ` [PATCH 10/11] drm/ingenic: Add doublescan feature Paul Cercueil 2021-05-27 23:22 ` Paul Cercueil 2021-05-27 23:22 ` [PATCH 11/11] drm/ingenic: Attach bridge chain to encoders Paul Cercueil 2021-05-27 23:22 ` Paul Cercueil 2021-06-01 15:54 ` [PATCH 10/11] drm/ingenic: Add doublescan feature Daniel Vetter 2021-06-01 15:54 ` Daniel Vetter
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=20210527232104.152577-7-paul@crapouillou.net \ --to=paul@crapouillou.net \ --cc=airlied@linux.ie \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mips@vger.kernel.org \ --cc=list@opendingux.net \ --cc=mripard@kernel.org \ --cc=narmstrong@baylibre.com \ --cc=tzimmermann@suse.de \ /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: linkBe 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.