drm/amd/powerplay: Adjust the position of data size initial
authorXiangliang Yu <Xiangliang.Yu@amd.com>
Fri, 2 Dec 2016 03:21:28 +0000 (11:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Dec 2016 23:08:36 +0000 (18:08 -0500)
Put the initial part close to memory allocate, it will make code
more clear.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c

index 07549118991380aff5d7585a4874785c5a6aa665..f49b5487b951161cb488ab159092c172e4bfa72f 100644 (file)
@@ -549,7 +549,6 @@ int smu7_init(struct pp_smumgr *smumgr)
        smu_data = (struct smu7_smumgr *)(smumgr->backend);
        smu_data->header_buffer.data_size =
                        ((sizeof(struct SMU_DRAMData_TOC) / 4096) + 1) * 4096;
-       smu_data->smu_buffer.data_size = 200*4096;
 
 /* Allocate FW image data structure and header buffer and
  * send the header buffer address to SMU */
@@ -575,6 +574,7 @@ int smu7_init(struct pp_smumgr *smumgr)
        if (cgs_is_virtualization_enabled(smumgr->device))
                return 0;
 
+       smu_data->smu_buffer.data_size = 200*4096;
        smu_allocate_memory(smumgr->device,
                smu_data->smu_buffer.data_size,
                CGS_GPU_MEM_TYPE__VISIBLE_CONTIG_FB,