From: jacopo mondi <jacopo@jmondi.org>
To: Peter Rosin <peda@axentia.se>
Cc: devicetree@vger.kernel.org, airlied@linux.ie,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
Laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/8] drm: bridge: Add support for static image formats
Date: Thu, 26 Apr 2018 20:44:37 +0200 [thread overview]
Message-ID: <20180426184437.GR4235@w540> (raw)
In-Reply-To: <10891e93-ede5-8c39-b53e-da892e163b52@axentia.se>
[-- Attachment #1.1: Type: text/plain, Size: 3742 bytes --]
Hi Peter,
On Sun, Apr 22, 2018 at 10:02:23PM +0200, Peter Rosin wrote:
> On 2018-04-19 11:31, Jacopo Mondi wrote:
> > Add support for storing image format information in DRM bridges with
> > associated helper function.
> >
> > This patch replicates for bridges what 'drm_display_info_set_bus_formats()'
> > is for connectors.
> >
> > Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> > ---
> > drivers/gpu/drm/drm_bridge.c | 30 ++++++++++++++++++++++++++++++
> > include/drm/drm_bridge.h | 8 ++++++++
> > 2 files changed, 38 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> > index 1638bfe..e2ad098 100644
> > --- a/drivers/gpu/drm/drm_bridge.c
> > +++ b/drivers/gpu/drm/drm_bridge.c
> > @@ -157,6 +157,36 @@ void drm_bridge_detach(struct drm_bridge *bridge)
> > }
> >
> > /**
> > + * drm_bridge_set_bus_formats() - set bridge supported image formats
> > + * @bridge: the bridge to set image formats in
> > + * @formats: array of MEDIA_BUS_FMT\_ supported image formats
> > + * @num_formats: number of elements in the @formats array
> > + *
> > + * Store a list of supported image formats in a bridge.
> > + * See MEDIA_BUS_FMT_* definitions in include/uapi/linux/media-bus-format.h for
> > + * a full list of available formats.
> > + */
> > +int drm_bridge_set_bus_formats(struct drm_bridge *bridge, const u32 *formats,
> > + unsigned int num_formats)
> > +{
> > + u32 *fmts;
> > +
> > + if (!formats || !num_formats)
> > + return -EINVAL;
>
> I see no compelling reason to forbid restoring the number of reported
> input formats to zero? I can't think of a use right now of course, but it
> seems a bit odd all the same.
It is, you're right. Will fix in v2 and will allow bridges to just
restore formats to 0 (as it is done for drm_connectors, by the way)
Thanks
j
>
> Cheers,
> Peter
>
> > +
> > + fmts = kmemdup(formats, sizeof(*formats) * num_formats, GFP_KERNEL);
> > + if (!fmts)
> > + return -ENOMEM;
> > +
> > + kfree(bridge->bus_formats);
> > + bridge->bus_formats = fmts;
> > + bridge->num_bus_formats = num_formats;
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(drm_bridge_set_bus_formats);
> > +
> > +/**
> > * DOC: bridge callbacks
> > *
> > * The &drm_bridge_funcs ops are populated by the bridge driver. The DRM
> > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> > index 3270fec..6b3648c 100644
> > --- a/include/drm/drm_bridge.h
> > +++ b/include/drm/drm_bridge.h
> > @@ -258,6 +258,9 @@ struct drm_bridge_timings {
> > * @encoder: encoder to which this bridge is connected
> > * @next: the next bridge in the encoder chain
> > * @of_node: device node pointer to the bridge
> > + * @bus_formats: wire image formats. Array of @num_bus_formats MEDIA_BUS_FMT\_
> > + * elements
> > + * @num_bus_formats: size of @bus_formats array
> > * @list: to keep track of all added bridges
> > * @timings: the timing specification for the bridge, if any (may
> > * be NULL)
> > @@ -271,6 +274,9 @@ struct drm_bridge {
> > #ifdef CONFIG_OF
> > struct device_node *of_node;
> > #endif
> > + const u32 *bus_formats;
> > + unsigned int num_bus_formats;
> > +
> > struct list_head list;
> > const struct drm_bridge_timings *timings;
> >
> > @@ -296,6 +302,8 @@ void drm_bridge_mode_set(struct drm_bridge *bridge,
> > struct drm_display_mode *adjusted_mode);
> > void drm_bridge_pre_enable(struct drm_bridge *bridge);
> > void drm_bridge_enable(struct drm_bridge *bridge);
> > +int drm_bridge_set_bus_formats(struct drm_bridge *bridge, const u32 *fmts,
> > + unsigned int num_fmts);
> >
> > #ifdef CONFIG_DRM_PANEL_BRIDGE
> > struct drm_bridge *drm_panel_bridge_add(struct drm_panel *panel,
> >
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-04-26 18:44 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 9:31 [PATCH 0/8] drm: bridge: Add support for static image formats Jacopo Mondi
2018-04-19 9:31 ` [PATCH 1/8] " Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-26 18:44 ` jacopo mondi [this message]
2018-04-23 9:27 ` Laurent Pinchart
2018-04-26 18:40 ` jacopo mondi
2018-04-26 19:57 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 2/8] dt-bindings: display: bridge: thc63lvd1024: Add lvds map property Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-23 7:35 ` jacopo mondi
2018-04-23 11:59 ` Laurent Pinchart
2018-04-23 12:02 ` Laurent Pinchart
2018-04-24 16:37 ` Rob Herring
2018-04-19 9:31 ` [PATCH 3/8] drm: bridge: thc63lvd1024: Add support for LVDS mode map Jacopo Mondi
2018-04-22 20:02 ` Peter Rosin
2018-04-23 7:41 ` jacopo mondi
2018-04-23 12:12 ` Laurent Pinchart
2018-04-23 12:08 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 4/8] arm64: dts: renesas: eagle: Add thc63 LVDS map Jacopo Mondi
2018-04-23 10:29 ` Simon Horman
2018-04-23 13:07 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 5/8] media: Add LE version of RGB LVDS formats Jacopo Mondi
2018-04-23 13:06 ` Laurent Pinchart
2018-04-24 7:16 ` jacopo mondi
2018-04-19 9:31 ` [PATCH 6/8] drm: rcar-du: rcar-lvds: Add bridge format support Jacopo Mondi
2018-04-22 20:08 ` Peter Rosin
2018-04-23 7:28 ` jacopo mondi
2018-04-23 7:59 ` Peter Rosin
2018-04-23 8:47 ` jacopo mondi
2018-04-23 12:59 ` Laurent Pinchart
2018-04-19 9:31 ` [PATCH 7/8] drm: panel: Use _LE LVDS formats for data mirroring Jacopo Mondi
2018-04-19 9:31 ` [PATCH 8/8] drm: connector: Remove DRM_BUS_FLAG_DATA_* flags Jacopo Mondi
2018-04-23 21:03 ` Laurent Pinchart
2018-04-24 7:22 ` jacopo mondi
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=20180426184437.GR4235@w540 \
--to=jacopo@jmondi.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=peda@axentia.se \
/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).