Page MenuHomeFreeBSD

ofwfb: fix incorrect colors on powerpc*, add new tunable parameters
ClosedPublic

Authored by alfredo on Feb 12 2021, 12:48 AM.
Referenced Files
Unknown Object (File)
Fri, Mar 29, 3:32 PM
Unknown Object (File)
Thu, Mar 28, 7:24 PM
Unknown Object (File)
Mar 19 2024, 9:39 PM
Unknown Object (File)
Mar 19 2024, 5:41 PM
Unknown Object (File)
Mar 13 2024, 7:54 PM
Unknown Object (File)
Jan 17 2024, 10:50 AM
Unknown Object (File)
Jan 13 2024, 1:48 PM
Unknown Object (File)
Dec 23 2023, 4:15 AM
Subscribers

Details

Summary
  • Implements little-endian support (powerpc64le)
  • Adds 'hw.ofwfb.physaddr' kernel parameter so user can manually provide correct address if it's not detected correctly
  • Adds 'hw.ofwfb.argb32_pixel' so user can set it manually if colors are inverted due to incorrect pixel format (default value is 1)
  • Automatically selects RGBA32 pixel format if NVidia graphic adapter is detected (sets hw.ofwfb.argb32_pixel=0)

During tests it was observed that machines equipped with NVidia graphic adapters tend to use RGBA32 pixel format. By default ARGB32 pixel format is used, proved to work on machines equipped with ATI graphic adapter and the onboard adapter used on Talos II and Blackbird machines from Raptor Computing Systems.

*Patch taken originally from @bdragon with small modifications

It looks like ofwfb is only used on powerpc world. Adding ARM and MIPS teams as reviewers due to changes in sys/sys/fbio.h

Test Plan

runtime test on:

  • QEMU (powerpc64, using vnc)
  • PowerBook5,6 (powerpc 32 bits G4)

build test on:

  • powerpc64/powerpc
  • powerpc64le/powerpc
  • powerpc/powerpc
  • powerpcspe/powerpc
  • aarch64/arm64
  • amd64/amd64

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Confirmed correct on an nvidia-based powerbook g4.

Also, double checked on an ATI-based powerbook g4 for comparison.

(BTW, for those testing - running "vidcontrol show" is the best way to verify that the pixel format is 100% correct, as it lets you verify the 16-color palette against the color names.)

The fbio.h change will need build-tested for universe kernels.

Looks good. I have been using a slightly modified version of this on Talos II and it is working well.

sys/dev/vt/hw/ofwfb/ofwfb.c
429

Does this work on LE?
Or does OF_getencprop need to be used instead?

475–480

This fails to compile on LE, due to missing braces.

alfredo edited the test plan for this revision. (Show Details)

fix missing braces on powerpc64le

powerpc64, powerpc64le, amd64, aarch64

Also, double checked on an ATI-based powerbook g4 for comparison.

Tested on PowerBook G4 ATI-based with succes (PowerBook5.6 -model A1106)

The fbio.h change will need build-tested for universe kernels.

sys/dev/vt/hw/ofwfb/ofwfb.c
429

Good catch, thanks!
If possible, please try this latest version as base for your patches, on powerpc64le

alfredo added reviewers: ARM, MIPS.

Should be good for HEAD.

However, the fbio change should be tested on i386 PAE to make sure it doesn't cause binary incompatibility. If it does, we won't be able to MFC it as is.

This revision is now accepted and ready to land.Feb 18 2021, 9:59 PM

Should be good for HEAD.

However, the fbio change should be tested on i386 PAE to make sure it doesn't cause binary incompatibility. If it does, we won't be able to MFC it as is.

Thanks! As we discussed on IRC, I'm going to split this patch in two commits so ofwfb.c can be MFCed to stable/13 to avoid the risk of ABI break on other platforms using fbio.h

Worked fine on PPC64LE, both on Talos and QEMU, with D27475 to fix boot with ofwfb on LE.