Page MenuHomeFreeBSD

Export RGB offsets with FBIO_GETRGBOFFS

Authored by luporl on Mar 1 2021, 6:22 PM.



Add a new ioctl to vt to make it possible to export RGB offsets
set by vt drivers.

This is intended to be used by xf86-video-scfb driver,
to properly set the RGB masks, as in

This fixes wrong colors in X on PowerPC64 (big-endian) machines
using scfb/ofwfb (e.g. Talos II and Blackbird) and also allows
other drivers to export their RGB offsets.

Test Plan

This change, along with the sfcb commit above, was tested on:

  • Talos II
  • Blackbird
  • Amd64 VM, using efifb

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 37483
Build 34372: arc lint + arc unit

Event Timeline

luporl requested review of this revision.Mar 1 2021, 6:22 PM
This revision is now accepted and ready to land.Mar 4 2021, 5:52 PM
emaste added inline comments.

This will remain unpopulated on vt drivers other than ofwfb?


Yes, in the other drivers this field should contain zeroes, as long as the driver declares its fb_info as a global or zero initialize it, which seems to be the case.

Do you think this is a problem?
We could also return an error in this case, as all zeroes as RGB offsets is not valid.
Or maybe we could populate it when vt_generate_cons_palette() is called.


Any update or idea of a better way to fix this?

I think it would be safe to just return an error (such as ENOTTY) if the vt driver doesn't populate it.
Then users of this ioctl, such as scfb, can just fall back to default RGB masks.

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

Initialize RGB offsets along with palette.

RBG offsets are set to zero if color format is not RGB.
FBIO_GETRGBOFFS now returns an error if all offsets are zero.

This revision now requires review to proceed.Oct 6 2021, 8:01 PM
luporl added inline comments.

With changes in last diff, now all vt drivers populate fb_rgboffs.

luporl retitled this revision from ofwfb: export RGB offsets with FBIO_GETRGBOFFS to Export RGB offsets with FBIO_GETRGBOFFS.Oct 13 2021, 5:34 PM
luporl edited the summary of this revision. (Show Details)

LGTM. Would be good to add arm group for review and smoke test this change

This revision is now accepted and ready to land.Nov 4 2021, 12:30 PM
This revision was automatically updated to reflect the committed changes.