From: Heiko Stuebner <heiko@sntech.de>
To: Val Packett <val@packett.cool>
Cc: stable@vger.kernel.org, Sandy Huang <hjc@rock-chips.com>,
Andy Yan <andy.yan@rock-chips.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank on RK3066
Date: Sat, 08 Jun 2024 16:49:50 +0200 [thread overview]
Message-ID: <4253237.VLH7GnMWUR@phil> (raw)
In-Reply-To: <CNOFES.QFA1L3UJ3SH82@packett.cool>
Am Sonntag, 2. Juni 2024, 05:35:36 CEST schrieb Val Packett:
>
> On Mon, May 27 2024 at 20:11:49 -03:00:00, Val Packett
> <val@packett.cool> wrote:
> > The RK3066 VOP sets a dma_stop bit when it's done scanning out a frame
> > and needs the driver to acknowledge that by clearing the bit.
> >
> > So unless we clear it "between" frames, the RGB output only shows
> > noise
> > instead of the picture. vblank seems to be the most appropriate place
> > to
> > do it, since it indicates exactly that: that the hardware is done
> > with the frame.
> >
> > This seems to be a redundant synchronization mechanism that was
> > removed
> > in later iterations of the VOP hardware block.
> >
> > Fixes: f4a6de8 ("drm: rockchip: vop: add rk3066 vop definitions")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Val Packett <val@packett.cool>
> > ---
> > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 ++++++
> > drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 1 +
> > drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 +
> > 3 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> > b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> > index a13473b2d..2731fe2b2 100644
> > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> > @@ -1766,6 +1766,12 @@ static void vop_handle_vblank(struct vop *vop)
> > }
> > spin_unlock(&drm->event_lock);
> >
> > + if (VOP_HAS_REG(vop, common, dma_stop)) {
> > + spin_lock(&vop->reg_lock);
> > + VOP_REG_SET(vop, common, dma_stop, 0);
> > + spin_unlock(&vop->reg_lock);
> > + }
> > +
>
> Oops… so doing it here actually causes deadlocks, unless we also
> change all other reg_lock usages to be spin_lock_irq/spin_unlock_irq.
>
> Not sure if doing that or going back to v1 would be better.
then please go back to v1 (as v4) :-) .
I.e. regular spinlock vs. spin_lock_irq will have performance
implications and this "feature" is a one-time only thing used
only on a more than 10 year old soc, so it really must not affect
stuff coming after it.
Heiko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2024-06-08 14:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 23:11 [PATCH v3 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank on RK3066 Val Packett
2024-05-27 23:14 ` [PATCH v3 2/2] drm/rockchip: vop: enable VOP_FEATURE_INTERNAL_RGB " Val Packett
2024-06-02 3:35 ` [PATCH v3 1/2] drm/rockchip: vop: clear DMA stop bit upon vblank " Val Packett
2024-06-08 14:49 ` Heiko Stuebner [this message]
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=4253237.VLH7GnMWUR@phil \
--to=heiko@sntech.de \
--cc=airlied@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hjc@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
--cc=val@packett.cool \
/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).