STRUCT HX8279_DIGITAL_GAMMA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ NAME πŸ‘‘

struct hx8279_digital_gamma β€” Digital Gamma Adjustment ✨ (it's a Linux kernel API page, bestie, from the struct hx8279_digital_gamma(9) manual πŸ’…)


✨ SYNOPSIS ✨

okay so here's the actual struct, no cap, copied exactly:

struct hx8279_digital_gamma {
    u8 r[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
    u8 g[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
    u8 b[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
 };

πŸŽ€ Members πŸŽ€

  • r β€” the adjustment for the red component πŸ’„
  • g β€” the adjustment for the green component πŸ“
  • b β€” the adjustment for the blue component πŸ¦‹

πŸ’œ Description πŸ’œ

So the tea is: the layout of this struct literally follows the register layout, and that's on purpose β€” it makes both the handling and the declaration of those values in the driver way simpler. Iconic design choice, honestly. πŸ‘‘

Gamma correction is internally done with a 24 segment piecewise linear interpolation, and those segments are defined with 24 ten bits values, of which:

  • The LOW eight bits for the first 24 registers start at the first register (at 0xb1) of the Digital Gamma Adjustment page πŸ“„
  • The HIGH two bits for each of the 24 registers are contained in the last six registers πŸ”₯
  • The last six registers contain four groups of two-bits HI values for each of the first 24 registers, but in an inverted fashion β€” this means that the first two bits relate to the last register of a set of four πŸ™ˆ (yes, it's giving chaotic but that's the layout, iykyk)

And periodt, the 24 segments refer to these gamma levels ‡️

0, 1, 3, 7, 11, 15, 23, 31, 47, 63, 95, 127, 128, 160, 192, 208, 224, 232, 240, 244, 248, 252, 254, 255

πŸ¦‹ SEE ALSO πŸ¦‹

Go look at the kernel file ./drivers/gpu/drm/panel/panel-himax-hx8279.c, plus struct hx8279_goa_mux(9) and struct hx8279_analog_gamma(9) 🫢


okay that's the whole page, you ate that πŸ’… mwah! this gem lives over in ./drivers/gpu/drm/panel, it's dated October 2026, and it's filed under struct hx8279_digital_gamma(9) πŸŒΈπŸŽ€

πŸ“¦ where this page comes from