Page MenuHomeFreeBSD

Export RGB offsets with FBIO_GETRGBOFFS
ClosedPublic

Authored by luporl on Mar 1 2021, 6:22 PM.
Referenced Files
Unknown Object (File)
Jan 31 2024, 4:55 PM
Unknown Object (File)
Jan 25 2024, 11:16 AM
Unknown Object (File)
Jan 18 2024, 3:02 AM
Unknown Object (File)
Jan 12 2024, 2:29 PM
Unknown Object (File)
Dec 20 2023, 6:33 AM
Unknown Object (File)
Dec 1 2023, 2:10 AM
Unknown Object (File)
Oct 13 2023, 9:57 PM
Unknown Object (File)
Oct 13 2023, 12:48 PM

Details

Summary

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
https://github.com/luporl/xf86-video-scfb/commit/dcd019ac6dc38f6c3b135dfa94e87494b749d184.

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No 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.
sys/sys/fbio.h
161

This will remain unpopulated on vt drivers other than ofwfb?

sys/sys/fbio.h
161

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.

sys/sys/fbio.h
161

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.
sys/sys/fbio.h
161

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.