Page MenuHomeFreeBSD

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

Authored by alfredo on Feb 12 2021, 12:48 AM.

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
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36928
Build 33817: arc lint + arc unit

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
428

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

474–479

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
428

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.