mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel.daenzer@mailbox.org>
To: "Thomas Zimmermann" <tzimmermann@suse.de>, "René Rebe" <rene@exactco.de>
Cc: tpearson@raptorengineering.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, airlied@redhat.com
Subject: Re: [PATCH] drm/ast: Fix big-endian support
Date: Fri, 12 Dec 2025 16:14:37 +0100	[thread overview]
Message-ID: <c5e4fd12-38d9-4169-88d1-115cc38ca409@mailbox.org> (raw)
In-Reply-To: <2e26a6e6-6f4b-4b48-8fd0-648372856dce@suse.de>

On 12/11/25 15:56, Thomas Zimmermann wrote:
> Am 11.12.25 um 15:31 schrieb René Rebe:
>> On Thu, 11 Dec 2025 15:03:48 +0100, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>
>>>       /* write checksum + signature */
>>> +    writel(swab32(csum), dst);
>>> +    writel(swab32(width), dst + AST_HWC_SIGNATURE_SizeX);
>>> +    writel(swab32(height), dst + AST_HWC_SIGNATURE_SizeY);
>>> +    writel(swab32(0), dst + AST_HWC_SIGNATURE_HOTSPOTX);
>>> +    writel(swab32(0), dst + AST_HWC_SIGNATURE_HOTSPOTY);
>>> +#else
>>> +    memcpy_toio(dst, src, AST_HWC_SIZE);
>>>       dst += AST_HWC_SIZE;
>>> +
>>> +    /* write checksum + signature */
>>>       writel(csum, dst);
>>>       writel(width, dst + AST_HWC_SIGNATURE_SizeX);
>>>       writel(height, dst + AST_HWC_SIGNATURE_SizeY);
>>>       writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTX);
>>>       writel(0, dst + AST_HWC_SIGNATURE_HOTSPOTY);
>>> +#endif
>> I'm pretty sure this will break the cursor, as the position was
>> working correctly and I only had to swap the cursor image data. The
>> csum will also not be identical anyway, as the checksum function
>> computes it in native byte order. Theoretically that would have to be
>> changed. However, I do not see where it is really used, maybe only
>> some special remote desktop vendor protocol that I'm not using. Maybe
>> the exact checksum does not even matter and is only used as
>> optimization to not resend an unchanged cursor image.
> 
> Oh well! I though that the bus does implicit byte swaps? Or does writel() already swap to little endian, which the AST chip expects? I'm confused.

FWIW, writel indeed converts from native byte order to little endian, see include/asm-generic/io.h.

Can't help with your other questions though.


-- 
Earthling Michel Dänzer       \        GNOME / Xwayland / Mesa developer
https://redhat.com             \               Libre software enthusiast

  reply	other threads:[~2025-12-12 15:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 16:06 René Rebe
2025-12-03  9:40 ` Thomas Zimmermann
2025-12-03 10:14   ` René Rebe
2025-12-03 10:28     ` Thomas Zimmermann
2025-12-05 15:14   ` René Rebe
2025-12-05 18:31     ` Timothy Pearson
2025-12-05 19:46       ` Thomas Zimmermann
2025-12-05 19:50         ` René Rebe
2025-12-08  8:44           ` Thomas Zimmermann
2025-12-09 12:13             ` René Rebe
2025-12-10  8:55               ` Thomas Zimmermann
2025-12-10 15:33                 ` René Rebe
2025-12-10 15:41                   ` Thomas Zimmermann
2025-12-10 16:56                     ` René Rebe
2025-12-11  7:22                       ` Thomas Zimmermann
2025-12-11 12:43                         ` René Rebe
2025-12-11 14:03                           ` Thomas Zimmermann
2025-12-11 14:31                             ` René Rebe
2025-12-11 14:56                               ` Thomas Zimmermann
2025-12-12 15:14                                 ` Michel Dänzer [this message]
2025-12-12 17:54                                   ` René Rebe
2025-12-12 20:15                               ` René Rebe
2025-12-15  7:27                                 ` Thomas Zimmermann

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=c5e4fd12-38d9-4169-88d1-115cc38ca409@mailbox.org \
    --to=michel.daenzer@mailbox.org \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene@exactco.de \
    --cc=tpearson@raptorengineering.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

all inboxes | Powered by JetHome®