All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Javier Martinez Canillas <javierm@redhat.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Helge Deller <deller@gmx.de>, Maxime Ripard <maxime@cerno.tech>,
	sam@ravnborg.org, Michal Suchanek <msuchanek@suse.de>,
	Michael Ellerman <mpe@ellerman.id.au>,
	benh@kernel.crashing.org, Paul Mackerras <paulus@samba.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	mark.cave-ayland@ilande.co.uk, linux-fbdev@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers
Date: Wed, 12 Oct 2022 17:59:45 +0300	[thread overview]
Message-ID: <Y0bWYb0z1HZ2PztG@intel.com> (raw)
In-Reply-To: <a81e1acf-64dd-f69d-d97f-4a1af534e8e6@suse.de>

On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote:
> Hi
> 
> Am 12.10.22 um 15:12 schrieb Arnd Bergmann:
> > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote:
> >>
> >> Could well be. But ofdrm intents to replace offb and this test has
> >> worked well in offb for almost 15 yrs. If there are bug reports, I'm
> >> happy to take patches, but until then I see no reason to change it.
> > 
> > I wouldn't change the code in offb unless a user reports a bug,
> > but I don't see a point in adding the same mistake to ofdrm if we
> > know it can't work on real hardware.
> 
> As I said, this has worked with offb and apparently on real hardware. 
> For all I know, ATI hardware (before it became AMD) was used in PPC 
> Macintoshs and assumed big-endian access on those machines.

At least mach64 class hardware has two frame buffer apertures, and
byte swapping can be configured separately for each. But that means
you only get correct byte swapping for at most two bpps at the same
time (and that only if you know which aperture to access each time).
IIRC Rage 128 already has the surface register stuff where you
could byte swap a limited set of ranges independently. And old
mga hardware has just one byte swap setting for the whole frame
buffer aperture, so only one bpp at a time.

That kind of horrible limitations of the byte swappers is the
main reason why I wanted to make drm fourcc endianness explicit.
Simply assuming host endianness would end in tears on big endian
as soon as you need to access stuff with two bpps at the same time.
Much better to just switch off those useless byte swappers and
swap by hand when necessary.

-- 
Ville Syrjälä
Intel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: linux-fbdev@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	David Airlie <airlied@linux.ie>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Helge Deller <deller@gmx.de>,
	linuxppc-dev@lists.ozlabs.org, mark.cave-ayland@ilande.co.uk,
	Javier Martinez Canillas <javierm@redhat.com>,
	dri-devel@lists.freedesktop.org,
	Paul Mackerras <paulus@samba.org>,
	Maxime Ripard <maxime@cerno.tech>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Michal Suchanek <msuchanek@suse.de>,
	sam@ravnborg.org
Subject: Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers
Date: Wed, 12 Oct 2022 17:59:45 +0300	[thread overview]
Message-ID: <Y0bWYb0z1HZ2PztG@intel.com> (raw)
In-Reply-To: <a81e1acf-64dd-f69d-d97f-4a1af534e8e6@suse.de>

On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote:
> Hi
> 
> Am 12.10.22 um 15:12 schrieb Arnd Bergmann:
> > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote:
> >>
> >> Could well be. But ofdrm intents to replace offb and this test has
> >> worked well in offb for almost 15 yrs. If there are bug reports, I'm
> >> happy to take patches, but until then I see no reason to change it.
> > 
> > I wouldn't change the code in offb unless a user reports a bug,
> > but I don't see a point in adding the same mistake to ofdrm if we
> > know it can't work on real hardware.
> 
> As I said, this has worked with offb and apparently on real hardware. 
> For all I know, ATI hardware (before it became AMD) was used in PPC 
> Macintoshs and assumed big-endian access on those machines.

At least mach64 class hardware has two frame buffer apertures, and
byte swapping can be configured separately for each. But that means
you only get correct byte swapping for at most two bpps at the same
time (and that only if you know which aperture to access each time).
IIRC Rage 128 already has the surface register stuff where you
could byte swap a limited set of ranges independently. And old
mga hardware has just one byte swap setting for the whole frame
buffer aperture, so only one bpp at a time.

That kind of horrible limitations of the byte swappers is the
main reason why I wanted to make drm fourcc endianness explicit.
Simply assuming host endianness would end in tears on big endian
as soon as you need to access stuff with two bpps at the same time.
Much better to just switch off those useless byte swappers and
swap by hand when necessary.

-- 
Ville Syrjälä
Intel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: linux-fbdev@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	David Airlie <airlied@linux.ie>, Helge Deller <deller@gmx.de>,
	linuxppc-dev@lists.ozlabs.org, mark.cave-ayland@ilande.co.uk,
	Javier Martinez Canillas <javierm@redhat.com>,
	dri-devel@lists.freedesktop.org,
	Paul Mackerras <paulus@samba.org>,
	Maxime Ripard <maxime@cerno.tech>,
	Daniel Vetter <daniel@ffwll.ch>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Michal Suchanek <msuchanek@suse.de>,
	sam@ravnborg.org
