xf86-video-intel: src/i830_display.h src/i830_driver.c src/i830.h src/i830_memory.c

Keith Packard keithp at kemper.freedesktop.org
Tue Mar 6 08:36:22 EET 2007


 src/i830.h         |    2 --
 src/i830_display.h |    3 ---
 src/i830_driver.c  |   45 +++++++--------------------------------------
 src/i830_memory.c  |    2 ++
 4 files changed, 9 insertions(+), 43 deletions(-)

New commits:
diff-tree 4042b27f01fdb94e7fc0d4e991e054fff88479ea (from 55ee46aebbf1ec1a8ce914fbd0c8894fc857db8f)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Mon Mar 5 22:32:52 2007 -0800

    Move EnterVT mode setting code to xf86SetDesiredModes.
    
    Make the application of crtc desiredModes generic code instead of
    per-driver by creating xf86SetDesiredModes from the code that was in EnterVT
    and calling it.
    
    Also, move the frame buffer clear until just before mode setting to make
    sure things are mapped correctly.

diff --git a/src/i830.h b/src/i830.h
index 08d9e3e..dfa94d8 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -255,8 +255,6 @@ typedef struct _I830Rec {
    unsigned char *FbBase;
    int cpp;
 
-   DisplayModePtr currentMode;
-
    I830EntPtr entityPrivate;	
    int init;
 
diff --git a/src/i830_display.h b/src/i830_display.h
index 31ab615..07dfe93 100644
--- a/src/i830_display.h
+++ b/src/i830_display.h
@@ -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);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7ab2cdc..0977511 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2885,9 +2885,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");
 
@@ -2902,12 +2900,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;
@@ -2920,27 +2912,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);
 
@@ -3003,8 +2981,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;
 
@@ -3014,17 +2990,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
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 7bcf48e..ea6b90d 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -835,6 +835,8 @@ i830_allocate_framebuffer(ScrnInfoPtr pS
 	return NULL;
     }
 
+    if (pI830->FbBase)
+	memset (pI830->FbBase + front_buffer->offset, 0, size);
     return front_buffer;
 }
 



More information about the xorg-commit mailing list