All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Kees Bakker <kees@ijzerbout.nl>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	John Ogness <john.ogness@linutronix.de>,
	Javier Martinez Canillas <javierm@redhat.com>,
	"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
	bluescreen_avenger@verizon.net,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Petr Mladek <pmladek@suse.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [v9,1/6] drm/panic: Move drawing functions to drm_draw
Date: Thu, 12 Dec 2024 09:36:40 +0100	[thread overview]
Message-ID: <6e0f1727-6712-4c5e-8ca2-68ecf002deb0@redhat.com> (raw)
In-Reply-To: <90c892fe-e56c-49b0-b8a3-8a7d6d18fb41@ijzerbout.nl>

On 11/12/2024 22:34, Kees Bakker wrote:
> 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@redhat.com>
>> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.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

Good catch, I will send a fix when I get some time.

Best regards,

-- 

Jocelyn


  reply	other threads:[~2024-12-12  8:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 15:44 [PATCH v9 0/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 1/6] drm/panic: Move drawing functions to drm_draw Jocelyn Falempe
2024-12-11 21:34   ` [v9,1/6] " Kees Bakker
2024-12-12  8:36     ` Jocelyn Falempe [this message]
2024-12-04 15:45 ` [PATCH v9 2/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-05 16:21   ` Thomas Zimmermann
2024-12-12  7:41   ` Dan Carpenter
2024-12-12  8:49     ` Jocelyn Falempe
2024-12-12  8:53       ` Dan Carpenter
2024-12-12 10:07       ` Simona Vetter
2024-12-18 12:25   ` Markus Elfring
2024-12-18 13:51     ` Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 3/6] drm/log: Do not draw if drm_master is taken Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 4/6] drm/log: Color the timestamp, to improve readability Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 5/6] drm/log: Implement suspend/resume Jocelyn Falempe
2024-12-04 15:45 ` [PATCH v9 6/6] drm/log: Add integer scaling support Jocelyn Falempe
2024-12-10 13:42 ` [PATCH v9 0/6] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-12-17 14:19 ` Geert Uytterhoeven
2024-12-17 14:46   ` Jocelyn Falempe
2024-12-17 14:54     ` Geert Uytterhoeven
2024-12-18 10:14       ` Jocelyn Falempe
2024-12-18 11:00         ` Geert Uytterhoeven
2024-12-18 11:41           ` Jocelyn Falempe
2024-12-18 14:18             ` Petr Mladek
2024-12-18 14:25               ` Geert Uytterhoeven
2024-12-18 14:58               ` Jocelyn Falempe
2024-12-18 15:03                 ` Geert Uytterhoeven
2024-12-18 16:18                 ` Petr Mladek
2024-12-19 11:24                   ` Jocelyn Falempe

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=6e0f1727-6712-4c5e-8ca2-68ecf002deb0@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=airlied@gmail.com \
    --cc=bluescreen_avenger@verizon.net \
    --cc=caleb.connolly@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gpiccoli@igalia.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=javierm@redhat.com \
    --cc=john.ogness@linutronix.de \
    --cc=kees@ijzerbout.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=pmladek@suse.com \
    --cc=tzimmermann@suse.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.