drivers/gpu/drm/ast/ast_vbios.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ast/ast_vbios.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/ast/ast_vbios.c
Extension
.c
Size
8908 bytes
Lines
242
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

// SPDX-License-Identifier: MIT
/*
 * Copyright (c) 2005 ASPEED Technology Inc.
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of the authors not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  The authors makes no representations
 * about the suitability of this software for any purpose.  It is provided
 * "as is" without express or implied warranty.
 *
 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

#include "ast_drv.h"
#include "ast_vbios.h"

/* 4:3 */

static const struct ast_vbios_enhtable res_640x480[] = {
	{ 800, 640, 8, 96, 525, 480, 2, 2, VCLK25_175,		/* 60 Hz */
	  (SyncNN | HBorder | VBorder | Charx8Dot), 60, 1, 0x2e },
	{ 832, 640, 16, 40, 520, 480, 1, 3, VCLK31_5,		/* 72 Hz */
	  (SyncNN | HBorder | VBorder | Charx8Dot), 72, 2, 0x2e  },
	{ 840, 640, 16, 64, 500, 480, 1, 3, VCLK31_5,		/* 75 Hz */
	  (SyncNN | Charx8Dot), 75, 3, 0x2e },
	{ 832, 640, 56, 56, 509, 480, 1, 3, VCLK36,		/* 85 Hz */
	  (SyncNN | Charx8Dot), 85, 4, 0x2e },
	AST_VBIOS_INVALID_MODE,					/* end */
};

static const struct ast_vbios_enhtable res_800x600[] = {
	{ 1024, 800, 24, 72, 625, 600, 1, 2, VCLK36,		/* 56 Hz */
	  (SyncPP | Charx8Dot), 56, 1, 0x30 },
	{ 1056, 800, 40, 128, 628, 600, 1, 4, VCLK40,		/* 60 Hz */
	  (SyncPP | Charx8Dot), 60, 2, 0x30 },
	{ 1040, 800, 56, 120, 666, 600, 37, 6, VCLK50,		/* 72 Hz */
	  (SyncPP | Charx8Dot), 72, 3, 0x30 },
	{ 1056, 800, 16, 80, 625, 600, 1, 3, VCLK49_5,		/* 75 Hz */
	  (SyncPP | Charx8Dot), 75, 4, 0x30 },
	{ 1048, 800, 32, 64, 631, 600, 1, 3, VCLK56_25,		/* 85 Hz */
	  (SyncPP | Charx8Dot), 84, 5, 0x30 },
	AST_VBIOS_INVALID_MODE,					/* end */
};

static const struct ast_vbios_enhtable res_1024x768[] = {
	{ 1344, 1024, 24, 136, 806, 768, 3, 6, VCLK65,		/* 60 Hz */
	  (SyncNN | Charx8Dot), 60, 1, 0x31 },
	{ 1328, 1024, 24, 136, 806, 768, 3, 6, VCLK75,		/* 70 Hz */
	  (SyncNN | Charx8Dot), 70, 2, 0x31 },
	{ 1312, 1024, 16, 96, 800, 768, 1, 3, VCLK78_75,	/* 75 Hz */
	  (SyncPP | Charx8Dot), 75, 3, 0x31 },
	{ 1376, 1024, 48, 96, 808, 768, 1, 3, VCLK94_5,		/* 85 Hz */
	  (SyncPP | Charx8Dot), 84, 4, 0x31 },
	AST_VBIOS_INVALID_MODE,					/* end */
};

static const struct ast_vbios_enhtable res_1152x864[] = {
	{ 1600, 1152, 64, 128,  900,  864, 1, 3, VCLK108,	/* 75 Hz */
	  (SyncPP | Charx8Dot | NewModeInfo), 75, 1, 0x3b },
	AST_VBIOS_INVALID_MODE,					/* end */
};

static const struct ast_vbios_enhtable res_1280x1024[] = {
	{ 1688, 1280, 48, 112, 1066, 1024, 1, 3, VCLK108,	/* 60 Hz */
	  (SyncPP | Charx8Dot), 60, 1, 0x32 },
	{ 1688, 1280, 16, 144, 1066, 1024, 1, 3, VCLK135,	/* 75 Hz */
	  (SyncPP | Charx8Dot), 75, 2, 0x32 },
	{ 1728, 1280, 64, 160, 1072, 1024, 1, 3, VCLK157_5,	/* 85 Hz */
	  (SyncPP | Charx8Dot), 85, 3, 0x32 },
	AST_VBIOS_INVALID_MODE,					/* end */
};

static const struct ast_vbios_enhtable res_1600x1200[] = {
	{ 2160, 1600, 64, 192, 1250, 1200, 1, 3, VCLK162,	/* 60 Hz */
	  (SyncPP | Charx8Dot), 60, 1, 0x33 },
	AST_VBIOS_INVALID_MODE,					/* end */
};

/* 16:9 */

Annotation

Implementation Notes