[Xorg-driver-geode] looking at wide mode support for GeodeLX (continued)

Jordan Crouse jordan.crouse at amd.com
Mon Feb 11 11:49:08 PST 2008


On 09/02/08 15:08 +0100, Maarten Maathuis wrote:
> Don't even try to use PrivFlags, it's already in use and will only
> cause you grief when you try to use it. The Private you could try to
> allocate (or enlarge) and use it your advantage. In my case a i added
> a "unique" key as first private data to ensure i was always getting
> what i wanted, which was needed in my experience.

Attached is a patch to only go through Cimarron and Durango mode validation
if the mode flags are set to DEFAULT or BUILTIN.  Anything else
especially (USERDEF and DRIVER) should pass right through.

This is neither compile tested nor tested on hardware, so please do so and
let me know.

Jordan

> On 2/8/08, Bart Trojanowski <bart at jukie.net> wrote:
> > Jordan,
> >
> > thanks for the thorough explanation of Cimarron.
> >
> > * Jordan Crouse <jordan.crouse at amd.com> [080208 13:07]:
> > > Are we sure that there isn't a USERDEF equivalent for DDC?
> >
> > We have these choices:
> >
> >     # define M_T_BUILTIN 0x01        /* built-in mode */
> >     # define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
> >     # define M_T_CRTC_C  (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC  */
> >     # define M_T_CLOCK_CRTC_C  (M_T_CLOCK_C | M_T_CRTC_C) /* built-in mode - configure CRTC and clock */
> >     # define M_T_PREFERRED 0x08     /* preferred mode within a set */
> >     # define M_T_DEFAULT 0x10       /* (VESA) default modes */
> >     # define M_T_USERDEF 0x20       /* One of the modes from the config file */
> >     # define M_T_DRIVER  0x40       /* Supplied by the driver (EDID, etc) */
> >
> > > What is pMode->type for a mode from DDC?
> >
> > All DDC modes get M_T_DRIVER, I think.  From what I can see, one of them
> > will be M_T_PREFERRED.  Code is in xserver-xorg/hw/xfree86/ddc/ddcProperty.c
> >
> > > Well - this is academic if we either get rid of the cimarron mode or figure
> > > out a way to flag DDC modes.
> >
> > There may be other fields in the Mode structure that we might be able to use:
> >
> >     int                         PrivSize;
> >     INT32 *                     Private;
> >     int                         PrivFlags;
> >
> > Whose private data that is?  Is it x-private or driver-private?
> > I shall investigate.
> >
> > > Possibly, though X can do things like that and not tell you.
> > >
> > > You'll have to check in LXSetVideoMode to see what the active X and active Y
> > > size is.  If we're setting whatever pMode-> tells us too, then its X,but
> > > if pMode is asking for 1920x1200 and we're ignoring it, then thats our bad.
> >
> > I will have to get back to you on this one :)
> >
> > -Bart
> >
> > --
> >                                 WebSig: http://www.jukie.net/~bart/sig/
> > _______________________________________________
> > xorg mailing list
> > xorg at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/xorg
> >
> 
> 

-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.
-------------- next part --------------
diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c
index 4fcebae..da4fa0b 100644
--- a/src/amd_gx_driver.c
+++ b/src/amd_gx_driver.c
@@ -795,7 +795,9 @@ GXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
 
   /* Only use the panel mode for built in modes */
 
-  if ((pMode->type && pMode->type != M_T_USERDEF) && pGeode->Panel) {
+ if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)
+	&& pGeode->Panel) {
+
     GFX(set_fixed_timings(pGeode->PanelX, pGeode->PanelY,
 			  pMode->CrtcHDisplay, pMode->CrtcVDisplay,
 			  pScrni->bitsPerPixel));
@@ -1402,10 +1404,9 @@ GXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
   GeodeRec *pGeode = GEODEPTR(pScrni);
   int p, ret;
 
-  /* Not sure if this is an X bug or not - but on my current build,
-   * user defined modes pass a type of 0 */
+  /* Use the durango lookup for builtin or default modes only */
 
-  if (pMode->type && pMode->type != M_T_USERDEF) {
+  if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {
 
     if (pGeode->Panel) {
       if (pMode->CrtcHDisplay > pGeode->PanelX ||
diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c
index 3aba428..a00351c 100644
--- a/src/amd_lx_driver.c
+++ b/src/amd_lx_driver.c
@@ -857,9 +857,10 @@ LXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
     lx_disable_dac_power(pScrni, DF_CRT_DISABLE);
     vg_set_compression_enable(0);
 
-    if (!pMode->type || pMode->type == M_T_USERDEF) 
-      lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
-    else {
+    /* If the mode is a default one, then set the mode with the Cimarron
+     * tables */
+
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type & M_T_DEFAULT)) {
       if (pMode->Flags & V_NHSYNC)
 	flags |= VG_MODEFLAG_NEG_HSYNC;
       if (pMode->Flags & V_NVSYNC)
@@ -890,8 +891,14 @@ LXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode)
 			    pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode), 
 			    0);
       }
-    } 
-   
+    }
+    else {
+	/* For anything other then a default mode - use the passed in
+	 * timings */
+
+	lx_set_custom_mode(pGeode, pMode, pScrni->bitsPerPixel);
+    }
+
     if (pGeode->Output & OUTPUT_PANEL)
       df_set_output_path((pGeode->Output & OUTPUT_CRT) ? DF_DISPLAY_CRT_FP : DF_DISPLAY_FP);
     else
@@ -1398,7 +1405,9 @@ LXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags)
 
     memset(&vgQueryMode, 0, sizeof(vgQueryMode));
 
-    if (pMode->type && pMode->type != M_T_USERDEF) {
+    /* For builtin and default modes, try to look up the mode in Cimarron */
+
+    if ((pMode->type & M_T_BUILTIN) || (pMode->type && M_T_DEFAULT)) {
       
       if (pGeode->Output & OUTPUT_PANEL) {
 


More information about the Xorg-driver-geode mailing list