drivers/gpu/drm/mgag200/mgag200_drv.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/mgag200/mgag200_drv.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/mgag200/mgag200_drv.h
Extension
.h
Size
13516 bytes
Lines
440
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 mgag200_pll_values {
	unsigned int m;
	unsigned int n;
	unsigned int p;
	unsigned int s;
};

struct mgag200_crtc_state {
	struct drm_crtc_state base;

	/* Primary-plane format; required for modesetting and color mgmt. */
	const struct drm_format_info *format;

	struct mgag200_pll_values pixpllc;

	bool set_vidrst;
};

static inline struct mgag200_crtc_state *to_mgag200_crtc_state(struct drm_crtc_state *base)
{
	return container_of(base, struct mgag200_crtc_state, base);
}

enum mga_type {
	G200_PCI,
	G200_AGP,
	G200_SE_A,
	G200_SE_B,
	G200_WB,
	G200_EV,
	G200_EH,
	G200_EH3,
	G200_EH5,
	G200_ER,
	G200_EW3,
};

struct mgag200_device_info {
	u16 max_hdisplay;
	u16 max_vdisplay;

	/*
	 * Maximum memory bandwidth (MiB/sec). Setting this to zero disables
	 * the rsp test during mode validation.
	 */
	unsigned long max_mem_bandwidth;

	/* Synchronize scanout with BMC */
	bool sync_bmc:1;

	struct {
		unsigned data_bit:3;
		unsigned clock_bit:3;
	} i2c;

	/*
	 * HW does not handle 'startadd' register correctly. Always set
	 * it's value to 0.
	 */
	bool bug_no_startadd:1;
};

#define MGAG200_DEVICE_INFO_INIT(_max_hdisplay, _max_vdisplay, _max_mem_bandwidth, \
				 _sync_bmc, _i2c_data_bit, _i2c_clock_bit, \
				 _bug_no_startadd) \
	{ \
		.max_hdisplay = (_max_hdisplay), \
		.max_vdisplay = (_max_vdisplay), \
		.max_mem_bandwidth = (_max_mem_bandwidth), \
		.sync_bmc = (_sync_bmc), \
		.i2c = { \
			.data_bit = (_i2c_data_bit), \
			.clock_bit = (_i2c_clock_bit), \
		}, \
		.bug_no_startadd = (_bug_no_startadd), \
	}

struct mgag200_device_funcs {
	/*
	 * Validate that the given state can be programmed into PIXPLLC. On
	 * success, the calculated parameters should be stored in the CRTC's
	 * state in struct @mgag200_crtc_state.pixpllc.
	 */
	int (*pixpllc_atomic_check)(struct drm_crtc *crtc, struct drm_atomic_commit *new_state);

	/*
	 * Program PIXPLLC from the CRTC state. The parameters should have been
	 * stored in struct @mgag200_crtc_state.pixpllc by the corresponding
	 * implementation of @pixpllc_atomic_check.
	 */

Annotation

Implementation Notes