]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
drm/amdgpu/sriov:move in_reset to adev and rename
authorMonk Liu <Monk.Liu@amd.com>
Fri, 15 Sep 2017 10:57:12 +0000 (18:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 19:14:08 +0000 (15:14 -0400)
currently in_reset is only used in sriov gpu reset, and it
will be used for other non-gfx hw component later, like
PSP, so move it from gfx to adev and rename to in_sriov_reset
make more sense.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@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
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index ac026f5f56fb262f03bff5cbe007a2d43219191d..33e1d619d060a270d6bf2bea3833821aad9eff29 100644 (file)
@@ -1018,7 +1018,6 @@ struct amdgpu_gfx {
        /* reset mask */
        uint32_t                        grbm_soft_reset;
        uint32_t                        srbm_soft_reset;
-       bool                            in_reset;
        /* s3/s4 mask */
        bool                            in_suspend;
        /* NGG */
@@ -1583,6 +1582,7 @@ struct amdgpu_device {
 
        /* record last mm index being written through WREG32*/
        unsigned long last_mm_index;
+       bool                            in_sriov_reset;
 };
 
 static inline struct amdgpu_device *amdgpu_ttm_adev(struct ttm_bo_device *bdev)
index 36979e1d7b5f00a97495bc80db28f411f403f1d5..506a26793ce6e884503c63e30a7e6ae42004ab39 100644 (file)
@@ -2690,7 +2690,7 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job)
 
        mutex_lock(&adev->virt.lock_reset);
        atomic_inc(&adev->gpu_reset_counter);
-       adev->gfx.in_reset = true;
+       adev->in_sriov_reset = true;
 
        /* block TTM */
        resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
@@ -2801,7 +2801,7 @@ give_up_reset:
                dev_info(adev->dev, "GPU reset successed!\n");
        }
 
-       adev->gfx.in_reset = false;
+       adev->in_sriov_reset = false;
        mutex_unlock(&adev->virt.lock_reset);
        return r;
 }
index 666a1545e949a2f658004c8a3511ac64bd31af59..fe603cc2c4a9bfe1a6a31a5293518628dcdd7cde 100644 (file)
@@ -4811,7 +4811,7 @@ static int gfx_v8_0_kiq_init_queue(struct amdgpu_ring *ring)
 
        gfx_v8_0_kiq_setting(ring);
 
-       if (adev->gfx.in_reset) { /* for GPU_RESET case */
+       if (adev->in_sriov_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct vi_mqd_allocation));
@@ -4848,7 +4848,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)
        struct vi_mqd *mqd = ring->mqd_ptr;
        int mqd_idx = ring - &adev->gfx.compute_ring[0];
 
-       if (!adev->gfx.in_reset && !adev->gfx.in_suspend) {
+       if (!adev->in_sriov_reset && !adev->gfx.in_suspend) {
                memset((void *)mqd, 0, sizeof(struct vi_mqd_allocation));
                ((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
                ((struct vi_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
@@ -4860,7 +4860,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)
 
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(struct vi_mqd_allocation));
-       } else if (adev->gfx.in_reset) { /* for GPU_RESET case */
+       } else if (adev->in_sriov_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct vi_mqd_allocation));
index 72dbf890c65b6d022972b9abd78ec67e3263d4db..ecb9674bc8031a6276207fda3dd5a32dcc1cfbed 100644 (file)
@@ -2698,7 +2698,7 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring *ring)
 
        gfx_v9_0_kiq_setting(ring);
 
-       if (adev->gfx.in_reset) { /* for GPU_RESET case */
+       if (adev->in_sriov_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct v9_mqd_allocation));
@@ -2736,7 +2736,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)
        struct v9_mqd *mqd = ring->mqd_ptr;
        int mqd_idx = ring - &adev->gfx.compute_ring[0];
 
-       if (!adev->gfx.in_reset && !adev->gfx.in_suspend) {
+       if (!adev->in_sriov_reset && !adev->gfx.in_suspend) {
                memset((void *)mqd, 0, sizeof(struct v9_mqd_allocation));
                ((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
                ((struct v9_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
@@ -2748,7 +2748,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)
 
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(struct v9_mqd_allocation));
-       } else if (adev->gfx.in_reset) { /* for GPU_RESET case */
+       } else if (adev->in_sriov_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct v9_mqd_allocation));