From: Pekka Paalanen <ppaalanen@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH libdrm 2/3] drm_fourcc: Add DRM_FORMAT_C[124]
Date: Tue, 8 Mar 2022 11:24:41 +0200 [thread overview]
Message-ID: <20220308112441.6e9e785a@eldfell> (raw)
In-Reply-To: <c9b62e081b77b625654e7d4477bfd63fe3833c35.1646683737.git.geert@linux-m68k.org>
[-- Attachment #1: Type: text/plain, Size: 2951 bytes --]
On Mon, 7 Mar 2022 21:53:17 +0100
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Add fourcc codes for color-indexed frame buffer formats with two, four,
> and sixteen colors. Add support for creating buffers using these
> formats.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> include/drm/drm_fourcc.h | 5 ++++-
> tests/modetest/buffers.c | 15 +++++++++++++++
> tests/util/format.c | 3 +++
> 3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> index 957c7be29239c0a1..f8b18d28a71dabff 100644
> --- a/include/drm/drm_fourcc.h
> +++ b/include/drm/drm_fourcc.h
> @@ -99,7 +99,10 @@ extern "C" {
> #define DRM_FORMAT_INVALID 0
>
> /* color index */
> -#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
> +#define DRM_FORMAT_C1 fourcc_code('C', '1', ' ', ' ') /* [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte */
> +#define DRM_FORMAT_C2 fourcc_code('C', '2', ' ', ' ') /* [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte */
> +#define DRM_FORMAT_C4 fourcc_code('C', '4', ' ', ' ') /* [7:0] C0:C1 4:4 two pixels/byte */
> +#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C 8 one pixel/byte */
Hi Geert,
I believe updates to drm_fourcc.h in libdrm must be done with the
specific process, please see
https://gitlab.freedesktop.org/mesa/drm/-/blob/main/include/drm/README
section "When and how to update these files".
Thanks,
pq
>
> /* 8 bpp Red */
> #define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
> diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
> index 8a8d9e0143474378..af7f60b4fb4d09ad 100644
> --- a/tests/modetest/buffers.c
> +++ b/tests/modetest/buffers.c
> @@ -135,6 +135,18 @@ bo_create(int fd, unsigned int format,
> int ret;
>
> switch (format) {
> + case DRM_FORMAT_C1:
> + bpp = 1;
> + break;
> +
> + case DRM_FORMAT_C2:
> + bpp = 2;
> + break;
> +
> + case DRM_FORMAT_C4:
> + bpp = 4;
> + break;
> +
> case DRM_FORMAT_C8:
> case DRM_FORMAT_NV12:
> case DRM_FORMAT_NV21:
> @@ -283,6 +295,9 @@ bo_create(int fd, unsigned int format,
> planes[2] = virtual + offsets[2];
> break;
>
> + case DRM_FORMAT_C1:
> + case DRM_FORMAT_C2:
> + case DRM_FORMAT_C4:
> case DRM_FORMAT_C8:
> case DRM_FORMAT_ARGB4444:
> case DRM_FORMAT_XRGB4444:
> diff --git a/tests/util/format.c b/tests/util/format.c
> index 1ca1b82ce947b2f4..4b984af9bce8ac6f 100644
> --- a/tests/util/format.c
> +++ b/tests/util/format.c
> @@ -40,6 +40,9 @@
>
> static const struct util_format_info format_info[] = {
> /* Indexed */
> + { DRM_FORMAT_C1, "C1" },
> + { DRM_FORMAT_C2, "C2" },
> + { DRM_FORMAT_C4, "C4" },
> { DRM_FORMAT_C8, "C8" },
> /* YUV packed */
> { DRM_FORMAT_UYVY, "UYVY", MAKE_YUV_INFO(YUV_YCbCr | YUV_CY, 2, 2, 2) },
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-03-08 9:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 20:53 [PATCH libdrm 0/3] Add support for low-color frame buffer formats Geert Uytterhoeven
2022-03-07 20:53 ` [PATCH libdrm 1/3] util: Optimize C8 SMPTE color LUT Geert Uytterhoeven
2022-03-07 20:53 ` [PATCH libdrm 2/3] drm_fourcc: Add DRM_FORMAT_C[124] Geert Uytterhoeven
2022-03-08 9:24 ` Pekka Paalanen [this message]
2022-03-07 20:53 ` [PATCH libdrm 3/3] util: Add SMPTE pattern support for C4 format Geert Uytterhoeven
2022-03-07 21:23 ` Ilia Mirkin
2022-03-08 7:57 ` Geert Uytterhoeven
2022-03-14 13:06 ` Geert Uytterhoeven
2022-03-14 13:43 ` Ilia Mirkin
2022-03-14 14:06 ` Geert Uytterhoeven
2022-03-14 14:39 ` Ilia Mirkin
2022-03-14 14:48 ` Geert Uytterhoeven
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=20220308112441.6e9e785a@eldfell \
--to=ppaalanen@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
/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.