drivers/video/fbdev/sis/init301.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/sis/init301.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/sis/init301.c- Extension
.c- Size
- 359652 bytes
- Lines
- 11380
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
init301.hoem300.hoem310.h
Detected Declarations
function SiS_UnLockCRT2function SiS_LockCRT2function SiS_SetRegSR11ANDORfunction GetLCDStructPtr661function GetLCDStructPtr661_2function SiS_AdjustCRT2Ratefunction SiS_GetRatePtrfunction SiS_SaveCRT2Infofunction SiS_CR36BIOSWord23bfunction SiS_CR36BIOSWord23dfunction SiS_DDC2Delayfunction SiS_GenericDelayfunction SiS_LongDelayfunction SiS_ShortDelayfunction SiS_PanelDelayfunction SiS_PanelDelayLoopfunction SiS_WaitRetrace1function SiS_WaitRetrace2function SiS_WaitVBRetracefunction SiS_VBWaitfunction SiS_VBLongWaitfunction SiS_Is301Bfunction SiS_CRT2IsLCDfunction SiS_IsDualEdgefunction SiS_IsVAModefunction SiS_IsVAorLCDfunction SiS_IsDualLinkfunction SiS_TVEnabledfunction SiS_LCDAEnabledfunction SiS_WeHaveBacklightCtrlfunction SiS_IsNotM650orLaterfunction SiS_IsYPbPrfunction SiS_IsChScartfunction SiS_IsTVOrYPbPrOrScartfunction SiS_IsLCDOrLCDAfunction SiS_HaveBridgefunction SiS_BridgeIsEnabledfunction SiS_BridgeInSlavemodefunction SiS_SetChrontelGPIOfunction SiS_GetVBInfofunction SiS_SetYPbPrfunction SiS_SetTVModefunction SiS_GetBIOSLCDResInfofunction SiS_GetLCDInfoBIOSfunction SiS_CheckScalingfunction SiS_GetLCDResInfofunction SiS_GetVCLK2Ptrfunction SiS_SetCRT2ModeRegs
Annotated Snippet
if(SiS_Pr->ChipType >= SIS_661) {
DataAND &= 0x0f;
DataOR &= 0x0f;
}
SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR);
}
/*********************************************/
/* HELPER: Get Pointer to LCD structure */
/*********************************************/
#ifdef CONFIG_FB_SIS_315
static unsigned char *
GetLCDStructPtr661(struct SiS_Private *SiS_Pr)
{
unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
unsigned char *myptr = NULL;
unsigned short romindex = 0, reg = 0, idx = 0;
/* Use the BIOS tables only for LVDS panels; TMDS is unreliable
* due to the variaty of panels the BIOS doesn't know about.
* Exception: If the BIOS has better knowledge (such as in case
* of machines with a 301C and a panel that does not support DDC)
* use the BIOS data as well.
*/
if((SiS_Pr->SiS_ROMNew) &&
((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) {
if(SiS_Pr->ChipType < SIS_661) reg = 0x3c;
else reg = 0x7d;
idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26;
if(idx < (8*26)) {
myptr = (unsigned char *)&SiS_LCDStruct661[idx];
}
romindex = SISGETROMW(0x100);
if(romindex) {
romindex += idx;
myptr = &ROMAddr[romindex];
}
}
return myptr;
}
static unsigned short
GetLCDStructPtr661_2(struct SiS_Private *SiS_Pr)
{
unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
unsigned short romptr = 0;
/* Use the BIOS tables only for LVDS panels; TMDS is unreliable
* due to the variaty of panels the BIOS doesn't know about.
* Exception: If the BIOS has better knowledge (such as in case
* of machines with a 301C and a panel that does not support DDC)
* use the BIOS data as well.
*/
if((SiS_Pr->SiS_ROMNew) &&
((SiS_Pr->SiS_VBType & VB_SISLVDS) || (!SiS_Pr->PanelSelfDetected))) {
romptr = SISGETROMW(0x102);
romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize);
}
return romptr;
}
#endif
/*********************************************/
/* Adjust Rate for CRT2 */
/*********************************************/
static bool
SiS_AdjustCRT2Rate(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RRTI, unsigned short *i)
{
unsigned short checkmask=0, modeid, infoflag;
modeid = SiS_Pr->SiS_RefIndex[RRTI + (*i)].ModeID;
if(SiS_Pr->SiS_VBType & VB_SISVB) {
if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
checkmask |= SupportRAMDAC2;
if(SiS_Pr->ChipType >= SIS_315H) {
checkmask |= SupportRAMDAC2_135;
if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) {
checkmask |= SupportRAMDAC2_162;
Annotation
- Immediate include surface: `init301.h`, `oem300.h`, `oem310.h`.
- Detected declarations: `function SiS_UnLockCRT2`, `function SiS_LockCRT2`, `function SiS_SetRegSR11ANDOR`, `function GetLCDStructPtr661`, `function GetLCDStructPtr661_2`, `function SiS_AdjustCRT2Rate`, `function SiS_GetRatePtr`, `function SiS_SaveCRT2Info`, `function SiS_CR36BIOSWord23b`, `function SiS_CR36BIOSWord23d`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.