~ubuntu-branches/ubuntu/oneiric/xserver-xorg-video-ati/oneiric

« back to all changes in this revision

Viewing changes to src/radeon_crtc.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker
  • Date: 2010-07-08 16:45:59 UTC
  • mfrom: (1.1.34 upstream) (0.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100708164559-t1gwcpobj4n39lhf
Tags: 1:6.13.1-1ubuntu1
* Merge from Debian Unstable. Remainning Ubuntu changes:
  + debian/control:
    - Add quilt to build-depends for Ubuntu patches
  + debian/patches/100_radeon-6.9.0-bgnr-enable.patch:
    - Smooth plymouth transition enablement patch
  + debian/rules:
    - Add xsfbs patchsys
    - Drop /etc/modprobe.d/radeon-kms.conf install.
  + debian/xserver-xorg-video-ati.{pre,post}inst.in:
    - Clean existing /etc/modprobe.d/radeon-kms.conf on install.
      At best this does nothing (KMS is the default for our kernel)
      and at worst it makes it harder to disable KMS.
* Add debian/gbp.conf pointing to Ubuntu branch to make git-buildpackage
  less narky.
* Drop 102-no-xv-rn50.patch and 103_new_pci_ids.patch from previous
  Ubuntu releases, they are upstream now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
447
447
}
448
448
 
449
449
void
450
 
RADEONComputePLL(ScrnInfoPtr pScrn,
 
450
RADEONComputePLL(xf86CrtcPtr crtc,
451
451
                 RADEONPLLPtr pll,
452
452
                 unsigned long freq,
453
453
                 uint32_t *chosen_dot_clock_freq,
457
457
                 uint32_t *chosen_post_div,
458
458
                 int flags)
459
459
{
460
 
    RADEONInfoPtr info = RADEONPTR(pScrn);
 
460
    RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
461
461
 
462
 
    if (IS_AVIVO_VARIANT) {
463
 
        if (xf86ReturnOptValBool(info->Options, OPTION_NEW_PLL, TRUE)) {
464
 
            /* disable frac fb dividers */
465
 
            flags &= ~RADEON_PLL_USE_FRAC_FB_DIV;
466
 
            RADEONComputePLL_new(pll, freq, chosen_dot_clock_freq,
467
 
                                 chosen_feedback_div, chosen_frac_feedback_div,
468
 
                                 chosen_reference_div, chosen_post_div, flags);
469
 
        } else
470
 
            RADEONComputePLL_old(pll, freq, chosen_dot_clock_freq,
471
 
                                 chosen_feedback_div, chosen_frac_feedback_div,
472
 
                                 chosen_reference_div, chosen_post_div, flags);
473
 
    } else {
474
 
        if (xf86ReturnOptValBool(info->Options, OPTION_NEW_PLL, FALSE))
475
 
            RADEONComputePLL_new(pll, freq, chosen_dot_clock_freq,
476
 
                                 chosen_feedback_div, chosen_frac_feedback_div,
477
 
                                 chosen_reference_div, chosen_post_div, flags);
478
 
        else
479
 
            RADEONComputePLL_old(pll, freq, chosen_dot_clock_freq,
480
 
                                 chosen_feedback_div, chosen_frac_feedback_div,
481
 
                                 chosen_reference_div, chosen_post_div, flags);
 
462
    switch (radeon_crtc->pll_algo) {
 
463
    case RADEON_PLL_OLD:
 
464
        RADEONComputePLL_old(pll, freq, chosen_dot_clock_freq,
 
465
                             chosen_feedback_div, chosen_frac_feedback_div,
 
466
                             chosen_reference_div, chosen_post_div, flags);
 
467
        break;
 
468
    case RADEON_PLL_NEW:
 
469
        /* disable frac fb dividers */
 
470
        flags &= ~RADEON_PLL_USE_FRAC_FB_DIV;
 
471
        RADEONComputePLL_new(pll, freq, chosen_dot_clock_freq,
 
472
                             chosen_feedback_div, chosen_frac_feedback_div,
 
473
                             chosen_reference_div, chosen_post_div, flags);
 
474
        break;
482
475
    }
483
476
}
484
477
 
571
564
                      uint16_t *blue, int size)
572
565
{
573
566
    RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
574
 
    ScrnInfoPtr         pScrn = crtc->scrn;
575
 
    int i, j;
576
 
 
577
 
    if (pScrn->depth == 16) {
578
 
        for (i = 0; i < 64; i++) {
579
 
            if (i <= 31) {
580
 
                for (j = 0; j < 8; j++) {
581
 
                    radeon_crtc->lut_r[i * 8 + j] = red[i] >> 6;
582
 
                    radeon_crtc->lut_b[i * 8 + j] = blue[i] >> 6;
583
 
                }
584
 
            }
585
 
 
586
 
            for (j = 0; j < 4; j++) {
587
 
                radeon_crtc->lut_g[i * 4 + j] = green[i] >> 6;
588
 
            }
589
 
        }
590
 
    } else {
591
 
        for (i = 0; i < 256; i++) {
592
 
            radeon_crtc->lut_r[i] = red[i] >> 6;
593
 
            radeon_crtc->lut_g[i] = green[i] >> 6;
594
 
            radeon_crtc->lut_b[i] = blue[i] >> 6;
595
 
        }
 
567
    int i;
 
568
 
 
569
    for (i = 0; i < 256; i++) {
 
570
        radeon_crtc->lut_r[i] = red[i] >> 6;
 
571
        radeon_crtc->lut_g[i] = green[i] >> 6;
 
572
        radeon_crtc->lut_b[i] = blue[i] >> 6;
596
573
    }
597
574
 
598
575
    radeon_crtc_load_lut(crtc);
889
866
        pRADEONEnt->Controller[1] = xnfcalloc(sizeof(RADEONCrtcPrivateRec), 1);
890
867
        if (!pRADEONEnt->Controller[1])
891
868
            {
892
 
                xfree(pRADEONEnt->Controller[0]);
 
869
                free(pRADEONEnt->Controller[0]);
893
870
                return FALSE;
894
871
            }
895
872
 
917
894
            pRADEONEnt->Controller[i] = xnfcalloc(sizeof(RADEONCrtcPrivateRec), 1);
918
895
            if (!pRADEONEnt->Controller[i])
919
896
            {
920
 
                xfree(pRADEONEnt->Controller[i]);
 
897
                free(pRADEONEnt->Controller[i]);
921
898
                return FALSE;
922
899
            }
923
900