STRUCT MALI_C55_PARAMS_MESH_SHADING_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

struct mali_c55_params_mesh_shading_config β€” bestie, this is the Mesh shading configuration struct, and yes we're covering it in the Kernel API Manual today. Buckle up πŸŽ€


✨ SYNOPSIS ✨

Okay so here's the whole shape of her, no notes:

struct mali_c55_params_mesh_shading_config {
    struct v4l2_isp_params_block_header header;
    __u8 mesh_show;
    __u8 mesh_scale;
    __u8 mesh_page_r;
    __u8 mesh_page_g;
    __u8 mesh_page_b;
    __u8 mesh_width;
    __u8 mesh_height;
    __u32 mesh[MALI_C55_NUM_MESH_SHADING_ELEMENTS];
};

🌸 MEMBERS 🌸

🫢 the fields, one by one

  • header β€” the Mali-C55 parameters block header. Every block's little crown πŸ‘‘
  • mesh_show β€” output the mesh data rather than image data. Like, she's showing you the math, not the photo. Respect tbh 🧚
  • mesh_scale β€” set the precision and maximum gain range of mesh shading. The lore:
    • 0 = 0-2x gain
    • 1 = 0-4x gain
    • 2 = 0-8x gain
    • 3 = 0-16x gain
    • 4 = 1-2x gain
    • 5 = 1-3x gain
    • 6 = 1-5x gain
    • 7 = 1-9x gain
  • mesh_page_r β€” mesh page select for red colour plane [0..2] πŸ”΄
  • mesh_page_g β€” mesh page select for green colour plane [0..2] 🟒
  • mesh_page_b β€” mesh page select for blue colour plane [0..2] πŸ”΅
  • mesh_width β€” number of horizontal nodes minus 1 [15,31]. Yes, minus one, do not come for me πŸ™ˆ
  • mesh_height β€” number of vertical nodes minus 1 [15,31]
  • mesh β€” the mesh shading correction tables. The main character of this whole struct, honestly ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

So the mesh shading correction module lets you program a separate table of either 16x16 or 32x32 node coefficients for 3 different light sources. The final correction coefficients that actually get applied are computed by blending the coefficients from two tables together. Blending! Two tables! It's giving collaboration πŸ’–

A page of 1024 32-bit integers is associated to each colour channel, and the pages are stored consecutively in memory. Each 32-bit integer packs 3 8-bit correction coefficients for a single node, one for each of the three light sources. The 8 most significant bits are unused (they're just vibing, bless). Here's the layout, laid out all cute ✨

🌈 Page (Colour Plane) 0

  • mesh[0] β†’ mesh point 0,0 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • mesh[1] β†’ mesh point 0,1 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • ... β†’ ... β†’ ...
  • mesh[1023] β†’ mesh point 31,31 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0

🌈 Page (Colour Plane) 1

  • mesh[1024] β†’ mesh point 0,0 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • mesh[1025] β†’ mesh point 0,1 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • ... β†’ ... β†’ ...
  • mesh[2047] β†’ mesh point 31,31 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0

🌈 Page (Colour Plane) 2

  • mesh[2048] β†’ mesh point 0,0 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • mesh[2049] β†’ mesh point 0,1 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0
  • ... β†’ ... β†’ ...
  • mesh[3071] β†’ mesh point 31,31 β†’ bit 16,23 = LS2, bits 08-15 = LS1, bits 00-07 = LS0

The mesh_scale member determines the precision and the minimum and maximum gain. Example time, because examples ate πŸ’… β€” if mesh_scale is 0 and therefore selects 0 - 2x gain, then a value of 0 in a coefficient means 0.0 gain, a value of 128 means 1.0 gain, and 255 means 2.0 gain. Slay.

🚨 okay important one bestie: header.type should be set to MALI_C55_PARAM_MESH_SHADING_CONFIG from mali_c55_param_block_type for this block. Don't forget it, it's literally the vibe check for the whole block πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/uapi/linux/media/arm/mali-c55-config.h plus the whole friend group 🫢

  • struct mali_c55_ae_1024bin_hist(9)
  • struct mali_c55_ae_5bin_hist(9)
  • struct mali_c55_awb_average_ratios(9)
  • struct mali_c55_af_statistics(9)
  • struct mali_c55_stats_buffer(9)
  • enum mali_c55_param_block_type(9)
  • struct mali_c55_params_sensor_off_preshading(9)
  • enum mali_c55_aexp_hist_tap_points(9)
  • enum mali_c55_aexp_skip_x(9)
  • enum mali_c55_aexp_skip_y(9)
  • enum mali_c55_aexp_row_column_offset(9)
  • enum mali_c55_aexp_hist_plane_mode(9)
  • struct mali_c55_params_aexp_hist(9)
  • struct mali_c55_params_aexp_weights(9)
  • struct mali_c55_params_digital_gain(9)
  • enum mali_c55_awb_stats_mode(9)
  • struct mali_c55_params_awb_gains(9)
  • enum mali_c55_params_awb_tap_points(9)
  • struct mali_c55_params_awb_config(9)
  • struct mali_c55_params_mesh_shading_selection(9)
  • struct mali_c55_params_ccm(9)
  • struct mali_c55_params_gamma(9)
  • MALI_C55_PARAMS_MAX_SIZE(9)

and that's the whole page bestie, go forth and shade those meshes ✨

Sign-off time πŸŽ€ this one lives in ./include/uapi/linux/media/arm, it's dated October 2026, and the page answers to the name struct mali_...ading_config(9). Mwah, ily, bye πŸ’œ

πŸ“¦ where this page comes from