From: Peter Stuge <peter@stuge.se>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: hudson@trmm.net, markus@raatikainen.cc,
Daniel Vetter <daniel.vetter@ffwll.ch>,
linux-usb@vger.kernel.org,
dri-devel <dri-devel@lists.freedesktop.org>,
th020394@gmail.com, lkundrak@v3.sk, pontus.fuchs@gmail.com,
Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH v7 3/3] drm: Add GUD USB Display driver
Date: Fri, 12 Mar 2021 04:32:36 +0000 [thread overview]
Message-ID: <20210312043236.5102.qmail@stuge.se> (raw)
In-Reply-To: <CAKb7UvgRLa=_4vzeFS-ws6T28S_j8yz8Jq_ONowPcBKaBHwYkw@mail.gmail.com>
Ilia Mirkin wrote:
> XRGB8888 means that the memory layout should match a 32-bit integer,
> stored as LE, with the low bits being B, next bits being G, etc. This
> translates to byte 0 = B, byte 1 = G, etc. If you're on a BE system,
> and you're handed a XRGB8888 buffer, it still expects that byte 0 = B,
> etc (except as I outlined, some drivers which are from before these
> formats were a thing, sort of do their own thing). Thankfully this is
> equivalent to BGRX8888 (big-endian packing), so you can just munge the
> format.
I understand! Thanks a lot for clarifying.
It makes much more sense to me that the format indeed describes
what is in memory rather than how pixels look to software.
> > > I'm not sure why you guys were talking about BE in the first place,
> >
> > I was worried that the translation didn't consider endianess.
>
> The translation in gud_xrgb8888_to_color definitely seems suspect.
So to me this means that the gud_pipe translations from XRGB8888 to the
1-bit formats *do* have to adjust for the reversed order on BE.
> There's also a gud_is_big_endian, but I'm guessing this applies to the
> downstream device rather than the host system.
gud_is_big_endian() is a static bool wrapper around defined(__BIG_ENDIAN)
so yes, it applies to the host.
With memory layout being constant I again think gud_xrgb8888_to_color()
needs to take further steps to work correctly also on BE hosts. (Maybe
that's le32_to_cpu(*pix32), maybe drm_fb_swab(), maybe something else?)
> I didn't check if dev->mode_config.quirk_addfb_prefer_host_byte_order
> is set
I can't tell if that's helpful, probably Noralf can.
Thanks a lot
//Peter
next prev parent reply other threads:[~2021-03-12 4:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 16:31 [PATCH v7 0/3] GUD USB Display driver Noralf Trønnes
2021-03-05 16:31 ` [PATCH v7 1/3] drm/uapi: Add USB connector type Noralf Trønnes
2021-03-05 16:31 ` [PATCH v7 2/3] drm/probe-helper: Check epoch counter in output_poll_execute() Noralf Trønnes
2021-03-05 16:31 ` [PATCH v7 3/3] drm: Add GUD USB Display driver Noralf Trønnes
2021-03-08 18:13 ` Noralf Trønnes
2021-03-09 14:02 ` Peter Stuge
2021-03-09 18:07 ` Noralf Trønnes
2021-03-09 18:16 ` Noralf Trønnes
2021-03-10 4:55 ` Peter Stuge
2021-03-10 11:43 ` Noralf Trønnes
2021-03-11 14:48 ` Peter Stuge
2021-03-11 17:16 ` Noralf Trønnes
2021-03-11 20:02 ` Peter Stuge
2021-03-11 21:36 ` Ilia Mirkin
2021-03-11 22:57 ` Peter Stuge
2021-03-12 0:19 ` Ilia Mirkin
2021-03-12 4:32 ` Peter Stuge [this message]
2021-03-12 11:53 ` Noralf Trønnes
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=20210312043236.5102.qmail@stuge.se \
--to=peter@stuge.se \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hudson@trmm.net \
--cc=imirkin@alum.mit.edu \
--cc=linux-usb@vger.kernel.org \
--cc=lkundrak@v3.sk \
--cc=markus@raatikainen.cc \
--cc=pontus.fuchs@gmail.com \
--cc=sam@ravnborg.org \
--cc=th020394@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;
as well as URLs for NNTP newsgroup(s).