Index | Thread | Search

From:
Crystal Kolipe <kolipe.c@exoticsilicon.com>
Subject:
Re: rasops32: fix fonts on byte swapped framebuffers
To:
Ted Bullock <tbullock@comlore.com>
Cc:
tech@openbsd.org
Date:
Wed, 07 Oct 2026 21:14:49 -0000

Download raw body.

Thread
On Wed, Oct 07, 2026 at 01:14:57PM -0600, Ted Bullock wrote:
> The existing implementation is already reasonably well optimized. The
> problem addressed by my patch is the order of those pixels when
> writing to a byte swapped framebuffer, as happens with Radeon on
> SPARC64. The patch corrects that while preserving the existing
> optimization.

But most of your diff is seemingly unreleated to the byte swapping.  Why the
need to change the existing calculations based on 'rp' for some equivalent
logic that you've called 'dp'?

My comment about better performance was referring to the fact that you're now
testing for RI_BSWAP to set the u.d[][] values every single time putchar() is
called.

It's trivial to do this byte swapping once per font load, and write the
pre-swapped pixel data out directly if doing 64-bit writes.

Also, this comment is somewhat misleading:

On Wed, Oct 07, 2026 at 06:34:02AM -0600, tbullock@comlore.com wrote:
> +			 * Write each 32 bit pixel individually to avoid the
> +			 * pixel order issue with the union's 64 bit pixel pairs
> +			 * on byte swapped framebuffers.

The existing code below already writes each 32-bit pixel individually, and
doesn't use the 64-bit type punned reading of the 32-bit values.