drm/amdgpu: update golden setting programming logic
authorHawking Zhang <Hawking.Zhang@amd.com>
Fri, 8 Jun 2018 10:10:57 +0000 (18:10 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:24 +0000 (18:59 -0500)
Since from soc15, make sure only AndMasked bit get changed
when applied or_mask

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Le Ma <Le.Ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/soc15.c

index a70d0a44bdd2c96bc98a1a46d7c24487cb98da7b..16fd5da3bb1297002a6d40e7d0d02b7665bc4a51 100644 (file)
@@ -509,7 +509,10 @@ void amdgpu_device_program_register_sequence(struct amdgpu_device *adev,
                } else {
                        tmp = RREG32(reg);
                        tmp &= ~and_mask;
-                       tmp |= or_mask;
+                       if (adev->family >= AMDGPU_FAMILY_AI)
+                               tmp |= (or_mask & and_mask);
+                       else
+                               tmp |= or_mask;
                }
                WREG32(reg, tmp);
        }
index 4eb615d6dc8420e6092467d8ba93f43253e84e8b..fa9c27d63504cf05629072dc1f1ef6d84dd30ccb 100644 (file)
@@ -378,7 +378,7 @@ void soc15_program_register_sequence(struct amdgpu_device *adev,
                } else {
                        tmp = RREG32(reg);
                        tmp &= ~(entry->and_mask);
-                       tmp |= entry->or_mask;
+                       tmp |= (entry->or_mask & entry->and_mask);
                }
 
                if (reg == SOC15_REG_OFFSET(GC, 0, mmPA_SC_BINNER_EVENT_CNTL_3) ||