STRUCT GSC_CTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct gsc_ctx β€” bestie, this is the device context data πŸ’… straight out of the Kernel API Manual (section 9, iykyk). Think of it as the little main-character bundle that holds everything a G-Scaler context needs to know about itself. Obsessed.


πŸŽ€ SYNOPSIS πŸŽ€

struct gsc_ctx {
    struct gsc_frame        s_frame;
    struct gsc_frame        d_frame;
    enum gsc_datapath       in_path;
    enum gsc_datapath       out_path;
    struct gsc_scaler       scaler;
    u32 flags;
    u32 state;
    int rotation;
    unsigned int            hflip:1;
    unsigned int            vflip:1;
    struct gsc_dev          *gsc_dev;
    struct v4l2_m2m_ctx     *m2m_ctx;
    struct v4l2_fh          fh;
    struct v4l2_ctrl_handler ctrl_handler;
    struct gsc_ctrls        gsc_ctrls;
    bool ctrls_rdy;
    enum v4l2_colorspace out_colorspace;
 };

Look at her. Gorgeous. Not a single field out of place. 🫢


🌸 Members 🌸

Okay so let's go field by field, because every one of these is doing its own little job and they all ate:

  • s_frame β€” the source frame properties. Where the pixels are coming from, periodt.
  • d_frame β€” the destination frame properties. Where they're going πŸ’«
  • in_path β€” the input mode: DMA or camera.
  • out_path β€” the output mode: DMA or FIFO.
  • scaler β€” the image scaler properties. She resizes, she slays.
  • flags β€” extra flags for image conversion.
  • state β€” flags that keep track of the user configuration. Literally the memory of this whole operation.
  • rotation β€” rotation. Yeah. That's the whole description. Iconic brevity πŸ’€
  • hflip β€” horizontal flip.
  • vflip β€” vertical flip. (Yes, they're each unsigned int bitfields, :1 and everything β€” check the synopsis, no cap.)
  • gsc_dev β€” the G-Scaler device this context applies to.
  • m2m_ctx β€” the memory-to-memory device context.
  • fh β€” the v4l2 file handle.
  • ctrl_handler β€” the v4l2 controls handler.
  • gsc_ctrls β€” the G-Scaler control set.
  • ctrls_rdy β€” true if the control handler is initialized. A bool, bestie, so it's either fully ready or it's not β€” no in-between vibes.
  • out_colorspace β€” the colorspace of the OUTPUT queue. 🌈

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file lives at ./drivers/media/platform/samsung/exynos-gsc/gsc-core.h, and it's friends with all of these:

  • enum gsc_datapath(9)
  • struct gsc_fmt(9)
  • struct gsc_input_buf(9)
  • struct gsc_addr(9)
  • struct gsc_scaler(9)
  • struct gsc_frame(9)
  • struct gsc_m2m_device(9)
  • struct gsc_pix_max(9)
  • struct gsc_pix_min(9)
  • struct gsc_driverdata(9)
  • struct gsc_dev(9)

Go read them, bestie, they're all part of the same friend group πŸ”₯


Quick vibe check: this page is from ./drivers/media/platform/samsu... (yes the path is truncated in the source, not me being lazy πŸ™ˆ) and it's dated October 2026.

Okay that's the whole page, mwah πŸ’– Go forth and configure your G-Scaler contexts, you gorgeous nerd πŸ‘‘

πŸ“¦ where this page comes from