Miguel Freitas ([EMAIL PROTECTED]):

> Hi Billy,
> 
> On Wed, 2003-03-12 at 17:16, Billy Biggs wrote:
> > [...] I did some hacking that let me add modelines (but not delete
> > them), and basically just got this function working, [...]
> >
> >   If you want me to try and dig up my code I can, but my advice is that
> > we start over and finish the implementation of this extension from the
> > 4.3 code.
> 
> Ok. So do you still have your patch we may use as starting point?
> 
> I haven't seen your message but... in case XFree86 developers prefer
> to keep shipping broken code instead of applying your or mine fix, at
> least i will have a working code in my project. and people will be
> able to search the list archives and apply the patch themselves.

  I think this is the patch, but it's surprisingly small and silly, and
I think it's a patch for X 4.1.  If you ignore the ErrorF()'s I added,
it's really only three lines of code:  I actually use the requested dot
clock, I always indicate that modes are OK, and I don't remember what
the VScan thing does ;-)

  It's been a while, and if I find a larger patch somewhere I'll let you
know, but I think this is probably the extent of it. ;-)

  Hope that helps,
  -Billy


Index: Xext/xf86vmode.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/Xext/xf86vmode.c,v
retrieving revision 3.52
diff -p -u -r3.52 xf86vmode.c
--- Xext/xf86vmode.c    2001/05/06 00:51:19     3.52
+++ Xext/xf86vmode.c    2003/03/13 15:54:41
@@ -693,6 +693,7 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
                stuff->after_vsyncend, stuff->after_vtotal, stuff->after_flags);
     }
 
+    ErrorF("AddModeLine - check 1\n");
     if (ver < 2) {
        REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
        len = client->req_len - (sizeof(xXF86OldVidModeAddModeLineReq) >> 2);
@@ -700,12 +701,15 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
        REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
        len = client->req_len - (sizeof(xXF86VidModeAddModeLineReq) >> 2);
     }
+    ErrorF("AddModeLine - check 2\n");
     if (len != stuff->privsize)
        return BadLength;
 
+    ErrorF("AddModeLine - check 3\n");
     if(stuff->screen >= screenInfo.numScreens)
         return BadValue;
 
+    ErrorF("AddModeLine - check 4\n");
     if (stuff->hsyncstart < stuff->hdisplay   ||
        stuff->hsyncend   < stuff->hsyncstart ||
        stuff->htotal     < stuff->hsyncend   ||
@@ -714,6 +718,7 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
        stuff->vtotal     < stuff->vsyncend)
        return BadValue;
 
+    ErrorF("AddModeLine - check 5\n");
     if (stuff->after_hsyncstart < stuff->after_hdisplay   ||
        stuff->after_hsyncend   < stuff->after_hsyncstart ||
        stuff->after_htotal     < stuff->after_hsyncend   ||
@@ -722,6 +727,7 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
        stuff->after_vtotal     < stuff->after_vsyncend)
        return BadValue;
 
+    ErrorF("AddModeLine - check 6\n");
     if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) {
        Bool found = FALSE;
        if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) {
@@ -738,6 +744,7 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
     }
 
 
+    ErrorF("AddModeLine - check 7\n");
     mode = VidModeCreateMode();
     if (mode == NULL)
        return BadValue;
@@ -752,6 +759,8 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
     VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
     VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
     VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
+    VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
+    ErrorF("AddModeLine - Added the clock info (billy)\n");
 
     if (stuff->privsize)
        ErrorF("AddModeLine - Privates in request have been ignored\n");
@@ -759,23 +768,30 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
     /* Check that the mode is consistent with the monitor specs */
     switch (VidModeCheckModeForMonitor(stuff->screen, mode)) {
        case MODE_OK:
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor MODE_OK (billy)\n");
            break;
        case MODE_HSYNC:
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor MODE_HSYNC (billy)\n");
        case MODE_H_ILLEGAL:
            xfree(mode);
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor MODE_H_ILLEGAL 
(billy)\n");
            return VidModeErrorBase + XF86VidModeBadHTimings;
        case MODE_VSYNC:
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor MODE_VSYNC (billy)\n");
        case MODE_V_ILLEGAL:
            xfree(mode);
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor MODE_V_ILLEGAL 
(billy)\n");
            return VidModeErrorBase + XF86VidModeBadVTimings;
        default:
            xfree(mode);
+            ErrorF("AddModeLine - VidModeCheckModeForMonitor Mode Unsuitable 
(billy)\n");
            return VidModeErrorBase + XF86VidModeModeUnsuitable;
     }
 
     /* Check that the driver is happy with the mode */
     if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) {
        xfree(mode);
+        ErrorF("AddModeLine - VidModeCheckModeForDriver unhappy (billy)\n");
        return VidModeErrorBase + XF86VidModeModeUnsuitable;
     }
 
@@ -785,6 +801,7 @@ ProcXF86VidModeAddModeLine(ClientPtr cli
     
     if (xf86GetVerbosity() > 1)
        ErrorF("AddModeLine - Succeeded\n");
+    ErrorF("AddModeLine - successful (billy)\n");
     return client->noClientException;
 }
 
Index: hw/xfree86/common/xf86VidMode.c
===================================================================
RCS file: /cvs/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v
retrieving revision 1.12
diff -p -u -r1.12 xf86VidMode.c
--- hw/xfree86/common/xf86VidMode.c     2001/05/06 21:59:07     1.12
+++ hw/xfree86/common/xf86VidMode.c     2003/03/13 15:54:42
@@ -480,6 +480,8 @@ VidModeAddModeline(int scrnIndex, pointe
 
     pScrn = xf86Screens[scrnIndex];
 
+    ((DisplayModePtr)mode)->status = MODE_OK;
+
     ((DisplayModePtr)mode)->next         = pScrn->modes->next;
     ((DisplayModePtr)mode)->prev         = pScrn->modes;
     pScrn->modes->next                   = (DisplayModePtr)mode;
@@ -590,6 +592,7 @@ VidModeCreateMode(void)
        mode->Private       = NULL;
        mode->next          = mode;
        mode->prev          = mode;
+        mode->VScan         = 1;
     }
     return mode;
 }

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to