From: Sam Ravnborg <sam@ravnborg.org>
To: Derek Basehore <dbasehore@chromium.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>,
intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
Thierry Reding <thierry.reding@gmail.com>,
linux-mediatek@lists.infradead.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Sean Paul <sean@poorly.run>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v7 2/4] drm/panel: set display info in panel attach
Date: Tue, 23 Jul 2019 11:19:45 +0200 [thread overview]
Message-ID: <20190723091945.GD787@ravnborg.org> (raw)
In-Reply-To: <20190710021659.177950-3-dbasehore@chromium.org>
Hi Derek.
On Tue, Jul 09, 2019 at 07:16:57PM -0700, Derek Basehore wrote:
> Devicetree systems can set panel orientation via a panel binding, but
> there's no way, as is, to propagate this setting to the connector,
> where the property need to be added.
> To address this, this patch sets orientation, as well as other fixed
> values for the panel, in the drm_panel_attach function. These values
> are stored from probe in the drm_panel struct.
This approch seems to conflict with work done by Laurent where the
ownership/creation of the connector will be moved to the display controller.
If I understand it correct then there should not be a 1:1 relation
between a panel and a connector anymore.
We should not try to work in two different directions with this.
Laurent, can you comment on this?
If we move forard with this patch, then all fields in drm_panel needs
kernel-doc - preferably inline.
Sam
>
> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> ---
> drivers/gpu/drm/drm_panel.c | 28 ++++++++++++++++++++++++++++
> include/drm/drm_panel.h | 14 ++++++++++++++
> 2 files changed, 42 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
> index 169bab54d52d..ca01095470a9 100644
> --- a/drivers/gpu/drm/drm_panel.c
> +++ b/drivers/gpu/drm/drm_panel.c
> @@ -104,11 +104,23 @@ EXPORT_SYMBOL(drm_panel_remove);
> */
> int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
> {
> + struct drm_display_info *info;
> +
> if (panel->connector)
> return -EBUSY;
>
> panel->connector = connector;
> panel->drm = connector->dev;
> + info = &connector->display_info;
> + info->width_mm = panel->width_mm;
> + info->height_mm = panel->height_mm;
> + info->bpc = panel->bpc;
> + info->panel_orientation = panel->orientation;
> + info->bus_flags = panel->bus_flags;
> + if (panel->bus_formats)
> + drm_display_info_set_bus_formats(&connector->display_info,
> + panel->bus_formats,
> + panel->num_bus_formats);
>
> return 0;
> }
> @@ -128,6 +140,22 @@ EXPORT_SYMBOL(drm_panel_attach);
> */
> int drm_panel_detach(struct drm_panel *panel)
> {
> + struct drm_display_info *info;
> +
> + if (!panel->connector)
> + goto out;
> +
> + info = &panel->connector->display_info;
> + info->width_mm = 0;
> + info->height_mm = 0;
> + info->bpc = 0;
> + info->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> + info->bus_flags = 0;
> + kfree(info->bus_formats);
> + info->bus_formats = NULL;
> + info->num_bus_formats = 0;
> +
> +out:
> panel->connector = NULL;
> panel->drm = NULL;
>
> diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
> index fc7da55f41d9..a6a881b987dd 100644
> --- a/include/drm/drm_panel.h
> +++ b/include/drm/drm_panel.h
> @@ -39,6 +39,8 @@ enum drm_panel_orientation;
> * struct drm_panel_funcs - perform operations on a given panel
> * @disable: disable panel (turn off back light, etc.)
> * @unprepare: turn off panel
> + * @detach: detach panel->connector (clear internal state, etc.)
> + * @attach: attach panel->connector (update internal state, etc.)
> * @prepare: turn on panel and perform set up
> * @enable: enable panel (turn on back light, etc.)
> * @get_modes: add modes to the connector that the panel is attached to and
> @@ -95,6 +97,18 @@ struct drm_panel {
>
> const struct drm_panel_funcs *funcs;
>
> + /*
> + * panel information to be set in the connector when the panel is
> + * attached.
> + */
> + unsigned int width_mm;
> + unsigned int height_mm;
> + unsigned int bpc;
> + int orientation;
> + const u32 *bus_formats;
> + unsigned int num_bus_formats;
> + u32 bus_flags;
> +
> struct list_head list;
> };
>
> --
> 2.22.0.410.gd8fdbe21b5-goog
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-07-23 9:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 2:16 [PATCH v7 0/4] Panel rotation patches Derek Basehore
2019-07-10 2:16 ` [PATCH v7 1/4] drm/panel: Add helper for reading DT rotation Derek Basehore
2019-07-10 2:16 ` [PATCH v7 2/4] drm/panel: set display info in panel attach Derek Basehore
2019-07-23 9:19 ` Sam Ravnborg [this message]
2019-07-24 22:15 ` dbasehore .
2019-07-26 13:15 ` Sam Ravnborg
2019-07-10 2:16 ` [PATCH v7 3/4] drm/connector: Split out orientation quirk detection Derek Basehore
2019-07-10 2:16 ` [PATCH v7 4/4] drm/mtk: add panel orientation property Derek Basehore
2019-07-11 6:41 ` CK Hu
2019-07-10 15:49 ` [PATCH v7 0/4] Panel rotation patches 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=20190723091945.GD787@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=dbasehore@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=maxime.ripard@bootlin.com \
--cc=rodrigo.vivi@intel.com \
--cc=sean@poorly.run \
--cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).