From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Jyri Sarha <jsarha@ti.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/7] drm/omap: drop unneeded locking from mgr_fld_write()
Date: Tue, 3 Sep 2019 17:14:54 +0300 [thread overview]
Message-ID: <20190903141454.GD4812@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190902125359.18001-2-tomi.valkeinen@ti.com>
Hi Tomi,
Thank you for the patch.
On Mon, Sep 02, 2019 at 03:53:53PM +0300, Tomi Valkeinen wrote:
> Commit d49cd15550d9d4495f6187425318c245d58cb63f ("OMAPDSS: DISPC: lock
> access to DISPC_CONTROL & DISPC_CONFIG") added locking to
> mgr_fld_write(). This was needed in omapfb times due to lack of good
> locking, especially in the case of both V4L2 and fbdev layers using the
> DSS driver.
>
> This is not needed for omapdrm, so we can remove the locking.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
I've followed all code paths, and they end up either in the bridge
enable operations or the CRTC atomic flush (disregarding
suspend/resume). Those can't race each other, so this should be safe.
> ---
> drivers/gpu/drm/omapdrm/dss/dispc.c | 16 +---------------
> 1 file changed, 1 insertion(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index 785c5546067a..c6da33e7014f 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -184,9 +184,6 @@ struct dispc_device {
>
> struct regmap *syscon_pol;
> u32 syscon_pol_offset;
> -
> - /* DISPC_CONTROL & DISPC_CONFIG lock*/
> - spinlock_t control_lock;
> };
>
> enum omap_color_component {
> @@ -377,16 +374,7 @@ static void mgr_fld_write(struct dispc_device *dispc, enum omap_channel channel,
> enum mgr_reg_fields regfld, int val)
> {
> const struct dispc_reg_field rfld = mgr_desc[channel].reg_desc[regfld];
While at it, should you turn this into a pointer to avoid an unnecessary
copy ?
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> - const bool need_lock = rfld.reg == DISPC_CONTROL || rfld.reg == DISPC_CONFIG;
> - unsigned long flags;
> -
> - if (need_lock) {
> - spin_lock_irqsave(&dispc->control_lock, flags);
> - REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low);
> - spin_unlock_irqrestore(&dispc->control_lock, flags);
> - } else {
> - REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low);
> - }
> + REG_FLD_MOD(dispc, rfld.reg, val, rfld.high, rfld.low);
> }
>
> static int dispc_get_num_ovls(struct dispc_device *dispc)
> @@ -4769,8 +4757,6 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
> platform_set_drvdata(pdev, dispc);
> dispc->dss = dss;
>
> - spin_lock_init(&dispc->control_lock);
> -
> /*
> * The OMAP3-based models can't be told apart using the compatible
> * string, use SoC device matching.
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-09-03 14:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 12:53 [PATCH 0/7] drm/omap: misc improvements Tomi Valkeinen
2019-09-02 12:53 ` [PATCH 1/7] drm/omap: drop unneeded locking from mgr_fld_write() Tomi Valkeinen
2019-09-03 14:14 ` Laurent Pinchart [this message]
2019-09-02 12:53 ` [PATCH 2/7] drm/omap: tweak HDMI DDC timings Tomi Valkeinen
2019-09-03 14:23 ` Laurent Pinchart
2019-09-26 12:54 ` Tomi Valkeinen
2019-09-26 14:40 ` Alejandro Hernandez
2019-09-02 12:53 ` [PATCH 3/7] drm/omap: fix missing scaler pixel fmt limitations Tomi Valkeinen
2019-09-03 15:12 ` Laurent Pinchart
2019-09-26 12:55 ` Tomi Valkeinen
2019-09-02 12:53 ` [PATCH 4/7] drm/omap: Implement CTM property for CRTC using OVL managers CPR matrix Tomi Valkeinen
2019-09-03 15:24 ` Laurent Pinchart
[not found] ` <b44372e2-1bb7-ddb8-d121-ae096b38d918@ti.com>
2019-09-04 11:11 ` Laurent Pinchart
2019-09-04 20:08 ` Jyri Sarha
2019-09-04 20:20 ` Ilia Mirkin
2020-09-21 11:08 ` Tomi Valkeinen
2020-09-21 11:49 ` Pekka Paalanen
2020-09-22 7:44 ` Tomi Valkeinen
2020-09-22 9:48 ` Pekka Paalanen
2020-09-22 10:02 ` Daniel Stone
2019-09-04 21:52 ` Laurent Pinchart
2019-09-05 10:00 ` Jyri Sarha
2019-09-05 10:05 ` Laurent Pinchart
2019-09-05 13:48 ` Jyri Sarha
2019-09-02 12:53 ` [PATCH 5/7] drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes Tomi Valkeinen
2019-09-03 15:32 ` Laurent Pinchart
2019-09-05 9:24 ` Jyri Sarha
2019-09-05 9:43 ` Laurent Pinchart
2019-09-02 12:53 ` [PATCH 6/7] drm/omap: dss: platform_register_drivers() to dss.c and remove core.c Tomi Valkeinen
2019-09-03 15:34 ` Laurent Pinchart
2019-09-04 6:47 ` Jyri Sarha
2019-09-02 12:53 ` [PATCH 7/7] drm/omap: hdmi5: automatically choose limited/full range output Tomi Valkeinen
2019-09-03 15:38 ` Laurent Pinchart
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=20190903141454.GD4812@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=tomi.valkeinen@ti.com \
/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