Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: "Michael Schmitz" <schmitzmic@gmail.com>,
	"Miro Kropáček" <miro.kropacek@gmail.com>
Cc: Linmao Li <lilinmao@kylinos.cn>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] fbdev: atafb: Restrict SuperBlitter to supported formats
Date: Thu, 10 Sep 2026 22:39:16 +0200	[thread overview]
Message-ID: <a8cb0e4f-a2fd-4478-99d6-fdb043a9d15c@gmx.de> (raw)
In-Reply-To: <4f3c7184-1b5c-4074-b8a1-49261833df8f@gmail.com>

On 9/7/26 22:14, Michael Schmitz wrote:
> Hi Miro,
> 
> On 7/09/26 23:14, Miro Kropáček wrote:
>> Hi Linmao, hi Michael,
>>
>> On Sun, 6 Sept 2026 at 11:49, Michael Schmitz <schmitzmic@gmail.com> wrote:
>>> Hi Linmao,
>>>
>>> thanks for your patch!
>>>
>>> Am 27.08.2026 um 21:39 schrieb Linmao Li:
>>>> The SuperBlitter operations derive an integer byte count per pixel.  The
>>>> accelerated fill path handles only one-, two- and four-byte pixels.
>>>> However, the operations are currently installed for every external
>>>> framebuffer in SuperVidel RAM, including planar 1/2/4/8-bpp and 24-bpp
>>>> truecolor modes accepted by the external video parser.
>>>>
>>>> For 1/2/4-bpp modes, the byte count becomes zero, so accelerated copies do
>>>> nothing and fills fall through to 32-bit stores.  Planar 8-bpp uses an
>>>> incompatible memory layout.  For 24-bpp modes, fills also use 32-bit stores
>>>> despite advancing addresses by three bytes per pixel.  These cases can
>>>> corrupt the framebuffer beyond the requested rectangle.
>>> I believe 24 bpp mode can be rescued using something like this (entirely
>>> untested):
>>>
>>> --- a/drivers/video/fbdev/atafb.c
>>> +++ b/drivers/video/fbdev/atafb.c
>>> @@ -2463,6 +2463,11 @@ static void svblit_fillrect(struct fb_info *info,
>>>           case 2:
>>>                   memset16((u16 *)line, pix, rect->width);
>>>                   break;
>>> +       case 3:
>>> +               memset(line, pix, ((rect->width * bytespp) % 4));
>>> +               line += ((rect->width * bytespp) % 4);
>>> +               memset32((u32 *)line, pix, (rect->width * bytespp) / 4);
>>> +               break;
>>>           default:
>>>                   memset32((u32 *)line, pix, rect->width);
>>>                   break;
>>>
>>> Can't test this on hardware, and would need Miro to confirm it works as
>>> intended.
>> Linmao's patch: I ran it on a Falcon with SuperVidel at
>> 1920x1080x32bpp, all good.
>>
>> Michael's 24bpp fill: I cannot test it because the SuperVidel has no
>> 24bpp video mode. It was planned but never implemented. Its mode
>> register offers 1/2/4/8-bit bitplane, 8-bit chunky, 16-bit highcolor
>> and 32-bit truecolor (24-bit RGB plus an alpha byte), with the
>> remaining code reserved - and TOS offers no 24bpp mode to set.
> Without a 24 bpp mode, the 24 bpp fill is pointless, so no point trying to keep that mode alive.
>> Unless I overlooked something, the fill also looks wrong on paper: the
>> first line is filled with a repeated byte and then with repeated
>> 32-bit words of the same value, which cannot reproduce a 3-byte pixel
>> pattern unless all three bytes are equal.
> 
> You're correct - we'd need a memset24() to account for that. Without hardware support this is an academic exercise that I don't have time for :-)
> 
>> On the fbset question: no, the pixel format, depth and geometry of an
>> external framebuffer cannot be changed at runtime here. fbset -depth
>> 16 and fbset -xres 1024 -yres 768 both return success and change
>> nothing, because ext_decode_var() only validates against the values
>> from the boot argument, ext_encode_var() re-derives every field from
>> the external_* globals and ext_set_par() is empty. Only a reboot with
>> a different atafb:external: argument changes the mode.
> 
> All good then - do you need my Acked-by for Linmao's patch, Helge?

No, I think your Reviewed-by is sufficient.

But I added a
Tested-by: Miro Kropáček <miro.kropacek@gmail.com>
tag, if that's Ok for you, Miro?
It's always good to know if a patch has been tested.

With that, I just added the patch to the fbdev git tree.

Thanks!
Helge

  parent reply	other threads:[~2026-09-10 20:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27  9:39 [PATCH] fbdev: atafb: Restrict SuperBlitter to supported formats Linmao Li
2026-09-06  1:49 ` Michael Schmitz
2026-09-07  8:38   ` Geert Uytterhoeven
2026-09-07 20:18     ` Michael Schmitz
2026-09-07 11:14   ` Miro Kropáček
2026-09-07 20:14     ` Michael Schmitz
2026-09-08  7:18       ` Geert Uytterhoeven
2026-09-11  4:53         ` Michael Schmitz
2026-09-11  7:36           ` Geert Uytterhoeven
2026-09-10 20:39       ` Helge Deller [this message]
2026-09-11  0:17         ` Miro Kropáček
2026-09-11  3:42         ` Michael Schmitz

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=a8cb0e4f-a2fd-4478-99d6-fdb043a9d15c@gmx.de \
    --to=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=lilinmao@kylinos.cn \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miro.kropacek@gmail.com \
    --cc=schmitzmic@gmail.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