Subject: Re: [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers
Date: Wed, 12 Oct 2022 17:59:45 +0300	[thread overview]
Message-ID: <Y0bWYb0z1HZ2PztG@intel.com> (raw)
In-Reply-To: <a81e1acf-64dd-f69d-d97f-4a1af534e8e6@suse.de>

On Wed, Oct 12, 2022 at 04:31:14PM +0200, Thomas Zimmermann wrote:
> Hi
> 
> Am 12.10.22 um 15:12 schrieb Arnd Bergmann:
> > On Wed, Oct 12, 2022, at 2:00 PM, Thomas Zimmermann wrote:
> >>
> >> Could well be. But ofdrm intents to replace offb and this test has
> >> worked well in offb for almost 15 yrs. If there are bug reports, I'm
> >> happy to take patches, but until then I see no reason to change it.
> > 
> > I wouldn't change the code in offb unless a user reports a bug,
> > but I don't see a point in adding the same mistake to ofdrm if we
> > know it can't work on real hardware.
> 
> As I said, this has worked with offb and apparently on real hardware. 
> For all I know, ATI hardware (before it became AMD) was used in PPC 
> Macintoshs and assumed big-endian access on those machines.

At least mach64 class hardware has two frame buffer apertures, and
byte swapping can be configured separately for each. But that means
you only get correct byte swapping for at most two bpps at the same
time (and that only if you know which aperture to access each time).
IIRC Rage 128 already has the surface register stuff where you
could byte swap a limited set of ranges independently. And old
mga hardware has just one byte swap setting for the whole frame
buffer aperture, so only one bpp at a time.

That kind of horrible limitations of the byte swappers is the
main reason why I wanted to make drm fourcc endianness explicit.
Simply assuming host endianness would end in tears on big endian
as soon as you need to access stuff with two bpps at the same time.
Much better to just switch off those useless byte swappers and
swap by hand when necessary.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-10-12 14:59 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 10:50 [PATCH v4 0/5] drm: Add driver for PowerPC OF displays Thomas Zimmermann
2022-09-28 10:50 ` Thomas Zimmermann
2022-09-28 10:50 ` [PATCH v4 1/5] drm/ofdrm: Add ofdrm for Open Firmware framebuffers Thomas Zimmermann
2022-09-28 10:50   ` Thomas Zimmermann
2022-09-28 10:50 ` [PATCH v4 2/5] drm/ofdrm: Add CRTC state Thomas Zimmermann
2022-09-28 10:50   ` Thomas Zimmermann
2022-09-28 10:50 ` [PATCH v4 3/5] drm/ofdrm: Add per-model device function Thomas Zimmermann
2022-09-28 10:50   ` Thomas Zimmermann
2022-09-28 10:50 ` [PATCH v4 4/5] drm/ofdrm: Support color management Thomas Zimmermann
2022-09-28 10:50   ` Thomas Zimmermann
2022-09-28 10:50 ` [PATCH v4 5/5] drm/ofdrm: Support big-endian scanout buffers Thomas Zimmermann
2022-09-28 10:50   ` Thomas Zimmermann
2022-09-28 11:12   ` Michal Suchánek
2022-09-28 11:12     ` Michal Suchánek
2022-09-28 11:12     ` Michal Suchánek
2022-09-28 11:30     ` Thomas Zimmermann
2022-09-28 11:30       ` Thomas Zimmermann
2022-09-28 11:30       ` Thomas Zimmermann
2022-10-11  7:46   ` Javier Martinez Canillas
2022-10-11 11:30     ` Thomas Zimmermann
2022-10-11 20:06       ` Arnd Bergmann
2022-10-11 21:38         ` Michal Suchánek
2022-10-11 21:38           ` Michal Suchánek
2022-10-11 21:38           ` Michal Suchánek
2022-10-12  6:29           ` Arnd Bergmann
2022-10-12  7:23             ` Michal Suchánek
2022-10-12  6:46         ` Thomas Zimmermann
2022-10-12  7:17           ` Arnd Bergmann
2022-10-12  7:40             ` Thomas Zimmermann
2022-10-12  7:44               ` Arnd Bergmann
2022-10-12  8:27                 ` Thomas Zimmermann
2022-10-12  8:38                   ` Arnd Bergmann
2022-10-12 12:00                     ` Thomas Zimmermann
2022-10-12 13:12                       ` Arnd Bergmann
2022-10-12 14:27                         ` Michal Suchánek
2022-10-12 14:27                           ` Michal Suchánek
2022-10-12 14:27                           ` Michal Suchánek
2022-10-13  7:39                           ` Javier Martinez Canillas
2022-10-13  7:39                             ` Javier Martinez Canillas
2022-10-13  7:39                             ` Javier Martinez Canillas
2022-10-17  6:44                             ` Benjamin Herrenschmidt
2022-10-17  6:44                               ` Benjamin Herrenschmidt
2022-10-17  6:44                               ` Benjamin Herrenschmidt
2022-10-12 14:31                         ` Thomas Zimmermann
2022-10-12 14:59                           ` Ville Syrjälä [this message]
2022-10-12 14:59                             ` Ville Syrjälä
2022-10-12 14:59                             ` Ville Syrjälä
2022-10-12 16:01                             ` Michal Suchánek
2022-10-12 16:01                               ` Michal Suchánek
2022-10-12 16:01                               ` Michal Suchánek
2022-10-12 12:07                     ` Michal Suchánek
2022-10-12 12:07                       ` Michal Suchánek
2022-10-12 12:07                       ` Michal Suchánek

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=Y0bWYb0z1HZ2PztG@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=maxime@cerno.tech \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=paulus@samba.org \
    --cc=sam@ravnborg.org \
    --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.