Hi,

On Fri, 12 Dec 2025 16:14:37 +0100, Michel Dänzer <[email protected]> 
wrote:

> 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 
> >> <[email protected]> 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.

It turns out this writes are not uses for VGA out, I suspect this is
only for a RDP thing. The VGA cursor control is in
ast_cursor_plane_helper_atomic_update [1].

I'm testing a final patch without that and will send it ASAP.

Thanks,
        René

[1] 
https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/ast/ast_cursor.c#L279

-- 
René Rebe, ExactCODE GmbH, Berlin, Germany
https://exactco.dehttps://t2linux.comhttps://patreon.com/renerebe

Reply via email to