drm/amd/powerplay: added new se_cac_idx r/w APIs v2
authorEvan Quan <evan.quan@amd.com>
Tue, 4 Jul 2017 01:21:50 +0000 (09:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jul 2017 15:06:24 +0000 (11:06 -0400)
  - v2: added missing spinlock init

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 56cac98892f1d56a0558749ac761f4f55ebeb67c..1bb1912f863ccd0288c6bf7be77fdd324b1387d7 100644 (file)
@@ -1560,6 +1560,10 @@ struct amdgpu_device {
        spinlock_t gc_cac_idx_lock;
        amdgpu_rreg_t                   gc_cac_rreg;
        amdgpu_wreg_t                   gc_cac_wreg;
+       /* protects concurrent se_cac register access */
+       spinlock_t se_cac_idx_lock;
+       amdgpu_rreg_t                   se_cac_rreg;
+       amdgpu_wreg_t                   se_cac_wreg;
        /* protects concurrent ENDPOINT (audio) register access */
        spinlock_t audio_endpt_idx_lock;
        amdgpu_block_rreg_t             audio_endpt_rreg;
@@ -1747,6 +1751,8 @@ void amdgpu_mm_wdoorbell64(struct amdgpu_device *adev, u32 index, u64 v);
 #define WREG32_DIDT(reg, v) adev->didt_wreg(adev, (reg), (v))
 #define RREG32_GC_CAC(reg) adev->gc_cac_rreg(adev, (reg))
 #define WREG32_GC_CAC(reg, v) adev->gc_cac_wreg(adev, (reg), (v))
+#define RREG32_SE_CAC(reg) adev->se_cac_rreg(adev, (reg))
+#define WREG32_SE_CAC(reg, v) adev->se_cac_wreg(adev, (reg), (v))
 #define RREG32_AUDIO_ENDPT(block, reg) adev->audio_endpt_rreg(adev, (block), (reg))
 #define WREG32_AUDIO_ENDPT(block, reg, v) adev->audio_endpt_wreg(adev, (block), (reg), (v))
 #define WREG32_P(reg, val, mask)                               \
index 8ce522b490c8fb4a305edd4be162921113f1ee65..541695768f0a5ea794e554dea0497b9ec7ced09e 100644 (file)
@@ -2075,6 +2075,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        spin_lock_init(&adev->uvd_ctx_idx_lock);
        spin_lock_init(&adev->didt_idx_lock);
        spin_lock_init(&adev->gc_cac_idx_lock);
+       spin_lock_init(&adev->se_cac_idx_lock);
        spin_lock_init(&adev->audio_endpt_idx_lock);
        spin_lock_init(&adev->mm_stats.lock);