~ubuntu-branches/ubuntu/jaunty/xserver-xorg-video-nv/jaunty

« back to all changes in this revision

Viewing changes to compat/modes/xf86Modes.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Potyra
  • Date: 2008-06-15 15:03:42 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080615150342-ke266hqt4p7m8qyd
Tags: 1:2.1.9-1ubuntu1
* Merge from unstable (LP: #240034), remaining changes:
  + debian/patches/100_fedora-panel-fix.patch from Timo Aaltonen:
    Don't discard EDID blocks just because their input type bit
    disagrees with the hardware connection sensing; this usually
    just means the block is lying. (cf. LP #188549).
  + debian/control: update Maintainer field as per spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
    *pNew = *pMode;
215
215
    pNew->next = NULL;
216
216
    pNew->prev = NULL;
217
 
    /*
218
 
     * It is important to copy the name explicitly.
219
 
     * Otherwise a mode could reference an invalid piece of memory, after one of them runs free().
220
 
     * This will lead to obscure problems, that you really don't want.
221
 
     */
 
217
 
222
218
    if (pMode->name == NULL)
223
219
        xf86SetModeDefaultName(pNew);
224
220
    else
667
663
    DisplayModePtr  head = NULL, prev = NULL, mode;
668
664
    int             i;
669
665
 
670
 
    for (i = 0; xf86DefaultModes[i].name != NULL; i++)
 
666
    for (i = 0; i < xf86NumDefaultModes; i++)
671
667
    {
672
668
        DisplayModePtr  defMode = &xf86DefaultModes[i];
673
669
        
676
672
        if (!doubleScanAllowed && (defMode->Flags & V_DBLSCAN))
677
673
            continue;
678
674
 
679
 
        mode = xalloc(sizeof(DisplayModeRec));
680
 
        if (!mode)
681
 
            continue;
682
 
        memcpy(mode,&xf86DefaultModes[i],sizeof(DisplayModeRec));
683
 
        mode->name = xstrdup(xf86DefaultModes[i].name);
684
 
        if (!mode->name)
685
 
        {
686
 
            xfree (mode);
687
 
            continue;
688
 
        }
689
 
        mode->prev = prev;
690
 
        mode->next = NULL;
691
 
        if (prev)
692
 
            prev->next = mode;
693
 
        else
694
 
            head = mode;
695
 
        prev = mode;
 
675
        mode = xf86DuplicateMode(defMode);
 
676
 
 
677
        head = xf86ModesAdd(head, mode);
696
678
    }
697
679
    return head;
698
680
}