linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Eero Tamminen <oak@helsinkinet.fi>
Cc: 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>,
	 Helge Deller <deller@gmx.de>,
	Michael Schmitz <schmitzmic@gmail.com>,
	dri-devel@lists.freedesktop.org,  linux-fbdev@vger.kernel.org,
	linux-m68k@vger.kernel.org,
	 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Subject: Re: [PATCH/RFC 0/3] Atari DRM driver
Date: Wed, 28 May 2025 10:57:32 +0200	[thread overview]
Message-ID: <CAMuHMdXDdrMewGgeghr3cwtaBvieguYOC4GZ-EXZmA+w5S4bpw@mail.gmail.com> (raw)
In-Reply-To: <72078ec9-25a0-42d5-b7da-b0a974033f86@helsinkinet.fi>

Hi Eero,

On Wed, 28 May 2025 at 00:47, Eero Tamminen <oak@helsinkinet.fi> wrote:
> On 25.5.2025 15.05, Geert Uytterhoeven wrote:
> > On Thu, 22 May 2025 at 00:56, Eero Tamminen <oak@helsinkinet.fi> wrote:
> >> On 21.5.2025 10.06, Geert Uytterhoeven wrote:
> >>> I do keep it up-to-date locally, so I could provide these changes,
> >>> if you are interested.
> >>
> >> Yes, please!   (see below)
> >
> > Sorry for taking so long:
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git/log/?h=atari-drm-wip-rebasing
>
> Thanks!
>
> I did boot testing on Hatari emulator with a minimal kernel config
> having atari_drm enabled, atafb disabled, FB & boot logo enabled.
>
> Under Falcon emulation:
> - RGB/VGA => works fine
> - Mono monitor => panic
>    "Kernel panic - not syncing: can't set default video mode"
> Under TT emulation:
> - RGB/VGA => boots, but console is black[1] (palette issue?)
> - Mono monitor => looks OKish[2], but has constant warnings:
> -----------------------------------
> WARNING: CPU: 0 PID: 1 at drivers/gpu/drm/drm_atomic_helper.c:1720
> drm_atomic_helper_wait_for_vblanks+0x1a0/0x1ee
> [CRTC:35:crtc-0] vblank wait timed out

I am not sure this is a bug in atari-drm, or just an issue when using
DRM on slow machines.

> -----------------------------------
>
> Under 030 ST/STe emulation:
> - RGB/VGA => boots, but console is black (palette issue?)
> - Mono monitor => looks OK, but has constant slowpath warnings with:
>    "[CRTC:35:crtc-0] vblank wait timed out"
>
> => Any advice on the issues?

Are these regression in atari-drm, or do they happen with atafb, too?

> PS. I also profiled where most of time goes from "atari-drm" probing,
> until boot reaches user space.  On a minimal -Os built kernel, running
> on (emulated) 32Mhz 030 Falcon, in the default 640x480@4 resolution:
> ----------------------------------------------------------------
> Time spent in profile = 15.29712s.
> ...
> Used cycles:
>    22.37%  22.42%  25.35%   _transp
>    19.15%  19.19%  46.82%   atari_drm_fb_blit_rect.isra.0
>     8.09%   8.09%  13.80%   sys_copyarea
>     3.94%   3.95%   6.23%   sys_imageblit
>     3.69%   3.69%   3.69%   fb_copy_offset.isra.0
>     2.12%   2.13%   2.41%   atari_scsi_falcon_reg_read
>     2.03%   2.03%   2.03%   fb_address_forward
>     1.85%   1.85%  17.98%   fbcon_redraw_blit.constprop.0
>     1.81%   1.81%   2.04%   atari_keyb_init
>     1.78%   1.78%   1.98%   fb_reverse_long
>     1.58%   1.58%   1.90%   arch_cpu_idle
>     1.05%                   memcpy
>     0.95%                   memset
> ...
> ----------------------------------------------------------------
>
> => atari-drm blitting takes half the time during boot.

