From: Inki Dae <inki.dae@samsung.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"Joonyoung Shim" <jy0922.shim@samsung.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
"Andrzej Hajda" <a.hajda@samsung.com>,
"Krzysztof Kozlowski" <k.kozlowski@samsung.com>,
"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
"Tobias Jakobi" <tjakobi@math.uni-bielefeld.de>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
vincent.abriou@st.com, fabien.dessenne@st.com
Subject: Re: [PATCH v5 5/5] drm/exynos: add support for blending properties
Date: Mon, 29 Feb 2016 08:31:52 +0900 [thread overview]
Message-ID: <56D38368.1040806@samsung.com> (raw)
In-Reply-To: <1453905883-6807-6-git-send-email-m.szyprowski@samsung.com>
2016년 01월 27일 23:44에 Marek Szyprowski 이(가) 쓴 글:
> This patch adds support for blending related properties to Exynos DRM
> core and Exynos Mixer CRTC device.
To drm-misc.
Acked-by : Inki Dae <inki.dae@samsung.com>
Thanks,
Inki Dae
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/gpu/drm/exynos/exynos_drm_drv.h | 5 +++
> drivers/gpu/drm/exynos/exynos_drm_plane.c | 60 +++++++++++++++++++++++++++++++
> 2 files changed, 65 insertions(+)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> index 816537886e4e..b33d69b8bb38 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> @@ -92,6 +92,9 @@ struct exynos_drm_plane {
> #define EXYNOS_DRM_PLANE_CAP_DOUBLE (1 << 0)
> #define EXYNOS_DRM_PLANE_CAP_SCALE (1 << 1)
> #define EXYNOS_DRM_PLANE_CAP_ZPOS (1 << 2)
> +#define EXYNOS_DRM_PLANE_CAP_PLANE_ALPHA (1 << 3)
> +#define EXYNOS_DRM_PLANE_CAP_PREMULT_ALPHA (1 << 4)
> +#define EXYNOS_DRM_PLANE_CAP_BLENDING (1 << 5)
>
> /*
> * Exynos DRM plane configuration structure.
> @@ -100,6 +103,7 @@ struct exynos_drm_plane {
> * @type: type of the plane (primary, cursor or overlay).
> * @pixel_formats: supported pixel formats.
> * @num_pixel_formats: number of elements in 'pixel_formats'.
> + * @blending_mode: default blending mode.
> * @capabilities: supported features (see EXYNOS_DRM_PLANE_CAP_*)
> */
>
> @@ -108,6 +112,7 @@ struct exynos_drm_plane_config {
> enum drm_plane_type type;
> const uint32_t *pixel_formats;
> unsigned int num_pixel_formats;
> + unsigned int blending_mode;
> unsigned int capabilities;
> };
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> index 3a486939168e..28502aac135f 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> @@ -140,6 +140,9 @@ static void exynos_drm_plane_reset(struct drm_plane *plane)
> plane->state = &exynos_state->base;
> plane->state->plane = plane;
> plane->state->zpos = exynos_plane->config->zpos;
> + plane->state->alpha = 255;
> + plane->state->alpha_premult = 1;
> + plane->state->blending = exynos_plane->config->blending_mode;
> }
> }
>
> @@ -284,6 +287,53 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane,
> drm_object_attach_property(&plane->base, prop, zpos);
> }
>
> +static void exynos_plane_attach_alpha_property(struct drm_plane *plane)
> +{
> + struct drm_device *dev = plane->dev;
> +
> + if (!dev->mode_config.alpha_property)
> + if (drm_mode_create_alpha_property(dev, 255))
> + return;
> +
> + drm_object_attach_property(&plane->base,
> + dev->mode_config.alpha_property, 255);
> +}
> +
> +static void exynos_plane_attach_alpha_premult_property(struct drm_plane *plane)
> +{
> + struct drm_device *dev = plane->dev;
> +
> + if (!dev->mode_config.alpha_premult_property)
> + if (drm_mode_create_alpha_premult_property(dev)) {
> + printk("failed to create alpha premult property\n");
> + return;
> + }
> +
> + drm_object_attach_property(&plane->base,
> + dev->mode_config.alpha_premult_property, 1);
> +}
> +
> +static void exynos_plane_attach_blending_property(struct drm_plane *plane,
> + unsigned int blending_mode)
> +{
> + struct drm_device *dev = plane->dev;
> + static unsigned int blending_modes[] = {
> + DRM_BLEND_DISABLED,
> + DRM_BLEND_PIXEL_ALPHA,
> + DRM_BLEND_CONST_ALPHA,
> + DRM_BLEND_PIXEL_CONST_ALPHA,
> + };
> +
> + if (!dev->mode_config.blending_property)
> + if (drm_mode_create_blending_property(dev, blending_modes,
> + ARRAY_SIZE(blending_modes)))
> + return;
> +
> + drm_object_attach_property(&plane->base,
> + dev->mode_config.blending_property,
> + blending_mode);
> +}
> +
> int exynos_plane_init(struct drm_device *dev,
> struct exynos_drm_plane *exynos_plane,
> unsigned int index, unsigned long possible_crtcs,
> @@ -310,5 +360,15 @@ int exynos_plane_init(struct drm_device *dev,
> exynos_plane_attach_zpos_property(&exynos_plane->base, config->zpos,
> !(config->capabilities & EXYNOS_DRM_PLANE_CAP_ZPOS));
>
> + if (config->capabilities & EXYNOS_DRM_PLANE_CAP_PLANE_ALPHA)
> + exynos_plane_attach_alpha_property(&exynos_plane->base);
> +
> + if (config->capabilities & EXYNOS_DRM_PLANE_CAP_PREMULT_ALPHA)
> + exynos_plane_attach_alpha_premult_property(&exynos_plane->base);
> +
> + if (config->capabilities & EXYNOS_DRM_PLANE_CAP_BLENDING)
> + exynos_plane_attach_blending_property(&exynos_plane->base,
> + config->blending_mode);
> +
> return 0;
> }
>
next prev parent reply other threads:[~2016-02-28 23:31 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ä
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 [this message]
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=56D38368.1040806@samsung.com \
--to=inki.dae@samsung.com \
--cc=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=benjamin.gaignard@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabien.dessenne@st.com \
--cc=gustavo@padovan.org \
--cc=jy0922.shim@samsung.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=ville.syrjala@linux.intel.com \
--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