~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to drivers/gpu/drm/i915/intel_fb.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
207
207
 
208
208
        if (var->pixclock != -1) {
209
209
 
210
 
                DRM_ERROR("PIXEL CLCOK SET\n");
 
210
                DRM_ERROR("PIXEL CLOCK SET\n");
211
211
                return -EINVAL;
212
212
        } else {
213
213
                struct drm_crtc *crtc;
453
453
        size = ALIGN(size, PAGE_SIZE);
454
454
        fbo = drm_gem_object_alloc(dev, size);
455
455
        if (!fbo) {
456
 
                printk(KERN_ERR "failed to allocate framebuffer\n");
 
456
                DRM_ERROR("failed to allocate framebuffer\n");
457
457
                ret = -ENOMEM;
458
458
                goto out;
459
459
        }
504
504
        info->fbops = &intelfb_ops;
505
505
 
506
506
        info->fix.line_length = fb->pitch;
 
507
 
 
508
        /* setup aperture base/size for vesafb takeover */
 
509
        info->aperture_base = dev->mode_config.fb_base;
 
510
        if (IS_I9XX(dev))
 
511
                info->aperture_size = pci_resource_len(dev->pdev, 2);
 
512
        else
 
513
                info->aperture_size = pci_resource_len(dev->pdev, 0);
 
514
 
507
515
        info->fix.smem_start = dev->mode_config.fb_base + obj_priv->gtt_offset;
508
516
        info->fix.smem_len = size;
509
517
 
602
610
        par->dev = dev;
603
611
 
604
612
        /* To allow resizeing without swapping buffers */
605
 
        printk("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width,
606
 
               intel_fb->base.height, obj_priv->gtt_offset, fbo);
 
613
        DRM_DEBUG("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width,
 
614
                  intel_fb->base.height, obj_priv->gtt_offset, fbo);
607
615
 
608
616
        mutex_unlock(&dev->struct_mutex);
609
617
        return 0;
674
682
        par->crtc_ids[0] = crtc->base.id;
675
683
 
676
684
        modeset->num_connectors = conn_count;
677
 
        if (modeset->mode != modeset->crtc->desired_mode)
678
 
                modeset->mode = modeset->crtc->desired_mode;
 
685
        if (modeset->crtc->desired_mode) {
 
686
                if (modeset->mode)
 
687
                        drm_mode_destroy(dev, modeset->mode);
 
688
                modeset->mode = drm_mode_duplicate(dev,
 
689
                                                   modeset->crtc->desired_mode);
 
690
        }
679
691
 
680
692
        par->crtc_count = 1;
681
693
 
686
698
        } else
687
699
                intelfb_set_par(info);
688
700
 
689
 
        printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
 
701
        DRM_INFO("fb%d: %s frame buffer device\n", info->node,
690
702
               info->fix.id);
691
703
 
692
704
        /* Switch back to kernel console on panic */
693
705
        kernelfb_mode = *modeset;
694
706
        atomic_notifier_chain_register(&panic_notifier_list, &paniced);
695
 
        printk(KERN_INFO "registered panic notifier\n");
 
707
        DRM_DEBUG("registered panic notifier\n");
696
708
 
697
709
        return 0;
698
710
}
824
836
                par->crtc_ids[crtc_count++] = crtc->base.id;
825
837
 
826
838
                modeset->num_connectors = conn_count;
827
 
                if (modeset->mode != modeset->crtc->desired_mode)
828
 
                        modeset->mode = modeset->crtc->desired_mode;
 
839
                if (modeset->crtc->desired_mode) {
 
840
                        if (modeset->mode)
 
841
                                drm_mode_destroy(dev, modeset->mode);
 
842
                        modeset->mode = drm_mode_duplicate(dev,
 
843
                                                           modeset->crtc->desired_mode);
 
844
                }
829
845
        }
830
846
        par->crtc_count = crtc_count;
831
847
 
836
852
        } else
837
853
                intelfb_set_par(info);
838
854
 
839
 
        printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
 
855
        DRM_INFO("fb%d: %s frame buffer device\n", info->node,
840
856
               info->fix.id);
841
857
 
842
858
        /* Switch back to kernel console on panic */
843
859
        kernelfb_mode = *modeset;
844
860
        atomic_notifier_chain_register(&panic_notifier_list, &paniced);
845
 
        printk(KERN_INFO "registered panic notifier\n");
 
861
        DRM_DEBUG("registered panic notifier\n");
846
862
 
847
863
        return 0;
848
864
}
854
870
 */
855
871
void intelfb_restore(void)
856
872
{
857
 
        drm_crtc_helper_set_config(&kernelfb_mode);
858
 
}
 
873
        int ret;
 
874
        if ((ret = drm_crtc_helper_set_config(&kernelfb_mode)) != 0) {
 
875
                DRM_ERROR("Failed to restore crtc configuration: %d\n",
 
876
                          ret);
 
877
        }
 
878
}
 
879
 
 
880
static void intelfb_restore_work_fn(struct work_struct *ignored)
 
881
{
 
882
        intelfb_restore();
 
883
}
 
884
static DECLARE_WORK(intelfb_restore_work, intelfb_restore_work_fn);
859
885
 
860
886
static void intelfb_sysrq(int dummy1, struct tty_struct *dummy3)
861
887
{
862
 
        intelfb_restore();
 
888
        schedule_work(&intelfb_restore_work);
863
889
}
864
890
 
865
891
static struct sysrq_key_op sysrq_intelfb_restore_op = {
866
892
        .handler = intelfb_sysrq,
867
 
        .help_msg = "force fb",
868
 
        .action_msg = "force restore of fb console",
 
893
        .help_msg = "force-fb(V)",
 
894
        .action_msg = "Restore framebuffer console",
869
895
};
870
896
 
871
897
int intelfb_probe(struct drm_device *dev)
898
924
                ret = intelfb_single_fb_probe(dev);
899
925
        }
900
926
 
901
 
        register_sysrq_key('g', &sysrq_intelfb_restore_op);
 
927
        register_sysrq_key('v', &sysrq_intelfb_restore_op);
902
928
 
903
929
        return ret;
904
930
}