Yeah, conversion from chunky to planar is expensive.
Would be great to have a text console that operates directly on the
buffer used by the hardware...

> Building kernel with -O2, changes above rather radically, both
> time-wise, and where that time goes:
> ----------------------------------------------------------------
> Time spent in profile = 6.54049s.
> ...
> Used cycles:
>    17.61%  17.61%  17.61%   sys_copyarea
>    11.18%  11.18%  13.11%   arch_cpu_idle
>     7.53%   7.55%   8.45%   atari_drm_fb_blit_rect.isra.0
>     4.26%   4.27%   4.76%   atari_keyb_init
>     2.70%   2.70%   2.93%   atari_scsi_falcon_reg_read
>     2.45%   2.45%  23.81%   fbcon_redraw_blit.constprop.0
>     2.35%   2.35%   2.48%   sys_imageblit
>     2.12%   2.12%   5.89%   atari_floppy_init
>     1.97%                   memset
>     1.31%                   memcpy
> ...
> Instruction cache misses:
>    27.14%  27.14%  27.14%   sys_copyarea
>     3.77%   3.77%   4.05%   atari_scsi_falcon_reg_read
> ...
> Data cache hits:
>    63.55%  63.55%  63.67%   atari_keyb_init
>     7.61%   7.62%   7.84%   atari_drm_fb_blit_rect.isra.0
>     3.86%   3.86%   3.86%   sys_copyarea <= not much hits for copying
> ...
> ----------------------------------------------------------------

So it would be worthwhile to factor out the code that is most
performance-critical into its own file, and use CFLAGS_foo.o += -O2
(or even -O3? or other options?) in the Makefile to build it with a
better optimization level.

> However, -O2 build has the downside that the resulting kernel Oopses
> once it reaches user-space, if 030 data cache emulation is enabled:
> ----------------------------------------------------------------
> Run /init as init process
> ...
> Instruction fault at 0x0041a256
> BAD KERNEL BUSERR

Interesting...

Thanks a lot for testing, and for your analysis!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2025-05-28  8:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 20:31 [PATCH/RFC 0/3] Atari DRM driver Geert Uytterhoeven
2022-11-25 20:31 ` [PATCH/RFC 1/3] video: fbdev: c2p: Add transp2() and transp2x() Geert Uytterhoeven
2022-11-25 20:31 ` [PATCH/RFC 2/3] drm/simple-kms-helper: Add mode_fixup() to simple display pipe Geert Uytterhoeven
2022-11-28  8:21   ` Maxime Ripard
2022-11-25 20:31 ` [PATCH/RFC 3/3] drm: atari: Add a DRM driver for Atari graphics hardware Geert Uytterhoeven
2022-11-28  8:28   ` Maxime Ripard
     [not found]   ` <488b261a-843e-de94-bace-16364e6f9d92@suse.de>
2022-11-28 13:08     ` Geert Uytterhoeven
2023-01-23 15:03 ` [PATCH/RFC 0/3] Atari DRM driver John Paul Adrian Glaubitz
2023-01-23 15:10   ` Geert Uytterhoeven
2025-05-20 23:59     ` Eero Tamminen
2025-05-21  7:06       ` Geert Uytterhoeven
2025-05-21 22:56         ` Eero Tamminen
2025-05-25 12:05           ` Geert Uytterhoeven
2025-05-27 22:47             ` Eero Tamminen
2025-05-28  8:57               ` Geert Uytterhoeven [this message]
2025-05-29  0:06                 ` Eero Tamminen
2025-05-29 19:19                   ` Eero Tamminen
2025-05-30  7:59                   ` 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=CAMuHMdXDdrMewGgeghr3cwtaBvieguYOC4GZ-EXZmA+w5S4bpw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=oak@helsinkinet.fi \
    --cc=schmitzmic@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).