Merge branch 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux into drm...
authorDave Airlie <airlied@redhat.com>
Wed, 20 Feb 2013 21:15:10 +0000 (07:15 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 20 Feb 2013 21:15:16 +0000 (07:15 +1000)
More drm-next bits for radeon.  Just bug fixes.

* 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: properly validate the atpx interface
  drm/radeon: switch get_gpu_clock() to a callback (v2)
  drm/radeon: add a asic callback to get the xclk
  drm/radeon: Avoid NULL pointer dereference from atom_index_iio() allocation failure
  drm/radeon: remove overzealous warning in hdmi handling
  drm/radeon: fix multi-head power profile stability on BTC+ asics

1  2 
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_device.c

@@@ -350,6 -350,7 +350,6 @@@ struct radeon_bo 
        struct drm_gem_object           gem_base;
  
        struct ttm_bo_kmap_obj dma_buf_vmap;
 -      int vmapping_count;
  };
  #define gem_to_radeon_bo(gobj) container_of((gobj), struct radeon_bo, gem_base)
  
@@@ -1178,6 -1179,10 +1178,10 @@@ struct radeon_asic 
        bool (*gui_idle)(struct radeon_device *rdev);
        /* wait for mc_idle */
        int (*mc_wait_for_idle)(struct radeon_device *rdev);
+       /* get the reference clock */
+       u32 (*get_xclk)(struct radeon_device *rdev);
+       /* get the gpu clock counter */
+       uint64_t (*get_gpu_clock_counter)(struct radeon_device *rdev);
        /* gart */
        struct {
                void (*tlb_flush)(struct radeon_device *rdev);
@@@ -1859,6 -1864,8 +1863,8 @@@ void radeon_ring_write(struct radeon_ri
  #define radeon_post_page_flip(rdev, crtc) (rdev)->asic->pflip.post_page_flip((rdev), (crtc))
  #define radeon_wait_for_vblank(rdev, crtc) (rdev)->asic->display.wait_for_vblank((rdev), (crtc))
  #define radeon_mc_wait_for_idle(rdev) (rdev)->asic->mc_wait_for_idle((rdev))
+ #define radeon_get_xclk(rdev) (rdev)->asic->get_xclk((rdev))
+ #define radeon_get_gpu_clock_counter(rdev) (rdev)->asic->get_gpu_clock_counter((rdev))
  
  /* Common functions */
  /* AGP */
@@@ -430,8 -430,7 +430,8 @@@ bool radeon_card_posted(struct radeon_d
  {
        uint32_t reg;
  
 -      if (efi_enabled && rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
 +      if (efi_enabled(EFI_BOOT) &&
 +          rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
                return false;
  
        /* first check CRTCs */
@@@ -759,6 -758,11 +759,11 @@@ int radeon_atombios_init(struct radeon_
        atom_card_info->pll_write = cail_pll_write;
  
        rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
+       if (!rdev->mode_info.atom_context) {
+               radeon_atombios_fini(rdev);
+               return -ENOMEM;
+       }
        mutex_init(&rdev->mode_info.atom_context->mutex);
        radeon_atom_initialize_bios_scratch_regs(rdev->ddev);
        atom_allocate_fb_scratch(rdev->mode_info.atom_context);
@@@ -778,9 -782,11 +783,11 @@@ void radeon_atombios_fini(struct radeon
  {
        if (rdev->mode_info.atom_context) {
                kfree(rdev->mode_info.atom_context->scratch);
-               kfree(rdev->mode_info.atom_context);
        }
+       kfree(rdev->mode_info.atom_context);
+       rdev->mode_info.atom_context = NULL;
        kfree(rdev->mode_info.atom_card_info);
+       rdev->mode_info.atom_card_info = NULL;
  }
  
  /* COMBIOS */