From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Rob Clark <robdclark@chromium.org>,
Philip Chen <philipchen@chromium.org>,
Jitao Shi <jitao.shi@mediatek.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Jonas Karlman <jonas@kwiboo.se>,
Robert Foss <robert.foss@linaro.org>,
Neil Armstrong <narmstrong@baylibre.com>,
Douglas Anderson <dianders@chromium.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Andrzej Hajda <a.hajda@samsung.com>,
dri-devel@lists.freedesktop.org,
Enric Balletbo i Serra <enric.balletbo@collabora.com>
Subject: Re: [PATCH v1 1/9] drm/bridge: add DRM_BRIDGE_STATE_OPS macro
Date: Tue, 8 Feb 2022 02:30:42 +0200 [thread overview]
Message-ID: <YgG5snx6y69SKU6w@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220206154405.1243333-2-sam@ravnborg.org>
Hi Sam,
Thank you for the patch.
On Sun, Feb 06, 2022 at 04:43:57PM +0100, Sam Ravnborg wrote:
> The DRM_BRIDGE_STATE_OPS can be used as shortcut for bridge drivers that
> do not subclass drm_bridge_state to assign the default operations for
> reset, duplicate and destroy of the state.
>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> include/drm/drm_bridge.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 061d87313fac..fc00304be643 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -935,4 +935,16 @@ static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev,
> }
> #endif
>
> +/**
> + * DRM_BRIDGE_STATE_OPS - Default drm_bridge state funcs
I'd name the macro DRM_BRIDGE_STATE_DEFAULT_OPS.
> + *
> + * Bridge driver that do not subclass &drm_bridge_state can use the helpers
> + * for reset, duplicate, and destroy. This macro provides a shortcut for
> + * setting the helpers in the &drm_bridge_funcs structure.
> + */
> +#define DRM_BRIDGE_STATE_OPS \
> + .atomic_reset = drm_atomic_helper_bridge_reset, \
> + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, \
> + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state
I'm not a big fan of such macros for a small number of operations, as I
find that it obfuscates the code a bit, but that could change once I get
used to the new macro :-)
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +
> #endif
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-02-08 0:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 15:43 [PATCH v1 0/9] drm/bridge: ps8640 and ti-sn65dsi86 updates Sam Ravnborg
2022-02-06 15:43 ` [PATCH v1 1/9] drm/bridge: add DRM_BRIDGE_STATE_OPS macro Sam Ravnborg
2022-02-07 22:19 ` Doug Anderson
2022-02-08 0:30 ` Laurent Pinchart [this message]
2022-02-12 21:15 ` Sam Ravnborg
2022-02-06 15:43 ` [PATCH v1 2/9] drm: add drm specific media-bus-format header file Sam Ravnborg
2022-02-07 22:21 ` Doug Anderson
2022-02-08 0:40 ` Laurent Pinchart
2022-02-06 15:43 ` [PATCH v1 3/9] drm: add drm_atomic_helper_bridge_dsi_input_bus_fmt Sam Ravnborg
2022-02-07 22:32 ` Doug Anderson
2022-02-08 0:44 ` Laurent Pinchart
2022-02-08 19:06 ` Sam Ravnborg
2022-02-06 15:44 ` [PATCH v1 4/9] drm/bridge: ti-sn65dsi86: Use atomic variants of drm_bridge_funcs Sam Ravnborg
2022-02-07 22:33 ` Doug Anderson
2022-02-08 0:46 ` Laurent Pinchart
2022-02-06 15:44 ` [PATCH v1 5/9] drm/bridge: ti-sn65dsi86: Fetch bpc via drm_bridge_state Sam Ravnborg
2022-02-07 22:34 ` Doug Anderson
2022-02-08 19:08 ` Sam Ravnborg
2022-02-06 15:44 ` [PATCH v1 6/9] drm/bridge: ti-sn65dsi86: Add NO_CONNECTOR support Sam Ravnborg
2022-02-07 22:34 ` Doug Anderson
2022-02-08 1:01 ` Laurent Pinchart
2022-02-08 19:12 ` Sam Ravnborg
2022-03-09 16:52 ` Kieran Bingham
2022-02-06 15:44 ` [PATCH v1 7/9] drm/bridge: ps8640: Use atomic variants of drm_bridge_funcs Sam Ravnborg
2022-02-06 15:44 ` [PATCH v1 8/9] drm/bridge: ps8640: plug atomic_get_input_bus_fmts Sam Ravnborg
2022-02-06 15:44 ` [PATCH v1 9/9] drm/bridge: Drop unused drm_bridge_chain functions Sam Ravnborg
2022-02-08 0:52 ` Laurent Pinchart
2022-02-06 19:09 ` [PATCH v1 0/9] drm/bridge: ps8640 and ti-sn65dsi86 updates Sam Ravnborg
2022-06-22 10:07 ` Kieran Bingham
2022-06-22 16:45 ` Sam Ravnborg
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=YgG5snx6y69SKU6w@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=enric.balletbo@collabora.com \
--cc=jernej.skrabec@gmail.com \
--cc=jitao.shi@mediatek.com \
--cc=jonas@kwiboo.se \
--cc=narmstrong@baylibre.com \
--cc=philipchen@chromium.org \
--cc=robdclark@chromium.org \
--cc=robert.foss@linaro.org \
--cc=sam@ravnborg.org \
--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: 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