Add a function for describing the output connection configuration.

This commit is contained in:
Eric Anholt 2006-10-09 13:09:18 -07:00
parent 317cc119c5
commit 09e3d10b0f
2 changed files with 48 additions and 13 deletions

View File

@ -706,7 +706,6 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
{
I830Ptr pI830 = I830PTR(pScrn);
Bool ok = TRUE;
CARD32 planeA, planeB;
#ifdef XF86DRI
Bool didLock = FALSE;
#endif
@ -777,18 +776,7 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
i830DisableUnusedFunctions(pScrn);
planeA = INREG(DSPACNTR);
planeB = INREG(DSPBCNTR);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Display plane A is now %s and connected to %s.\n",
pI830->planeEnabled[0] ? "enabled" : "disabled",
planeA & DISPPLANE_SEL_PIPE_MASK ? "Pipe B" : "Pipe A");
if (pI830->availablePipes == 2)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Display plane B is now %s and connected to %s.\n",
pI830->planeEnabled[1] ? "enabled" : "disabled",
planeB & DISPPLANE_SEL_PIPE_MASK ? "Pipe B" : "Pipe A");
i830DescribeOutputConfiguration(pScrn);
#ifdef XF86DRI
I830DRISetVBlankInterrupt (pScrn, TRUE);
@ -804,6 +792,52 @@ done:
return ok;
}
void
i830DescribeOutputConfiguration(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
int i;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Output configuration:\n");
for (i = 0; i < pI830->availablePipes; i++) {
CARD32 dspcntr = INREG(DSPACNTR + (DSPBCNTR - DSPACNTR) * i);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" Display plane %c is now %s and connected to pipe %c.\n",
'A' + i,
pI830->planeEnabled[i] ? "enabled" : "disabled",
dspcntr & DISPPLANE_SEL_PIPE_MASK ? 'B' : 'A');
}
for (i = 0; i < pI830->num_outputs; i++) {
const char *name = NULL;
switch (pI830->output[i].type) {
case I830_OUTPUT_ANALOG:
name = "CRT";
break;
case I830_OUTPUT_LVDS:
name = "LVDS";
break;
case I830_OUTPUT_SDVO:
name = "SDVO";
break;
case I830_OUTPUT_DVO:
name = "DVO";
break;
case I830_OUTPUT_TVOUT:
name = "TV";
break;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
" Output %s is %sabled and connected to pipe %c\n",
name, pI830->output[i].disabled ? "dis" : "en",
pI830->output[i].pipe == 0 ? 'A' : 'B');
}
}
/**
* Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.
*

View File

@ -33,6 +33,7 @@ Bool i830DetectCRT(ScrnInfoPtr pScrn, Bool allow_disturb);
void i830SetLVDSPanelPower(ScrnInfoPtr pScrn, Bool on);
void i830PipeSetBase(ScrnInfoPtr pScrn, int pipe, int x, int y);
void i830WaitForVblank(ScrnInfoPtr pScrn);
void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn);
/* i830_sdvo.c */
Bool I830SDVOPreSetMode(I830SDVOPtr s, DisplayModePtr mode);