[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90c892fe-e56c-49b0-b8a3-8a7d6d18fb41@ijzerbout.nl>
Date: Wed, 11 Dec 2024 22:34:53 +0100
From: Kees Bakker <kees@...erbout.nl>
To: Jocelyn Falempe <jfalempe@...hat.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
John Ogness <john.ogness@...utronix.de>,
Javier Martinez Canillas <javierm@...hat.com>,
"Guilherme G . Piccoli" <gpiccoli@...lia.com>,
bluescreen_avenger@...izon.net, Caleb Connolly <caleb.connolly@...aro.org>,
Petr Mladek <pmladek@...e.com>, Jani Nikula <jani.nikula@...ux.intel.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [v9,1/6] drm/panic: Move drawing functions to drm_draw
Op 04-12-2024 om 16:45 schreef Jocelyn Falempe:
> Move the color conversions, blit and fill functions to drm_draw.c,
> so that they can be re-used by drm_log.
> drm_draw is internal to the drm subsystem, and shouldn't be used by
> gpu drivers.
>
> Signed-off-by: Jocelyn Falempe <jfalempe@...hat.com>
> Reviewed-by: Thomas Zimmermann <tzimmermann@...e.de>
> ---
>
> v5:
> * Export drm_draw symbols, so they can be used if drm_client_lib is built as module.
>
> v6:
> * rebase and solve conflict with "drm/panic: Add ABGR2101010 support"
>
> v9:
> * Rename drm_draw.h to drm_draw_internal.h (Jani Nikula)
>
> drivers/gpu/drm/Kconfig | 5 +
> drivers/gpu/drm/Makefile | 1 +
> drivers/gpu/drm/drm_draw.c | 233 +++++++++++++++++++++++++
> drivers/gpu/drm/drm_draw_internal.h | 56 ++++++
> drivers/gpu/drm/drm_panic.c | 257 +++-------------------------
> 5 files changed, 318 insertions(+), 234 deletions(-)
> create mode 100644 drivers/gpu/drm/drm_draw.c
> create mode 100644 drivers/gpu/drm/drm_draw_internal.h
>
> [...]
> diff --git a/drivers/gpu/drm/drm_draw.c b/drivers/gpu/drm/drm_draw.c
> new file mode 100644
> index 000000000000..cb2ad12bce57
> --- /dev/null
> +++ b/drivers/gpu/drm/drm_draw.c
> @@ -0,0 +1,233 @@
> +[...]
> +void drm_draw_fill24(struct iosys_map *dmap, unsigned int dpitch,
> + unsigned int height, unsigned int width,
> + u16 color)
> +{
> + unsigned int y, x;
> +
> + for (y = 0; y < height; y++) {
> + for (x = 0; x < width; x++) {
> + unsigned int off = y * dpitch + x * 3;
> +
> + /* write blue-green-red to output in little endianness */
> + iosys_map_wr(dmap, off, u8, (color & 0x000000FF) >> 0);
> + iosys_map_wr(dmap, off + 1, u8, (color & 0x0000FF00) >> 8);
> + iosys_map_wr(dmap, off + 2, u8, (color & 0x00FF0000) >> 16);
> + }
> + }
> +}
>
u16 is not wide enough for a 24bit color
--
Kees
Powered by blists - more mailing lists