From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
kernel@pengutronix.de, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/4] drm: add RGB formats with separate alpha plane
Date: Tue, 28 Feb 2017 18:58:01 +0200 [thread overview]
Message-ID: <20170228165801.GP31595@intel.com> (raw)
In-Reply-To: <1488291158-29082-1-git-send-email-p.zabel@pengutronix.de>
On Tue, Feb 28, 2017 at 03:12:35PM +0100, Philipp Zabel wrote:
> Some hardware can read the alpha components separately and then
> conditionally fetch color components only for non-zero alpha values.
> This patch adds fourcc definitions for two-plane RGB formats with an
> 8-bit alpha channel on a second plane.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Changes since v1:
> - Added a commend that the RGB plane has the same format as the corresponding
> RGB format without _A8.
> - Added lost drm_format_info fields for RGB565/BGR565/RGB888/BGR888_A8.
> ---
> drivers/gpu/drm/drm_fourcc.c | 8 ++++++++
> include/uapi/drm/drm_fourcc.h | 14 ++++++++++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 90d2cc8da8eb6..92bf3306d4b32 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -132,6 +132,8 @@ const struct drm_format_info *__drm_format_info(u32 format)
> { .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_RGBX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_BGRX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_RGB565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_BGR565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_RGBX1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> @@ -144,6 +146,12 @@ const struct drm_format_info *__drm_format_info(u32 format)
> { .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_RGBA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_BGRA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_RGB888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_BGR888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_XRGB8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_XBGR8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_RGBX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1 },
> + { .format = DRM_FORMAT_BGRX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1 },
> { .format = DRM_FORMAT_YUV410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4 },
> { .format = DRM_FORMAT_YVU410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4 },
> { .format = DRM_FORMAT_YUV411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1 },
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index ef20abb8119bf..f0060664ecb6a 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -114,6 +114,20 @@ extern "C" {
> #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
>
> /*
> + * 2 plane RGB + A
> + * index 0 = RGB plane, same format as the corresponding non _A8 format has
> + * index 1 = A plane
Please describe the contents fully. Eg. something like:
"index 1 = A plane, [7:0] A"
> + */
> +#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8')
> +#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8')
> +#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8')
> +#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8')
> +#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8')
> +#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8')
> +#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8')
> +#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8')
> +
> +/*
> * 2 plane YCbCr
> * index 0 = Y plane, [7:0] Y
> * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian
> --
> 2.11.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-02-28 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 14:12 [PATCH v2 1/4] drm: add RGB formats with separate alpha plane Philipp Zabel
2017-02-28 14:12 ` [PATCH v2 2/4] gpu: ipu-v3: add support for separate alpha channels Philipp Zabel
2017-02-28 14:12 ` [PATCH v2 3/4] drm/imx: extend drm_plane_state_to_eba for separate channel support Philipp Zabel
2017-02-28 14:12 ` [PATCH v2 4/4] drm/imx: ipuv3-plane: add support for separate alpha planes Philipp Zabel
2017-02-28 16:58 ` Ville Syrjälä [this message]
2017-03-01 9:02 ` [PATCH v2 1/4] drm: add RGB formats with separate alpha plane Philipp Zabel
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=20170228165801.GP31595@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=p.zabel@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.