Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Feb 2011 18:02:22 +0000 (10:02 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Feb 2011 18:02:22 +0000 (10:02 -0800)
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (27 commits)
  gpu/stub: fix acpi_video build error, fix stub kconfig dependencies
  drm/radeon/kms: dynamically allocate power state space
  drm/radeon/kms: fix s/r issues with bios scratch regs
  agp: ensure GART has an address before enabling it
  Revert "agp: AMD AGP is used on UP1100 & UP1500 alpha boxen"
  amd-k7-agp: remove non-x86 code
  drm/radeon/kms/evergreen: always set certain VGT regs at CP init
  drm/radeon/kms: add updated ib_execute function for evergreen
  drm/radeon: remove 0x4243 pci id
  drm/radeon/kms: Enable new pll calculation for avivo+ asics
  drm/radeon/kms: add new pll algo for avivo asics
  drm/radeon/kms: add pll debugging output
  drm/radeon/kms: switch back to min->max pll post divider iteration
  drm/radeon/kms: rv6xx+ thermal sensor fixes
  drm/nv50: fix display on 0x50
  drm/nouveau: correctly pair hwmon_init and hwmon_fini
  drm/i915: Only bind to function 0 of the PCI device
  drm/i915: Suppress spurious vblank interrupts
  drm: Avoid leak of adjusted mode along quick set_mode paths
  drm: Simplify and defend later checks when disabling a crtc
  ...

1  2 
drivers/gpu/drm/drm_crtc_helper.c

index 17459ee49ec3ea0863077b13e68f8f2f5180a3ed,b34cc7372b52cfebf8add6a74993efe158a74bb7..92369655dca3aae197c2ed9d4e45a5d0d8b1ed36
@@@ -343,13 -343,12 +343,12 @@@ bool drm_crtc_helper_set_mode(struct dr
        struct drm_encoder *encoder;
        bool ret = true;
  
-       adjusted_mode = drm_mode_duplicate(dev, mode);
        crtc->enabled = drm_helper_crtc_in_use(crtc);
        if (!crtc->enabled)
                return true;
  
+       adjusted_mode = drm_mode_duplicate(dev, mode);
        saved_hwmode = crtc->hwmode;
        saved_mode = crtc->mode;
        saved_x = crtc->x;
         */
        drm_calc_timestamping_constants(crtc);
  
-       /* XXX free adjustedmode */
-       drm_mode_destroy(dev, adjusted_mode);
        /* FIXME: add subpixel order */
  done:
+       drm_mode_destroy(dev, adjusted_mode);
        if (!ret) {
                crtc->hwmode = saved_hwmode;
                crtc->mode = saved_mode;
@@@ -497,14 -495,17 +495,17 @@@ int drm_crtc_helper_set_config(struct d
  
        crtc_funcs = set->crtc->helper_private;
  
+       if (!set->mode)
+               set->fb = NULL;
        if (set->fb) {
                DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n",
                                set->crtc->base.id, set->fb->base.id,
                                (int)set->num_connectors, set->x, set->y);
        } else {
-               DRM_DEBUG_KMS("[CRTC:%d] [NOFB] #connectors=%d (x y) (%i %i)\n",
-                               set->crtc->base.id, (int)set->num_connectors,
-                               set->x, set->y);
+               DRM_DEBUG_KMS("[CRTC:%d] [NOFB]\n", set->crtc->base.id);
+               set->mode = NULL;
+               set->num_connectors = 0;
        }
  
        dev = set->crtc->dev;
                mode_changed = true;
  
        if (mode_changed) {
-               set->crtc->enabled = (set->mode != NULL);
-               if (set->mode != NULL) {
+               set->crtc->enabled = drm_helper_crtc_in_use(set->crtc);
+               if (set->crtc->enabled) {
                        DRM_DEBUG_KMS("attempting to set mode from"
                                        " userspace\n");
                        drm_mode_debug_printmodeline(set->mode);
                                ret = -EINVAL;
                                goto fail;
                        }
 +                      DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
 +                      for (i = 0; i < set->num_connectors; i++) {
 +                              DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
 +                                            drm_get_connector_name(set->connectors[i]));
 +                              set->connectors[i]->dpms = DRM_MODE_DPMS_ON;
 +                      }
                }
                drm_helper_disable_unused_functions(dev);
        } else if (fb_changed) {
                        goto fail;
                }
        }
 -      DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
 -      for (i = 0; i < set->num_connectors; i++) {
 -              DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
 -                            drm_get_connector_name(set->connectors[i]));
 -              set->connectors[i]->dpms = DRM_MODE_DPMS_ON;
 -      }
  
        kfree(save_connectors);
        kfree(save_encoders);