Merge git://proxy01.pd.intel.com:9419/git/xorg/driver/xf86-video-intel into crestline

This commit is contained in:
Nian Wu 2007-03-06 16:01:40 -05:00
commit a4e7e814a2
6 changed files with 24 additions and 196 deletions

View File

@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-intel],
1.9.90,
1.9.91,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-intel)

View File

@ -255,8 +255,6 @@ typedef struct _I830Rec {
unsigned char *FbBase;
int cpp;
DisplayModePtr currentMode;
I830EntPtr entityPrivate;
int init;

View File

@ -392,107 +392,6 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y)
}
}
/**
* In the current world order, there are lists of modes per output, which may
* or may not include the mode that was asked to be set by XFree86's mode
* selection. Find the closest one, in the following preference order:
*
* - Equality
* - Closer in size to the requested mode, but no larger
* - Closer in refresh rate to the requested mode.
*/
DisplayModePtr
i830PipeFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode)
{
ScrnInfoPtr pScrn = crtc->scrn;
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
DisplayModePtr pBest = NULL, pScan = NULL;
int i;
/* Assume that there's only one output connected to the given CRTC. */
for (i = 0; i < xf86_config->num_output; i++)
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc && output->probed_modes != NULL)
{
pScan = output->probed_modes;
break;
}
}
/* If the pipe doesn't have any detected modes, just let the system try to
* spam the desired mode in.
*/
if (pScan == NULL) {
I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"No pipe mode list for pipe %d,"
"continuing with desired mode\n", intel_crtc->pipe);
return pMode;
}
for (; pScan != NULL; pScan = pScan->next) {
assert(pScan->VRefresh != 0.0);
/* If there's an exact match, we're done. */
if (xf86ModesEqual(pScan, pMode)) {
pBest = pMode;
break;
}
/* Reject if it's larger than the desired mode. */
if (pScan->HDisplay > pMode->HDisplay ||
pScan->VDisplay > pMode->VDisplay)
{
continue;
}
if (pBest == NULL) {
pBest = pScan;
continue;
}
/* Find if it's closer to the right size than the current best
* option.
*/
if ((pScan->HDisplay > pBest->HDisplay &&
pScan->VDisplay >= pBest->VDisplay) ||
(pScan->HDisplay >= pBest->HDisplay &&
pScan->VDisplay > pBest->VDisplay))
{
pBest = pScan;
continue;
}
/* Find if it's still closer to the right refresh than the current
* best resolution.
*/
if (pScan->HDisplay == pBest->HDisplay &&
pScan->VDisplay == pBest->VDisplay &&
(fabs(pScan->VRefresh - pMode->VRefresh) <
fabs(pBest->VRefresh - pMode->VRefresh))) {
pBest = pScan;
}
}
if (pBest == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"No suitable mode found to program for the pipe.\n"
" continuing with desired mode %dx%d@%.1f\n",
pMode->HDisplay, pMode->VDisplay, pMode->VRefresh);
} else if (!xf86ModesEqual(pBest, pMode)) {
I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
int pipe = intel_crtc->pipe;
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Choosing pipe %d's mode %dx%d@%.1f instead of xf86 "
"mode %dx%d@%.1f\n", pipe,
pBest->HDisplay, pBest->VDisplay, pBest->VRefresh,
pMode->HDisplay, pMode->VDisplay, pMode->VRefresh);
pMode = pBest;
}
return pMode;
}
/**
* Sets the power management mode of the pipe and plane.
*
@ -1150,46 +1049,6 @@ i830_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data)
}
/**
* This function configures the screens in clone mode on
* all active outputs using a mode similar to the specified mode.
*/
Bool
i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Rotation rotation)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
Bool ok = TRUE;
xf86CrtcPtr crtc = config->output[config->compat_output]->crtc;
DPRINTF(PFX, "i830SetMode\n");
if (crtc && crtc->enabled)
{
ok = xf86CrtcSetMode(crtc,
i830PipeFindClosestMode(crtc, pMode),
rotation, 0, 0);
if (!ok)
goto done;
crtc->desiredMode = *pMode;
}
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Mode bandwidth is %d Mpixel/s\n",
(int)(pMode->HDisplay * pMode->VDisplay *
pMode->VRefresh / 1000000));
xf86DisableUnusedFunctions(pScrn);
i830DescribeOutputConfiguration(pScrn);
#ifdef XF86DRI
I830DRISetVBlankInterrupt (pScrn, TRUE);
#endif
done:
i830DumpRegs (pScrn);
i830_sdvo_dump(pScrn);
return ok;
}
void
i830DescribeOutputConfiguration(ScrnInfoPtr pScrn)
{

View File

@ -28,9 +28,6 @@
#include "xorgVersion.h"
/* i830_display.c */
DisplayModePtr
i830PipeFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode);
Bool i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Rotation rotation);
void i830PipeSetBase(xf86CrtcPtr crtc, int x, int y);
void i830WaitForVblank(ScrnInfoPtr pScrn);
void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn);

