Linux Samsung SOC development
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	dri-devel@lists.freedesktop.org,
	Andrzej Hajda <a.hajda@samsung.com>,
	Tobias Jakobi <tjakobi@math.uni-bielefeld.de>,
	fabien.dessenne@st.com, vincent.abriou@st.com
Subject: Re: [PATCH v5 3/5] drm: simplify initialization of rotation property
Date: Mon, 29 Feb 2016 17:13:13 +0200	[thread overview]
Message-ID: <20160229151313.GX15993@intel.com> (raw)
In-Reply-To: <1453905883-6807-4-git-send-email-m.szyprowski@samsung.com>

On Wed, Jan 27, 2016 at 03:44:41PM +0100, Marek Szyprowski wrote:
> This patch simplifies initialization of generic rotation property and
> aligns the code to match recently introduced function for intializing
> generic zpos property. It also adds missing documentation.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 10 ++++-----
>  drivers/gpu/drm/drm_crtc.c                      | 29 ++++++++++++++++++++-----
>  drivers/gpu/drm/i915/intel_display.c            |  6 ++---
>  drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c       |  3 +--
>  drivers/gpu/drm/omapdrm/omap_drv.c              |  3 +--
>  include/drm/drm_crtc.h                          |  4 ++--
>  6 files changed, 33 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 1ffe9c329c46..4f9606cdf0f2 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -967,12 +967,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev)
>  	if (!props->alpha)
>  		return ERR_PTR(-ENOMEM);
>  
> -	dev->mode_config.rotation_property =
> -			drm_mode_create_rotation_property(dev,
> -							  BIT(DRM_ROTATE_0) |
> -							  BIT(DRM_ROTATE_90) |
> -							  BIT(DRM_ROTATE_180) |
> -							  BIT(DRM_ROTATE_270));
> +	drm_mode_create_rotation_property(dev, BIT(DRM_ROTATE_0) |
> +					       BIT(DRM_ROTATE_90) |
> +					       BIT(DRM_ROTATE_180) |
> +					       BIT(DRM_ROTATE_270));
>  	if (!dev->mode_config.rotation_property)
>  		return ERR_PTR(-ENOMEM);
>  
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d40bab29747e..822ad6928144 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -5875,10 +5875,23 @@ void drm_mode_config_cleanup(struct drm_device *dev)
>  }
>  EXPORT_SYMBOL(drm_mode_config_cleanup);
>  
> -struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
> -						       unsigned int supported_rotations)
> +/**
> + * drm_mode_create_rotation_property - create generic rotation property
> + * @dev: DRM device
> + * @supported_rotations: bitmask of supported rotation modes
> + *
> + * This function initializes generic rotation property and enables support
> + * for it in drm core. Drivers can then attach this property to planes to enable
> + * support for different rotation modes.
> + *
> + * Returns:
> + * Zero on success, negative errno on failure.
> + */
> +int drm_mode_create_rotation_property(struct drm_device *dev,
> +				      unsigned int supported_rotations)
>  {
> -	static const struct drm_prop_enum_list props[] = {
> +	struct drm_property *prop;
> +	static const struct drm_prop_enum_list values[] = {
>  		{ DRM_ROTATE_0,   "rotate-0" },
>  		{ DRM_ROTATE_90,  "rotate-90" },
>  		{ DRM_ROTATE_180, "rotate-180" },
> @@ -5887,9 +5900,13 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
>  		{ DRM_REFLECT_Y,  "reflect-y" },
>  	};
>  
> -	return drm_property_create_bitmask(dev, 0, "rotation",
> -					   props, ARRAY_SIZE(props),
> -					   supported_rotations);
> +	prop = drm_property_create_bitmask(dev, 0, "rotation", values,
> +				ARRAY_SIZE(values), supported_rotations);
> +	if (!prop)
> +		return -ENOMEM;
> +
> +	dev->mode_config.rotation_property = prop;

Again, per-plane rotation properties are going to be needed, so this
isn't good.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-02-29 15:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 14:44 [PATCH v5 0/5] drm/exynos: introduce generic zpos and blending properties Marek Szyprowski
2016-01-27 14:44 ` [PATCH v5 1/5] drm: add generic zpos property Marek Szyprowski
2016-02-29 15:12   ` Ville Syrjälä
2016-03-23  8:46     ` Benjamin Gaignard
2016-04-01 12:48     ` Benjamin Gaignard
2016-05-09  8:42       ` Benjamin Gaignard
2016-05-09  9:05         ` Daniel Vetter
2016-05-09 10:21           ` Tobias Jakobi
2016-01-27 14:44 ` [PATCH v5 2/5] drm/exynos: use generic code for managing zpos plane property Marek Szyprowski
2016-02-28 23:27   ` Inki Dae
2016-01-27 14:44 ` [PATCH v5 3/5] drm: simplify initialization of rotation property Marek Szyprowski
2016-02-29 15:06   ` Daniel Vetter
2016-02-29 15:09     ` Daniel Vetter
2016-02-29 15:17       ` Daniel Vetter
2016-02-29 15:13   ` Ville Syrjälä [this message]
2016-01-27 14:44 ` [PATCH v5 4/5] drm: add generic blending related properties Marek Szyprowski
2016-02-29 15:23   ` Ville Syrjälä
2016-01-27 14:44 ` [PATCH v5 5/5] drm/exynos: add support for blending properties Marek Szyprowski
2016-02-28 23:31   ` Inki Dae
2016-02-23  9:10 ` [PATCH v5 0/5] drm/exynos: introduce generic zpos and " Benjamin Gaignard

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=20160229151313.GX15993@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabien.dessenne@st.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=sw0312.kim@samsung.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    --cc=vincent.abriou@st.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