From: Sean Paul <sean@poorly.run>
To: Derek Basehore <dbasehore@chromium.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Sam Ravnborg <sam@ravnborg.org>,
intel-gfx@lists.freedesktop.org,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
linux-kernel@vger.kernel.org,
Jani Nikula <jani.nikula@linux.intel.com>,
David Airlie <airlied@linux.ie>,
Thierry Reding <thierry.reding@gmail.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Rodrigo Vivi <rodrigo.vivi@intel.com>, CK Hu <ck.hu@mediatek.com>,
linux-mediatek@lists.infradead.org, Sean Paul <sean@poorly.run>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v8 3/4] drm/connector: Split out orientation quirk detection
Date: Mon, 7 Oct 2019 12:45:51 -0400 [thread overview]
Message-ID: <20191007164551.GC126146@art_vandelay> (raw)
In-Reply-To: <20190925225833.7310-4-dbasehore@chromium.org>
On Wed, Sep 25, 2019 at 03:58:32PM -0700, Derek Basehore wrote:
> Not every platform needs quirk detection for panel orientation, so
> split the drm_connector_init_panel_orientation_property into two
> functions. One for platforms without the need for quirks, and the
> other for platforms that need quirks.
>
> Signed-off-by: Derek Basehore <dbasehore@chromium.org>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
> ---
> drivers/gpu/drm/drm_connector.c | 45 ++++++++++++++++++-------
> drivers/gpu/drm/i915/display/icl_dsi.c | 2 +-
> drivers/gpu/drm/i915/display/intel_dp.c | 4 +--
> drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +-
> include/drm/drm_connector.h | 2 ++
> 5 files changed, 39 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 4c766624b20d..faef25683faf 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1989,31 +1989,23 @@ EXPORT_SYMBOL(drm_connector_set_vrr_capable_property);
> * drm_connector_init_panel_orientation_property -
> * initialize the connecters panel_orientation property
> * @connector: connector for which to init the panel-orientation property.
> - * @width: width in pixels of the panel, used for panel quirk detection
> - * @height: height in pixels of the panel, used for panel quirk detection
> *
> * This function should only be called for built-in panels, after setting
> * connector->display_info.panel_orientation first (if known).
> *
> - * This function will check for platform specific (e.g. DMI based) quirks
> - * overriding display_info.panel_orientation first, then if panel_orientation
> - * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the
> - * "panel orientation" property to the connector.
> + * This function will check if the panel_orientation is not
> + * DRM_MODE_PANEL_ORIENTATION_UNKNOWN. If not, it will attach the "panel
> + * orientation" property to the connector.
> *
> * Returns:
> * Zero on success, negative errno on failure.
> */
> int drm_connector_init_panel_orientation_property(
> - struct drm_connector *connector, int width, int height)
> + struct drm_connector *connector)
> {
> struct drm_device *dev = connector->dev;
> struct drm_display_info *info = &connector->display_info;
> struct drm_property *prop;
> - int orientation_quirk;
> -
> - orientation_quirk = drm_get_panel_orientation_quirk(width, height);
> - if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
> - info->panel_orientation = orientation_quirk;
>
> if (info->panel_orientation == DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
> return 0;
> @@ -2036,6 +2028,35 @@ int drm_connector_init_panel_orientation_property(
> }
> EXPORT_SYMBOL(drm_connector_init_panel_orientation_property);
>
> +/**
> + * drm_connector_init_panel_orientation_property_quirk -
> + * initialize the connecters panel_orientation property with a quirk
> + * override
> + * @connector: connector for which to init the panel-orientation property.
> + * @width: width in pixels of the panel, used for panel quirk detection
> + * @height: height in pixels of the panel, used for panel quirk detection
> + *
> + * This function will check for platform specific (e.g. DMI based) quirks
> + * overriding display_info.panel_orientation first, then if panel_orientation
> + * is not DRM_MODE_PANEL_ORIENTATION_UNKNOWN it will attach the
> + * "panel orientation" property to the connector.
> + *
> + * Returns:
> + * Zero on success, negative errno on failure.
> + */
> +int drm_connector_init_panel_orientation_property_quirk(
> + struct drm_connector *connector, int width, int height)
> +{
> + int orientation_quirk;
> +
> + orientation_quirk = drm_get_panel_orientation_quirk(width, height);
> + if (orientation_quirk != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
> + connector->display_info.panel_orientation = orientation_quirk;
> +
> + return drm_connector_init_panel_orientation_property(connector);
> +}
> +EXPORT_SYMBOL(drm_connector_init_panel_orientation_property_quirk);
> +
> int drm_connector_set_obj_prop(struct drm_mode_object *obj,
> struct drm_property *property,
> uint64_t value)
> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
> index 6e398c33a524..483287984090 100644
> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
> @@ -1538,7 +1538,7 @@ static void icl_dsi_add_properties(struct intel_connector *connector)
>
> connector->base.display_info.panel_orientation =
> intel_dsi_get_panel_orientation(connector);
> - drm_connector_init_panel_orientation_property(&connector->base,
> + drm_connector_init_panel_orientation_property_quirk(&connector->base,
> connector->panel.fixed_mode->hdisplay,
> connector->panel.fixed_mode->vdisplay);
> }
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 921ad0a2f7ba..419413fa8165 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7076,8 +7076,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> intel_panel_setup_backlight(connector, pipe);
>
> if (fixed_mode)
> - drm_connector_init_panel_orientation_property(
> - connector, fixed_mode->hdisplay, fixed_mode->vdisplay);
> + drm_connector_init_panel_orientation_property_quirk(connector,
> + fixed_mode->hdisplay, fixed_mode->vdisplay);
>
> return true;
>
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
> index a71b22bdd95b..46cfb0821c17 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
> @@ -1634,7 +1634,7 @@ static void vlv_dsi_add_properties(struct intel_connector *connector)
>
> connector->base.display_info.panel_orientation =
> vlv_dsi_get_panel_orientation(connector);
> - drm_connector_init_panel_orientation_property(
> + drm_connector_init_panel_orientation_property_quirk(
> &connector->base,
> connector->panel.fixed_mode->hdisplay,
> connector->panel.fixed_mode->vdisplay);
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 681cb590f952..e3416ac11478 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1540,6 +1540,8 @@ void drm_connector_set_link_status_property(struct drm_connector *connector,
> void drm_connector_set_vrr_capable_property(
> struct drm_connector *connector, bool capable);
> int drm_connector_init_panel_orientation_property(
> + struct drm_connector *connector);
> +int drm_connector_init_panel_orientation_property_quirk(
> struct drm_connector *connector, int width, int height);
> int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
> int min, int max);
> --
> 2.23.0.351.gc4317032e6-goog
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
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-10-07 16:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 22:58 [PATCH v8 0/4] Panel rotation patches Derek Basehore
2019-09-25 22:58 ` [PATCH v8 1/4] drm/panel: Add helper for reading DT rotation Derek Basehore
2019-10-07 16:38 ` Sean Paul
2019-10-07 22:12 ` dbasehore .
2019-10-08 14:56 ` Sean Paul
2019-09-25 22:58 ` [PATCH v8 2/4] drm/panel: set display info in panel attach Derek Basehore
2019-09-29 5:23 ` [v8,2/4] " james qian wang (Arm Technology China)
2019-09-30 23:14 ` dbasehore .
2019-10-07 16:44 ` Sean Paul
2019-10-07 22:01 ` dbasehore .
2019-10-08 15:02 ` Sean Paul
2019-09-25 22:58 ` [PATCH v8 3/4] drm/connector: Split out orientation quirk detection Derek Basehore
2019-10-07 16:45 ` Sean Paul [this message]
2019-09-25 22:58 ` [PATCH v8 4/4] drm/mtk: add panel orientation property Derek Basehore
2019-10-07 16:48 ` Sean Paul
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=20191007164551.GC126146@art_vandelay \
--to=sean@poorly.run \
--cc=airlied@linux.ie \
--cc=ck.hu@mediatek.com \
--cc=daniel@ffwll.ch \
--cc=dbasehore@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthias.bgg@gmail.com \
--cc=maxime.ripard@bootlin.com \
--cc=p.zabel@pengutronix.de \
--cc=rodrigo.vivi@intel.com \
--cc=sam@ravnborg.org \
--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).