View File

@ -2890,9 +2890,7 @@ static Bool
I830EnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
I830Ptr pI830 = I830PTR(pScrn);
int i;
DPRINTF(PFX, "Enter VT\n");
@ -2907,12 +2905,6 @@ I830EnterVT(int scrnIndex, int flags)
pI830->leaving = FALSE;
#if 1
/* Clear the framebuffer */
memset(pI830->FbBase + pScrn->fbOffset, 0,
pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
#endif
if (I830IsPrimary(pScrn))
if (!i830_bind_all_memory(pScrn))
return FALSE;
@ -2925,27 +2917,13 @@ I830EnterVT(int scrnIndex, int flags)
ResetState(pScrn, FALSE);
SetHWOperatingState(pScrn);
for (i = 0; i < xf86_config->num_crtc; i++)
{
xf86CrtcPtr crtc = xf86_config->crtc[i];
/* Mark that we'll need to re-set the mode for sure */
memset(&crtc->mode, 0, sizeof(crtc->mode));
if (!crtc->desiredMode.CrtcHDisplay)
{
crtc->desiredMode = *i830PipeFindClosestMode (crtc, pScrn->currentMode);
crtc->desiredRotation = RR_Rotate_0;
crtc->desiredX = 0;
crtc->desiredY = 0;
}
if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation,
crtc->desiredX, crtc->desiredY))
return FALSE;
}
xf86DisableUnusedFunctions(pScrn);
/* Clear the framebuffer */
memset(pI830->FbBase + pScrn->fbOffset, 0,
pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
if (!xf86SetDesiredModes (pScrn))
return FALSE;
i830DumpRegs (pScrn);
i830DescribeOutputConfiguration(pScrn);
@ -3008,8 +2986,6 @@ I830EnterVT(int scrnIndex, int flags)
if (pI830->checkDevices)
pI830->devicesTimer = TimerSet(NULL, 0, 1000, I830CheckDevicesTimer, pScrn);
pI830->currentMode = pScrn->currentMode;
/* Force invarient 3D state to be emitted */
*pI830->used3D = 1<<31;
@ -3019,17 +2995,10 @@ I830EnterVT(int scrnIndex, int flags)
static Bool
I830SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
Bool ret = TRUE;
DPRINTF(PFX, "I830SwitchMode: mode == %p\n", mode);
if (!i830SetMode(pScrn, mode, pI830->rotation))
pI830->currentMode = mode;
return ret;
return xf86SetSingleMode (pScrn, mode, pI830->rotation);
}
static Bool

View File

@ -835,6 +835,8 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
return NULL;
}
if (pI830->FbBase)
memset (pI830->FbBase + front_buffer->offset, 0, size);
return front_buffer;
}
@ -936,6 +938,20 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
"Failed to allocate logical context space.\n");
return FALSE;
}
#ifdef I830_USE_EXA
if (pI830->useEXA) {
if (IS_I965G(pI830) && pI830->exa_965_state == NULL) {
pI830->exa_965_state =
i830_allocate_memory(pScrn, "exa G965 state buffer",
EXA_LINEAR_EXTRA, GTT_PAGE_SIZE, 0);
if (pI830->exa_965_state == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Failed to allocate exa state buffer for 965.\n");
return FALSE;
}
}
}
#endif
#ifdef I830_XV
/* Allocate overlay register space and optional XAA linear allocator
@ -982,17 +998,6 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
return FALSE;
}
}
if (IS_I965G(pI830) && pI830->exa_965_state == NULL) {
pI830->exa_965_state =
i830_allocate_memory(pScrn, "exa G965 state buffer",
EXA_LINEAR_EXTRA, GTT_PAGE_SIZE, 0);
if (pI830->exa_965_state == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Failed to allocate exa state buffer for 965.\n");
return FALSE;
}
}
}
#endif /* I830_USE_EXA */