drivers/gpu/drm/gma500/opregion.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/gma500/opregion.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/gma500/opregion.c
Extension
.c
Size
10223 bytes
Lines
356
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct opregion_header {
	u8 signature[16];
	u32 size;
	u32 opregion_ver;
	u8 bios_ver[32];
	u8 vbios_ver[16];
	u8 driver_ver[16];
	u32 mboxes;
	u8 reserved[164];
} __packed;

/* OpRegion mailbox #1: public ACPI methods */
struct opregion_acpi {
	u32 drdy;	/* driver readiness */
	u32 csts;	/* notification status */
	u32 cevt;	/* current event */
	u8 rsvd1[20];
	u32 didl[8];	/* supported display devices ID list */
	u32 cpdl[8];	/* currently presented display list */
	u32 cadl[8];	/* currently active display list */
	u32 nadl[8];	/* next active devices list */
	u32 aslp;	/* ASL sleep time-out */
	u32 tidx;	/* toggle table index */
	u32 chpd;	/* current hotplug enable indicator */
	u32 clid;	/* current lid state*/
	u32 cdck;	/* current docking state */
	u32 sxsw;	/* Sx state resume */
	u32 evts;	/* ASL supported events */
	u32 cnot;	/* current OS notification */
	u32 nrdy;	/* driver status */
	u8 rsvd2[60];
} __packed;

/* OpRegion mailbox #2: SWSCI */
struct opregion_swsci {
	/*FIXME: add it later*/
} __packed;

/* OpRegion mailbox #3: ASLE */
struct opregion_asle {
	u32 ardy;	/* driver readiness */
	u32 aslc;	/* ASLE interrupt command */
	u32 tche;	/* technology enabled indicator */
	u32 alsi;	/* current ALS illuminance reading */
	u32 bclp;	/* backlight brightness to set */
	u32 pfit;	/* panel fitting state */
	u32 cblv;	/* current brightness level */
	u16 bclm[20];	/* backlight level duty cycle mapping table */
	u32 cpfm;	/* current panel fitting mode */
	u32 epfm;	/* enabled panel fitting modes */
	u8 plut[74];	/* panel LUT and identifier */
	u32 pfmb;	/* PWM freq and min brightness */
	u8 rsvd[102];
} __packed;

/* ASLE irq request bits */
#define ASLE_SET_ALS_ILLUM     (1 << 0)
#define ASLE_SET_BACKLIGHT     (1 << 1)
#define ASLE_SET_PFIT          (1 << 2)
#define ASLE_SET_PWM_FREQ      (1 << 3)
#define ASLE_REQ_MSK           0xf

/* response bits of ASLE irq request */
#define ASLE_ALS_ILLUM_FAILED   (1<<10)
#define ASLE_BACKLIGHT_FAILED   (1<<12)
#define ASLE_PFIT_FAILED        (1<<14)
#define ASLE_PWM_FREQ_FAILED    (1<<16)

/* ASLE backlight brightness to set */
#define ASLE_BCLP_VALID                (1<<31)
#define ASLE_BCLP_MSK          (~(1<<31))

/* ASLE panel fitting request */
#define ASLE_PFIT_VALID         (1<<31)
#define ASLE_PFIT_CENTER (1<<0)
#define ASLE_PFIT_STRETCH_TEXT (1<<1)
#define ASLE_PFIT_STRETCH_GFX (1<<2)

/* response bits of ASLE irq request */
#define ASLE_ALS_ILLUM_FAILED	(1<<10)
#define ASLE_BACKLIGHT_FAILED	(1<<12)
#define ASLE_PFIT_FAILED	(1<<14)
#define ASLE_PWM_FREQ_FAILED	(1<<16)

/* ASLE backlight brightness to set */
#define ASLE_BCLP_VALID                (1<<31)
#define ASLE_BCLP_MSK          (~(1<<31))

/* ASLE panel fitting request */
#define ASLE_PFIT_VALID         (1<<31)

Annotation

Implementation Notes