Merge branch 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux into drm...
authorDave Airlie <airlied@redhat.com>
Fri, 6 May 2016 04:17:22 +0000 (14:17 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 6 May 2016 04:17:22 +0000 (14:17 +1000)
This is the first big radeon/amdgpu pull request for 4.7.  Highlights:
    - Polaris support in amdgpu
      Current display stack on par with other asics, for advanced features DAL is required
      Power management support
      Support for GFX, Compute, SDMA, UVD, VCE
    - VCE and UVD init/fini cleanup in radeon
    - GPUVM improvements
    - Scheduler improvements
    - Clockgating improvements
    - Powerplay improvements
    - TTM changes to support driver specific LRU update mechanism
    - Radeon support for new Mesa features
    - ASYNC pageflip support for radeon
    - Lots of bug fixes and code cleanups

* 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux: (180 commits)
  drm/amdgpu: Replace rcu_assign_pointer() with RCU_INIT_POINTER()
  drm/amdgpu: use drm_mode_vrefresh() rather than mode->vrefresh
  drm/amdgpu/uvd6: add bypass support for fiji (v3)
  drm/amdgpu/fiji: set UVD CG state when enabling UVD DPM (v2)
  drm/powerplay: add missing clockgating callback for tonga
  drm/amdgpu: Constify some tables
  drm/amd/powerplay: Delete dead struct declaration
  drm/amd/powerplay/hwmgr: don't add invalid voltage
  drm/amd/powerplay/hwmgr: prevent VDDC from exceeding 2V
  MAINTAINERS: Remove unneded wildcard for the Radeon/AMDGPU drivers
  drm/radeon: add cayman VM support for append packet.
  drm/amd/amdgpu: Add debugfs entries for smc/didt/pcie
  drm/amd/amdgpu: Drop print_status callbacks.
  drm/amd/powerplay: revise reading/writing pptable on Polaris10
  drm/amd/powerplay: revise reading/writing pptable on Tonga
  drm/amd/powerplay: revise reading/writing pptable on Fiji
  drm/amd/powerplay: revise caching the soft pptable and add it's size
  drm/amd/powerplay: add dpm force multiple levels on cz/tonga/fiji/polaris (v2)
  drm/amd/powerplay: fix fan speed percent setting error on Polaris10
  drm/amd/powerplay: fix bug dpm can't work when resume back on Polaris
  ...

1  2 
MAINTAINERS
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_drv.c

diff --combined MAINTAINERS
index 8c10b4cc4da7b2c8636f74bed61d2b01cf7beba9,4f2e3a4e3c8cbfa2907d0f0dbf909a6b685e51a0..e6ee4ecf34b03d341a8f42c2ddeb82a905672005
@@@ -3768,21 -3768,6 +3768,21 @@@ F:    drivers/gpu/vga
  F:    include/drm/
  F:    include/uapi/drm/
  
 +DRM DRIVER FOR AST SERVER GRAPHICS CHIPS
 +M:    Dave Airlie <airlied@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/ast/
 +
 +DRM DRIVER FOR BOCHS VIRTUAL GPU
 +M:    Gerd Hoffmann <kraxel@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/bochs/
 +
 +DRM DRIVER FOR QEMU'S CIRRUS DEVICE
 +M:    Dave Airlie <airlied@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/cirrus/
 +
  RADEON and AMDGPU DRM DRIVERS
  M:    Alex Deucher <alexander.deucher@amd.com>
  M:    Christian König <christian.koenig@amd.com>
@@@ -3790,9 -3775,9 +3790,9 @@@ L:      dri-devel@lists.freedesktop.or
  T:    git git://people.freedesktop.org/~agd5f/linux
  S:    Supported
  F:    drivers/gpu/drm/radeon/
- F:    include/uapi/drm/radeon*
+ F:    include/uapi/drm/radeon_drm.h
  F:    drivers/gpu/drm/amd/
- F:    include/uapi/drm/amdgpu*
+ F:    include/uapi/drm/amdgpu_drm.h
  
  DRM PANEL DRIVERS
  M:    Thierry Reding <thierry.reding@gmail.com>
@@@ -3815,7 -3800,7 +3815,7 @@@ T:      git git://anongit.freedesktop.org/dr
  S:    Supported
  F:    drivers/gpu/drm/i915/
  F:    include/drm/i915*
 -F:    include/uapi/drm/i915*
 +F:    include/uapi/drm/i915_drm.h
  
  DRM DRIVERS FOR ATMEL HLCDC
  M:    Boris Brezillon <boris.brezillon@free-electrons.com>
@@@ -3840,8 -3825,8 +3840,8 @@@ L:      dri-devel@lists.freedesktop.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git
  S:    Supported
  F:    drivers/gpu/drm/exynos/
 -F:    include/drm/exynos*
 -F:    include/uapi/drm/exynos*
 +F:    include/uapi/drm/exynos_drm.h
 +F:    Documentation/devicetree/bindings/display/exynos/
  
  DRM DRIVERS FOR FREESCALE DCU
  M:    Stefan Agner <stefan@agner.ch>
@@@ -3866,42 -3851,8 +3866,42 @@@ M:    Patrik Jakobsson <patrik.r.jakobsson
  L:    dri-devel@lists.freedesktop.org
  T:    git git://github.com/patjak/drm-gma500
  S:    Maintained
 -F:    drivers/gpu/drm/gma500
 -F:    include/drm/gma500*
 +F:    drivers/gpu/drm/gma500/
 +
 +DRM DRIVERS FOR HISILICON
 +M:    Xinliang Liu <z.liuxinliang@hisilicon.com>
 +R:    Xinwei Kong <kong.kongxinwei@hisilicon.com>
 +R:    Chen Feng <puck.chen@hisilicon.com>
 +L:    dri-devel@lists.freedesktop.org
 +T:    git git://github.com/xin3liang/linux.git
 +S:    Maintained
 +F:    drivers/gpu/drm/hisilicon/
 +F:    Documentation/devicetree/bindings/display/hisilicon/
 +
 +DRM DRIVER FOR INTEL I810 VIDEO CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/i810/
 +F:    include/uapi/drm/i810_drm.h
 +
 +DRM DRIVER FOR MSM ADRENO GPU
 +M:    Rob Clark <robdclark@gmail.com>
 +L:    linux-arm-msm@vger.kernel.org
 +L:    dri-devel@lists.freedesktop.org
 +L:    freedreno@lists.freedesktop.org
 +T:    git git://people.freedesktop.org/~robclark/linux
 +S:    Maintained
 +F:    drivers/gpu/drm/msm/
 +F:    include/uapi/drm/msm_drm.h
 +F:    Documentation/devicetree/bindings/display/msm/
 +
 +DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS
 +M:    Ben Skeggs <bskeggs@redhat.com>
 +L:    dri-devel@lists.freedesktop.org
 +L:    nouveau@lists.freedesktop.org
 +T:    git git://github.com/skeggsb/linux
 +S:    Supported
 +F:    drivers/gpu/drm/nouveau/
 +F:    include/uapi/drm/nouveau_drm.h
  
  DRM DRIVERS FOR NVIDIA TEGRA
  M:    Thierry Reding <thierry.reding@gmail.com>
@@@ -3916,54 -3867,22 +3916,54 @@@ F:   include/linux/host1x.
  F:    include/uapi/drm/tegra_drm.h
  F:    Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt
  
 +DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/mga/
 +F:    include/uapi/drm/mga_drm.h
 +
 +DRM DRIVER FOR MGA G200 SERVER GRAPHICS CHIPS
 +M:    Dave Airlie <airlied@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/mgag200/
 +
 +DRM DRIVER FOR RAGE 128 VIDEO CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/r128/
 +F:    include/uapi/drm/r128_drm.h
 +
  DRM DRIVERS FOR RENESAS
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  L:    dri-devel@lists.freedesktop.org
  L:    linux-renesas-soc@vger.kernel.org
 -T:    git git://people.freedesktop.org/~airlied/linux
 +T:    git git://linuxtv.org/pinchartl/fbdev
  S:    Supported
  F:    drivers/gpu/drm/rcar-du/
  F:    drivers/gpu/drm/shmobile/
  F:    include/linux/platform_data/shmob_drm.h
 +F:    Documentation/devicetree/bindings/display/renesas,du.txt
 +
 +DRM DRIVER FOR QXL VIRTUAL GPU
 +M:    Dave Airlie <airlied@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/qxl/
 +F:    include/uapi/drm/qxl_drm.h
  
  DRM DRIVERS FOR ROCKCHIP
  M:    Mark Yao <mark.yao@rock-chips.com>
  L:    dri-devel@lists.freedesktop.org
  S:    Maintained
  F:    drivers/gpu/drm/rockchip/
 -F:    Documentation/devicetree/bindings/display/rockchip*
 +F:    Documentation/devicetree/bindings/display/rockchip/
 +
 +DRM DRIVER FOR SAVAGE VIDEO CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/savage/
 +F:    include/uapi/drm/savage_drm.h
 +
 +DRM DRIVER FOR SIS VIDEO CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/sis/
 +F:    include/uapi/drm/sis_drm.h
  
  DRM DRIVERS FOR STI
  M:    Benjamin Gaignard <benjamin.gaignard@linaro.org>
@@@ -3974,43 -3893,14 +3974,43 @@@ S:   Maintaine
  F:    drivers/gpu/drm/sti
  F:    Documentation/devicetree/bindings/display/st,stih4xx.txt
  
 +DRM DRIVER FOR TDFX VIDEO CARDS
 +S:    Orphan / Obsolete
 +F:    drivers/gpu/drm/tdfx/
 +
 +DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS
 +M:    Dave Airlie <airlied@redhat.com>
 +S:    Odd Fixes
 +F:    drivers/gpu/drm/udl/
 +
  DRM DRIVERS FOR VIVANTE GPU IP
  M:    Lucas Stach <l.stach@pengutronix.de>
  R:    Russell King <linux+etnaviv@arm.linux.org.uk>
  R:    Christian Gmeiner <christian.gmeiner@gmail.com>
  L:    dri-devel@lists.freedesktop.org
  S:    Maintained
 -F:    drivers/gpu/drm/etnaviv
 -F:    Documentation/devicetree/bindings/display/etnaviv
 +F:    drivers/gpu/drm/etnaviv/
 +F:    include/uapi/drm/etnaviv_drm.h
 +F:    Documentation/devicetree/bindings/display/etnaviv/
 +
 +DRM DRIVER FOR VMWARE VIRTUAL GPU
 +M:    "VMware Graphics" <linux-graphics-maintainer@vmware.com>
 +M:    Sinclair Yeh <syeh@vmware.com>
 +M:    Thomas Hellstrom <thellstrom@vmware.com>
 +L:    dri-devel@lists.freedesktop.org
 +T:    git git://people.freedesktop.org/~syeh/repos_linux
 +T:    git git://people.freedesktop.org/~thomash/linux
 +S:    Supported
 +F:    drivers/gpu/drm/vmwgfx/
 +F:    include/uapi/drm/vmwgfx_drm.h
 +
 +DRM DRIVERS FOR VC4
 +M:    Eric Anholt <eric@anholt.net>
 +T:    git git://github.com/anholt/linux
 +S:    Supported
 +F:    drivers/gpu/drm/vc4/
 +F:    include/uapi/drm/vc4_drm.h
 +F:    Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
  
  DSBR100 USB FM RADIO DRIVER
  M:    Alexey Klimov <klimov.linux@gmail.com>
@@@ -7032,8 -6922,6 +7032,8 @@@ MARVELL ARMADA DRM SUPPOR
  M:    Russell King <rmk+kernel@arm.linux.org.uk>
  S:    Maintained
  F:    drivers/gpu/drm/armada/
 +F:    include/uapi/drm/armada_drm.h
 +F:    Documentation/devicetree/bindings/display/armada/
  
  MARVELL 88E6352 DSA support
  M:    Guenter Roeck <linux@roeck-us.net>
index 44955f0f32d0c6f8493702f90e46cb53ba643db0,b48942a1e567d6118a1432e0981d7e231086fe7e..1dab5f2b725bb42d5792869239774ffef1f48427
@@@ -166,7 -166,7 +166,7 @@@ module_param_named(pcie_gen_cap, amdgpu
  MODULE_PARM_DESC(pcie_lane_cap, "PCIE Lane Caps (0: autodetect (default))");
  module_param_named(pcie_lane_cap, amdgpu_pcie_lane_cap, uint, 0444);
  
- static struct pci_device_id pciidlist[] = {
+ static const struct pci_device_id pciidlist[] = {
  #ifdef CONFIG_DRM_AMDGPU_CIK
        /* Kaveri */
        {0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|AMD_IS_MOBILITY|AMD_IS_APU},
        {0x1002, 0x9877, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CARRIZO|AMD_IS_APU},
        /* stoney */
        {0x1002, 0x98E4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_STONEY|AMD_IS_APU},
+       /* Polaris11 */
+       {0x1002, 0x67E0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       {0x1002, 0x67E1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       {0x1002, 0x67E8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       {0x1002, 0x67E9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       {0x1002, 0x67EB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       {0x1002, 0x67FF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS11},
+       /* Polaris10 */
+       {0x1002, 0x67C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
+       {0x1002, 0x67DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS10},
  
        {0, 0, 0}
  };
@@@ -514,7 -524,7 +524,7 @@@ static struct drm_driver kms_driver = 
        .irq_uninstall = amdgpu_irq_uninstall,
        .irq_handler = amdgpu_irq_handler,
        .ioctls = amdgpu_ioctls_kms,
 -      .gem_free_object = amdgpu_gem_object_free,
 +      .gem_free_object_unlocked = amdgpu_gem_object_free,
        .gem_open_object = amdgpu_gem_object_open,
        .gem_close_object = amdgpu_gem_object_close,
        .dumb_create = amdgpu_mode_dumb_create,
index a087b9638cded5119a992e0c545f5f77627ae67e,0635bb6b45c46a68af8894bf045ae3a396ce63c1..c68f4cacaa85ab5fe219b57050d98c53fbc2190e
@@@ -93,7 -93,7 +93,7 @@@ void amdgpu_gem_force_release(struct am
        struct drm_device *ddev = adev->ddev;
        struct drm_file *file;
  
 -      mutex_lock(&ddev->struct_mutex);
 +      mutex_lock(&ddev->filelist_mutex);
  
        list_for_each_entry(file, &ddev->filelist, lhead) {
                struct drm_gem_object *gobj;
                spin_lock(&file->table_lock);
                idr_for_each_entry(&file->object_idr, gobj, handle) {
                        WARN_ONCE(1, "And also active allocations!\n");
 -                      drm_gem_object_unreference(gobj);
 +                      drm_gem_object_unreference_unlocked(gobj);
                }
                idr_destroy(&file->object_idr);
                spin_unlock(&file->table_lock);
        }
  
 -      mutex_unlock(&ddev->struct_mutex);
 +      mutex_unlock(&ddev->filelist_mutex);
  }
  
  /*
@@@ -769,7 -769,7 +769,7 @@@ static int amdgpu_debugfs_gem_info(stru
        struct drm_file *file;
        int r;
  
 -      r = mutex_lock_interruptible(&dev->struct_mutex);
 +      r = mutex_lock_interruptible(&dev->filelist_mutex);
        if (r)
                return r;
  
                spin_unlock(&file->table_lock);
        }
  
 -      mutex_unlock(&dev->struct_mutex);
 +      mutex_unlock(&dev->filelist_mutex);
        return 0;
  }
  
- static struct drm_info_list amdgpu_debugfs_gem_list[] = {
+ static const struct drm_info_list amdgpu_debugfs_gem_list[] = {
        {"amdgpu_gem_info", &amdgpu_debugfs_gem_info, 0, NULL},
  };
  #endif
index 92c5a71a7da70f7de05b29021e3f8902978e1e88,f7f67f385b04c6a1520d587709e0dac2f20dca7d..8af5fbc60e5b15f4287ad7679c3ced3cdc8aab76
@@@ -3130,14 -3130,6 +3130,6 @@@ static int dce_v10_0_wait_for_idle(voi
        return 0;
  }
  
- static void dce_v10_0_print_status(void *handle)
- {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-       dev_info(adev->dev, "DCE 10.x registers\n");
-       /* XXX todo */
- }
  static int dce_v10_0_soft_reset(void *handle)
  {
        u32 srbm_soft_reset = 0, tmp;
                srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_DC_MASK;
  
        if (srbm_soft_reset) {
-               dce_v10_0_print_status((void *)adev);
                tmp = RREG32(mmSRBM_SOFT_RESET);
                tmp |= srbm_soft_reset;
                dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
  
                /* Wait a little for things to settle down */
                udelay(50);
-               dce_v10_0_print_status((void *)adev);
        }
        return 0;
  }
@@@ -3370,7 -3359,7 +3359,7 @@@ static int dce_v10_0_pageflip_irq(struc
  
        /* wakeup usersapce */
        if (works->event)
 -              drm_send_vblank_event(adev->ddev, crtc_id, works->event);
 +              drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
  
        spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
  
@@@ -3512,7 -3501,6 +3501,6 @@@ const struct amd_ip_funcs dce_v10_0_ip_
        .is_idle = dce_v10_0_is_idle,
        .wait_for_idle = dce_v10_0_wait_for_idle,
        .soft_reset = dce_v10_0_soft_reset,
-       .print_status = dce_v10_0_print_status,
        .set_clockgating_state = dce_v10_0_set_clockgating_state,
        .set_powergating_state = dce_v10_0_set_powergating_state,
  };
index 2f784f2d9233831a576bc3f428f45530279a0599,e4f3dc791030b963dbcd1dfd0d2eb528b6d51c29..dda9ffb68df8953274844ca43215d3b6af6b3c14
@@@ -132,6 -132,22 +132,22 @@@ static const u32 stoney_golden_settings
        mmFBC_MISC, 0x1f311fff, 0x14302000,
  };
  
+ static const u32 polaris11_golden_settings_a11[] =
+ {
+       mmDCI_CLK_CNTL, 0x00000080, 0x00000000,
+       mmFBC_DEBUG_COMP, 0x000000f0, 0x00000070,
+       mmFBC_DEBUG1, 0xffffffff, 0x00000008,
+       mmFBC_MISC, 0x9f313fff, 0x14300008,
+       mmHDMI_CONTROL, 0x313f031f, 0x00000011,
+ };
+ static const u32 polaris10_golden_settings_a11[] =
+ {
+       mmDCI_CLK_CNTL, 0x00000080, 0x00000000,
+       mmFBC_DEBUG_COMP, 0x000000f0, 0x00000070,
+       mmFBC_MISC, 0x9f313fff, 0x14300008,
+       mmHDMI_CONTROL, 0x313f031f, 0x00000011,
+ };
  
  static void dce_v11_0_init_golden_registers(struct amdgpu_device *adev)
  {
                                                 stoney_golden_settings_a11,
                                                 (const u32)ARRAY_SIZE(stoney_golden_settings_a11));
                break;
+       case CHIP_POLARIS11:
+               amdgpu_program_register_sequence(adev,
+                                                polaris11_golden_settings_a11,
+                                                (const u32)ARRAY_SIZE(polaris11_golden_settings_a11));
+               break;
+       case CHIP_POLARIS10:
+               amdgpu_program_register_sequence(adev,
+                                                polaris10_golden_settings_a11,
+                                                (const u32)ARRAY_SIZE(polaris10_golden_settings_a11));
+               break;
        default:
                break;
        }
@@@ -565,35 -591,14 +591,14 @@@ static void dce_v11_0_stop_mc_access(st
                crtc_enabled = REG_GET_FIELD(RREG32(mmCRTC_CONTROL + crtc_offsets[i]),
                                             CRTC_CONTROL, CRTC_MASTER_EN);
                if (crtc_enabled) {
- #if 0
-                       u32 frame_count;
-                       int j;
+ #if 1
                        save->crtc_enabled[i] = true;
                        tmp = RREG32(mmCRTC_BLANK_CONTROL + crtc_offsets[i]);
                        if (REG_GET_FIELD(tmp, CRTC_BLANK_CONTROL, CRTC_BLANK_DATA_EN) == 0) {
-                               amdgpu_display_vblank_wait(adev, i);
-                               WREG32(mmCRTC_UPDATE_LOCK + crtc_offsets[i], 1);
+                               /*it is correct only for RGB ; black is 0*/
+                               WREG32(mmCRTC_BLANK_DATA_COLOR + crtc_offsets[i], 0);
                                tmp = REG_SET_FIELD(tmp, CRTC_BLANK_CONTROL, CRTC_BLANK_DATA_EN, 1);
                                WREG32(mmCRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
-                               WREG32(mmCRTC_UPDATE_LOCK + crtc_offsets[i], 0);
-                       }
-                       /* wait for the next frame */
-                       frame_count = amdgpu_display_vblank_get_counter(adev, i);
-                       for (j = 0; j < adev->usec_timeout; j++) {
-                               if (amdgpu_display_vblank_get_counter(adev, i) != frame_count)
-                                       break;
-                               udelay(1);
-                       }
-                       tmp = RREG32(mmGRPH_UPDATE + crtc_offsets[i]);
-                       if (REG_GET_FIELD(tmp, GRPH_UPDATE, GRPH_UPDATE_LOCK) == 0) {
-                               tmp = REG_SET_FIELD(tmp, GRPH_UPDATE, GRPH_UPDATE_LOCK, 1);
-                               WREG32(mmGRPH_UPDATE + crtc_offsets[i], tmp);
-                       }
-                       tmp = RREG32(mmCRTC_MASTER_UPDATE_LOCK + crtc_offsets[i]);
-                       if (REG_GET_FIELD(tmp, CRTC_MASTER_UPDATE_LOCK, MASTER_UPDATE_LOCK) == 0) {
-                               tmp = REG_SET_FIELD(tmp, CRTC_MASTER_UPDATE_LOCK, MASTER_UPDATE_LOCK, 1);
-                               WREG32(mmCRTC_MASTER_UPDATE_LOCK + crtc_offsets[i], tmp);
                        }
  #else
                        /* XXX this is a hack to avoid strange behavior with EFI on certain systems */
  static void dce_v11_0_resume_mc_access(struct amdgpu_device *adev,
                                       struct amdgpu_mode_mc_save *save)
  {
-       u32 tmp, frame_count;
-       int i, j;
+       u32 tmp;
+       int i;
  
        /* update crtc base addresses */
        for (i = 0; i < adev->mode_info.num_crtc; i++) {
                WREG32(mmGRPH_PRIMARY_SURFACE_ADDRESS_HIGH + crtc_offsets[i],
                       upper_32_bits(adev->mc.vram_start));
-               WREG32(mmGRPH_SECONDARY_SURFACE_ADDRESS_HIGH + crtc_offsets[i],
-                      upper_32_bits(adev->mc.vram_start));
                WREG32(mmGRPH_PRIMARY_SURFACE_ADDRESS + crtc_offsets[i],
                       (u32)adev->mc.vram_start);
-               WREG32(mmGRPH_SECONDARY_SURFACE_ADDRESS + crtc_offsets[i],
-                      (u32)adev->mc.vram_start);
  
                if (save->crtc_enabled[i]) {
-                       tmp = RREG32(mmCRTC_MASTER_UPDATE_MODE + crtc_offsets[i]);
-                       if (REG_GET_FIELD(tmp, CRTC_MASTER_UPDATE_MODE, MASTER_UPDATE_MODE) != 3) {
-                               tmp = REG_SET_FIELD(tmp, CRTC_MASTER_UPDATE_MODE, MASTER_UPDATE_MODE, 3);
-                               WREG32(mmCRTC_MASTER_UPDATE_MODE + crtc_offsets[i], tmp);
-                       }
-                       tmp = RREG32(mmGRPH_UPDATE + crtc_offsets[i]);
-                       if (REG_GET_FIELD(tmp, GRPH_UPDATE, GRPH_UPDATE_LOCK)) {
-                               tmp = REG_SET_FIELD(tmp, GRPH_UPDATE, GRPH_UPDATE_LOCK, 0);
-                               WREG32(mmGRPH_UPDATE + crtc_offsets[i], tmp);
-                       }
-                       tmp = RREG32(mmCRTC_MASTER_UPDATE_LOCK + crtc_offsets[i]);
-                       if (REG_GET_FIELD(tmp, CRTC_MASTER_UPDATE_LOCK, MASTER_UPDATE_LOCK)) {
-                               tmp = REG_SET_FIELD(tmp, CRTC_MASTER_UPDATE_LOCK, MASTER_UPDATE_LOCK, 0);
-                               WREG32(mmCRTC_MASTER_UPDATE_LOCK + crtc_offsets[i], tmp);
-                       }
-                       for (j = 0; j < adev->usec_timeout; j++) {
-                               tmp = RREG32(mmGRPH_UPDATE + crtc_offsets[i]);
-                               if (REG_GET_FIELD(tmp, GRPH_UPDATE, GRPH_SURFACE_UPDATE_PENDING) == 0)
-                                       break;
-                               udelay(1);
-                       }
                        tmp = RREG32(mmCRTC_BLANK_CONTROL + crtc_offsets[i]);
                        tmp = REG_SET_FIELD(tmp, CRTC_BLANK_CONTROL, CRTC_BLANK_DATA_EN, 0);
-                       WREG32(mmCRTC_UPDATE_LOCK + crtc_offsets[i], 1);
                        WREG32(mmCRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
-                       WREG32(mmCRTC_UPDATE_LOCK + crtc_offsets[i], 0);
-                       /* wait for the next frame */
-                       frame_count = amdgpu_display_vblank_get_counter(adev, i);
-                       for (j = 0; j < adev->usec_timeout; j++) {
-                               if (amdgpu_display_vblank_get_counter(adev, i) != frame_count)
-                                       break;
-                               udelay(1);
-                       }
                }
        }
  
@@@ -1635,7 -1606,20 +1606,20 @@@ static int dce_v11_0_audio_init(struct 
  
        adev->mode_info.audio.enabled = true;
  
-       adev->mode_info.audio.num_pins = 7;
+       switch (adev->asic_type) {
+       case CHIP_CARRIZO:
+       case CHIP_STONEY:
+               adev->mode_info.audio.num_pins = 7;
+               break;
+       case CHIP_POLARIS10:
+               adev->mode_info.audio.num_pins = 8;
+               break;
+       case CHIP_POLARIS11:
+               adev->mode_info.audio.num_pins = 6;
+               break;
+       default:
+               return -EINVAL;
+       }
  
        for (i = 0; i < adev->mode_info.audio.num_pins; i++) {
                adev->mode_info.audio.pin[i].channels = -1;
@@@ -2427,6 -2411,44 +2411,44 @@@ static u32 dce_v11_0_pick_pll(struct dr
        u32 pll_in_use;
        int pll;
  
+       if ((adev->asic_type == CHIP_POLARIS10) ||
+           (adev->asic_type == CHIP_POLARIS11)) {
+               struct amdgpu_encoder *amdgpu_encoder =
+                       to_amdgpu_encoder(amdgpu_crtc->encoder);
+               struct amdgpu_encoder_atom_dig *dig = amdgpu_encoder->enc_priv;
+               if (ENCODER_MODE_IS_DP(amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder)))
+                       return ATOM_DP_DTO;
+               /* use the same PPLL for all monitors with the same clock */
+               pll = amdgpu_pll_get_shared_nondp_ppll(crtc);
+               if (pll != ATOM_PPLL_INVALID)
+                       return pll;
+               switch (amdgpu_encoder->encoder_id) {
+               case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
+                       if (dig->linkb)
+                               return ATOM_COMBOPHY_PLL1;
+                       else
+                               return ATOM_COMBOPHY_PLL0;
+                       break;
+               case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
+                       if (dig->linkb)
+                               return ATOM_COMBOPHY_PLL3;
+                       else
+                               return ATOM_COMBOPHY_PLL2;
+                       break;
+               case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
+                       if (dig->linkb)
+                               return ATOM_COMBOPHY_PLL5;
+                       else
+                               return ATOM_COMBOPHY_PLL4;
+                       break;
+               default:
+                       DRM_ERROR("invalid encoder_id: 0x%x\n", amdgpu_encoder->encoder_id);
+                       return ATOM_PPLL_INVALID;
+               }
+       }
        if (ENCODER_MODE_IS_DP(amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder))) {
                if (adev->clock.dp_extclk)
                        /* skip PPLL programming if using ext clock */
@@@ -2782,7 -2804,17 +2804,17 @@@ static void dce_v11_0_crtc_disable(stru
        case ATOM_PPLL2:
                /* disable the ppll */
                amdgpu_atombios_crtc_program_pll(crtc, amdgpu_crtc->crtc_id, amdgpu_crtc->pll_id,
-                                         0, 0, ATOM_DISABLE, 0, 0, 0, 0, 0, false, &ss);
+                                                0, 0, ATOM_DISABLE, 0, 0, 0, 0, 0, false, &ss);
+               break;
+       case ATOM_COMBOPHY_PLL0:
+       case ATOM_COMBOPHY_PLL1:
+       case ATOM_COMBOPHY_PLL2:
+       case ATOM_COMBOPHY_PLL3:
+       case ATOM_COMBOPHY_PLL4:
+       case ATOM_COMBOPHY_PLL5:
+               /* disable the ppll */
+               amdgpu_atombios_crtc_program_pll(crtc, ATOM_CRTC_INVALID, amdgpu_crtc->pll_id,
+                                                0, 0, ATOM_DISABLE, 0, 0, 0, 0, 0, false, &ss);
                break;
        default:
                break;
@@@ -2800,11 -2832,28 +2832,28 @@@ static int dce_v11_0_crtc_mode_set(stru
                                  int x, int y, struct drm_framebuffer *old_fb)
  {
        struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
+       struct drm_device *dev = crtc->dev;
+       struct amdgpu_device *adev = dev->dev_private;
  
        if (!amdgpu_crtc->adjusted_clock)
                return -EINVAL;
  
-       amdgpu_atombios_crtc_set_pll(crtc, adjusted_mode);
+       if ((adev->asic_type == CHIP_POLARIS10) ||
+           (adev->asic_type == CHIP_POLARIS11)) {
+               struct amdgpu_encoder *amdgpu_encoder =
+                       to_amdgpu_encoder(amdgpu_crtc->encoder);
+               int encoder_mode =
+                       amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder);
+               /* SetPixelClock calculates the plls and ss values now */
+               amdgpu_atombios_crtc_program_pll(crtc, amdgpu_crtc->crtc_id,
+                                                amdgpu_crtc->pll_id,
+                                                encoder_mode, amdgpu_encoder->encoder_id,
+                                                adjusted_mode->clock, 0, 0, 0, 0,
+                                                amdgpu_crtc->bpc, amdgpu_crtc->ss_enabled, &amdgpu_crtc->ss);
+       } else {
+               amdgpu_atombios_crtc_set_pll(crtc, adjusted_mode);
+       }
        amdgpu_atombios_crtc_set_dtd_timing(crtc, adjusted_mode);
        dce_v11_0_crtc_do_set_base(crtc, old_fb, x, y, 0);
        amdgpu_atombios_crtc_overscan_setup(crtc, mode, adjusted_mode);
@@@ -2955,6 -3004,16 +3004,16 @@@ static int dce_v11_0_early_init(void *h
                adev->mode_info.num_hpd = 6;
                adev->mode_info.num_dig = 9;
                break;
+       case CHIP_POLARIS10:
+               adev->mode_info.num_crtc = 6;
+               adev->mode_info.num_hpd = 6;
+               adev->mode_info.num_dig = 6;
+               break;
+       case CHIP_POLARIS11:
+               adev->mode_info.num_crtc = 5;
+               adev->mode_info.num_hpd = 5;
+               adev->mode_info.num_dig = 5;
+               break;
        default:
                /* FIXME: not supported yet */
                return -EINVAL;
@@@ -3057,7 -3116,15 +3116,15 @@@ static int dce_v11_0_hw_init(void *hand
        /* init dig PHYs, disp eng pll */
        amdgpu_atombios_crtc_powergate_init(adev);
        amdgpu_atombios_encoder_init_dig(adev);
-       amdgpu_atombios_crtc_set_disp_eng_pll(adev, adev->clock.default_dispclk);
+       if ((adev->asic_type == CHIP_POLARIS10) ||
+           (adev->asic_type == CHIP_POLARIS11)) {
+               amdgpu_atombios_crtc_set_dce_clock(adev, adev->clock.default_dispclk,
+                                                  DCE_CLOCK_TYPE_DISPCLK, ATOM_GCK_DFS);
+               amdgpu_atombios_crtc_set_dce_clock(adev, 0,
+                                                  DCE_CLOCK_TYPE_DPREFCLK, ATOM_GCK_DFS);
+       } else {
+               amdgpu_atombios_crtc_set_disp_eng_pll(adev, adev->clock.default_dispclk);
+       }
  
        /* initialize hpd */
        dce_v11_0_hpd_init(adev);
@@@ -3126,14 -3193,6 +3193,6 @@@ static int dce_v11_0_wait_for_idle(voi
        return 0;
  }
  
- static void dce_v11_0_print_status(void *handle)
- {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-       dev_info(adev->dev, "DCE 10.x registers\n");
-       /* XXX todo */
- }
  static int dce_v11_0_soft_reset(void *handle)
  {
        u32 srbm_soft_reset = 0, tmp;
                srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_DC_MASK;
  
        if (srbm_soft_reset) {
-               dce_v11_0_print_status((void *)adev);
                tmp = RREG32(mmSRBM_SOFT_RESET);
                tmp |= srbm_soft_reset;
                dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
  
                /* Wait a little for things to settle down */
                udelay(50);
-               dce_v11_0_print_status((void *)adev);
        }
        return 0;
  }
@@@ -3366,7 -3422,7 +3422,7 @@@ static int dce_v11_0_pageflip_irq(struc
  
        /* wakeup usersapce */
        if(works->event)
 -              drm_send_vblank_event(adev->ddev, crtc_id, works->event);
 +              drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
  
        spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
  
@@@ -3508,7 -3564,6 +3564,6 @@@ const struct amd_ip_funcs dce_v11_0_ip_
        .is_idle = dce_v11_0_is_idle,
        .wait_for_idle = dce_v11_0_wait_for_idle,
        .soft_reset = dce_v11_0_soft_reset,
-       .print_status = dce_v11_0_print_status,
        .set_clockgating_state = dce_v11_0_set_clockgating_state,
        .set_powergating_state = dce_v11_0_set_powergating_state,
  };
index 9155e3b1d782f4686e8fb9365ec873f981166edf,429e98affba68ec7627ef176a157a8f7c0963ed3..25e6af03c4065a59d73e9d747e071b9f6d59b0be
@@@ -3038,14 -3038,6 +3038,6 @@@ static int dce_v8_0_wait_for_idle(void 
        return 0;
  }
  
- static void dce_v8_0_print_status(void *handle)
- {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-       dev_info(adev->dev, "DCE 8.x registers\n");
-       /* XXX todo */
- }
  static int dce_v8_0_soft_reset(void *handle)
  {
        u32 srbm_soft_reset = 0, tmp;
                srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_DC_MASK;
  
        if (srbm_soft_reset) {
-               dce_v8_0_print_status((void *)adev);
                tmp = RREG32(mmSRBM_SOFT_RESET);
                tmp |= srbm_soft_reset;
                dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
  
                /* Wait a little for things to settle down */
                udelay(50);
-               dce_v8_0_print_status((void *)adev);
        }
        return 0;
  }
@@@ -3379,7 -3368,7 +3368,7 @@@ static int dce_v8_0_pageflip_irq(struc
  
        /* wakeup usersapce */
        if (works->event)
 -              drm_send_vblank_event(adev->ddev, crtc_id, works->event);
 +              drm_crtc_send_vblank_event(&amdgpu_crtc->base, works->event);
  
        spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
  
@@@ -3442,7 -3431,6 +3431,6 @@@ const struct amd_ip_funcs dce_v8_0_ip_f
        .is_idle = dce_v8_0_is_idle,
        .wait_for_idle = dce_v8_0_wait_for_idle,
        .soft_reset = dce_v8_0_soft_reset,
-       .print_status = dce_v8_0_print_status,
        .set_clockgating_state = dce_v8_0_set_clockgating_state,
        .set_powergating_state = dce_v8_0_set_powergating_state,
  };
index d596c83ce6aab5cd172ba851aa283c3b5ca52f9d,7f176ecfc58313e71fb573f373142485d01e7ae7..628eb878a06961580994cb39aac0c94dbfec7db2
@@@ -377,7 -377,7 +377,7 @@@ void radeon_crtc_handle_flip(struct rad
  
        /* wakeup userspace */
        if (work->event)
 -              drm_send_vblank_event(rdev->ddev, crtc_id, work->event);
 +              drm_crtc_send_vblank_event(&radeon_crtc->base, work->event);
  
        spin_unlock_irqrestore(&rdev->ddev->event_lock, flags);
  
@@@ -490,7 -490,7 +490,7 @@@ static void radeon_flip_work_func(struc
                                 vblank->linedur_ns / 1000, stat, vpos, hpos);
  
        /* do the flip (mmio) */
-       radeon_page_flip(rdev, radeon_crtc->crtc_id, work->base);
+       radeon_page_flip(rdev, radeon_crtc->crtc_id, work->base, work->async);
  
        radeon_crtc->flip_status = RADEON_FLIP_SUBMITTED;
        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
@@@ -525,6 -525,7 +525,7 @@@ static int radeon_crtc_page_flip(struc
        work->rdev = rdev;
        work->crtc_id = radeon_crtc->crtc_id;
        work->event = event;
+       work->async = (page_flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0;
  
        /* schedule unpin of the old buffer */
        old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb);
@@@ -1630,6 -1631,9 +1631,9 @@@ int radeon_modeset_init(struct radeon_d
  
        rdev->ddev->mode_config.funcs = &radeon_mode_funcs;
  
+       if (radeon_use_pflipirq == 2 && rdev->family >= CHIP_R600)
+               rdev->ddev->mode_config.async_page_flip = true;
        if (ASIC_IS_DCE5(rdev)) {
                rdev->ddev->mode_config.max_width = 16384;
                rdev->ddev->mode_config.max_height = 16384;
index b9f74e68527e5cf9aba22e77c378fc8c2f44e5b1,c0083f04a84247135863a2b6df99d04facb52e92..b55aa740171f1d1d9cecdbf55e97d51098af0f22
   *   2.41.0 - evergreen/cayman: Add SET_BASE/DRAW_INDIRECT command parsing support
   *   2.42.0 - Add VCE/VUI (Video Usability Information) support
   *   2.43.0 - RADEON_INFO_GPU_RESET_COUNTER
+  *   2.44.0 - SET_APPEND_CNT packet3 support
+  *   2.45.0 - Allow setting shader registers using DMA/COPY packet3 on SI
   */
  #define KMS_DRIVER_MAJOR      2
- #define KMS_DRIVER_MINOR      43
+ #define KMS_DRIVER_MINOR      45
  #define KMS_DRIVER_PATCHLEVEL 0
  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
  int radeon_driver_unload_kms(struct drm_device *dev);
@@@ -105,7 -107,8 +107,8 @@@ void radeon_driver_postclose_kms(struc
                                 struct drm_file *file_priv);
  void radeon_driver_preclose_kms(struct drm_device *dev,
                                struct drm_file *file_priv);
- int radeon_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon);
+ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
+                      bool fbcon, bool freeze);
  int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon);
  u32 radeon_get_vblank_counter_kms(struct drm_device *dev, unsigned int pipe);
  int radeon_enable_vblank_kms(struct drm_device *dev, unsigned int pipe);
@@@ -196,6 -199,8 +199,8 @@@ int radeon_bapm = -1
  int radeon_backlight = -1;
  int radeon_auxch = -1;
  int radeon_mst = 0;
+ int radeon_uvd = 1;
+ int radeon_vce = 1;
  
  MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
  module_param_named(no_wb, radeon_no_wb, int, 0444);
@@@ -287,6 -292,12 +292,12 @@@ module_param_named(auxch, radeon_auxch
  MODULE_PARM_DESC(mst, "DisplayPort MST experimental support (1 = enable, 0 = disable)");
  module_param_named(mst, radeon_mst, int, 0444);
  
+ MODULE_PARM_DESC(uvd, "uvd enable/disable uvd support (1 = enable, 0 = disable)");
+ module_param_named(uvd, radeon_uvd, int, 0444);
+ MODULE_PARM_DESC(vce, "vce enable/disable vce support (1 = enable, 0 = disable)");
+ module_param_named(vce, radeon_vce, int, 0444);
  static struct pci_device_id pciidlist[] = {
        radeon_PCI_IDS
  };
@@@ -358,7 -369,7 +369,7 @@@ static int radeon_pmops_suspend(struct 
  {
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
-       return radeon_suspend_kms(drm_dev, true, true);
+       return radeon_suspend_kms(drm_dev, true, true, false);
  }
  
  static int radeon_pmops_resume(struct device *dev)
@@@ -372,7 -383,7 +383,7 @@@ static int radeon_pmops_freeze(struct d
  {
        struct pci_dev *pdev = to_pci_dev(dev);
        struct drm_device *drm_dev = pci_get_drvdata(pdev);
-       return radeon_suspend_kms(drm_dev, false, true);
+       return radeon_suspend_kms(drm_dev, false, true, true);
  }
  
  static int radeon_pmops_thaw(struct device *dev)
@@@ -397,7 -408,7 +408,7 @@@ static int radeon_pmops_runtime_suspend
        drm_kms_helper_poll_disable(drm_dev);
        vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF);
  
-       ret = radeon_suspend_kms(drm_dev, false, false);
+       ret = radeon_suspend_kms(drm_dev, false, false, false);
        pci_save_state(pdev);
        pci_disable_device(pdev);
        pci_ignore_hotplug(pdev);
@@@ -525,7 -536,7 +536,7 @@@ static struct drm_driver kms_driver = 
        .irq_uninstall = radeon_driver_irq_uninstall_kms,
        .irq_handler = radeon_driver_irq_handler_kms,
        .ioctls = radeon_ioctls_kms,
 -      .gem_free_object = radeon_gem_object_free,
 +      .gem_free_object_unlocked = radeon_gem_object_free,
        .gem_open_object = radeon_gem_object_open,
        .gem_close_object = radeon_gem_object_close,
        .dumb_create = radeon_mode_dumb_create,
This page took 0.0485 seconds and 5 git commands to generate.