drivers/gpu/drm/nouveau/dispnv04/tvnv17.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/dispnv04/tvnv17.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/dispnv04/tvnv17.h
Extension
.h
Size
4322 bytes
Lines
164
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 nv17_tv_state {
	uint8_t tv_enc[0x40];

	uint32_t hfilter[4][7];
	uint32_t hfilter2[4][7];
	uint32_t vfilter[4][7];

	uint32_t ptv_200;
	uint32_t ptv_204;
	uint32_t ptv_208;
	uint32_t ptv_20c;
	uint32_t ptv_304;
	uint32_t ptv_500;
	uint32_t ptv_504;
	uint32_t ptv_508;
	uint32_t ptv_600;
	uint32_t ptv_604;
	uint32_t ptv_608;
	uint32_t ptv_60c;
	uint32_t ptv_610;
	uint32_t ptv_614;
};

enum nv17_tv_norm{
	TV_NORM_PAL,
	TV_NORM_PAL_M,
	TV_NORM_PAL_N,
	TV_NORM_PAL_NC,
	TV_NORM_NTSC_M,
	TV_NORM_NTSC_J,
	NUM_LD_TV_NORMS,
	TV_NORM_HD480I = NUM_LD_TV_NORMS,
	TV_NORM_HD480P,
	TV_NORM_HD576I,
	TV_NORM_HD576P,
	TV_NORM_HD720P,
	TV_NORM_HD1080I,
	NUM_TV_NORMS
};

struct nv17_tv_encoder {
	struct nouveau_encoder base;

	struct nv17_tv_state state;
	struct nv17_tv_state saved_state;

	int overscan;
	int flicker;
	int saturation;
	int hue;
	enum nv17_tv_norm tv_norm;
	int subconnector;
	int select_subconnector;
	uint32_t pin_mask;
};
#define to_tv_enc(x) container_of(nouveau_encoder(x),		\
				  struct nv17_tv_encoder, base)

extern const char * const nv17_tv_norm_names[NUM_TV_NORMS];

extern struct nv17_tv_norm_params {
	enum {
		TV_ENC_MODE,
		CTV_ENC_MODE,
	} kind;

	union {
		struct {
			int hdisplay;
			int vdisplay;
			int vrefresh; /* mHz */

			uint8_t tv_enc[0x40];
		} tv_enc_mode;

		struct {
			struct drm_display_mode mode;

			uint32_t ctv_regs[38];
		} ctv_enc_mode;
	};

} nv17_tv_norms[NUM_TV_NORMS];
#define get_tv_norm(enc) (&nv17_tv_norms[to_tv_enc(enc)->tv_norm])

extern const struct drm_display_mode nv17_tv_modes[];

static inline int interpolate(int y0, int y1, int y2, int x)
{
	return y1 + (x < 50 ? y1 - y0 : y2 - y1) * (x - 50) / 50;

Annotation

Implementation Notes