diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-03-29 19:04:08 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-04-02 06:07:42 -0400 |
commit | 402976fe51b2d1a58a29ba06fa1ca5ace3a4cdcd (patch) | |
tree | 2de887cae4ddcaf291562f796231c4feb829ad42 /drivers/gpu | |
parent | d06221c0617ab6d0bc41c4980cefdd9c8cc9a1c1 (diff) |
drm/radeon/kms: fix fans after resume
On pre-R600 asics, the SpeedFanControl table is not
executed as part of ASIC_Init as it is on newer asics.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29412
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/atom.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/atom.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index d1bd239cd9e9..5ce9bf51a8de 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
@@ -1306,8 +1306,11 @@ struct atom_context *atom_parse(struct card_info *card, void *bios) | |||
1306 | 1306 | ||
1307 | int atom_asic_init(struct atom_context *ctx) | 1307 | int atom_asic_init(struct atom_context *ctx) |
1308 | { | 1308 | { |
1309 | struct radeon_device *rdev = ctx->card->dev->dev_private; | ||
1309 | int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR); | 1310 | int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR); |
1310 | uint32_t ps[16]; | 1311 | uint32_t ps[16]; |
1312 | int ret; | ||
1313 | |||
1311 | memset(ps, 0, 64); | 1314 | memset(ps, 0, 64); |
1312 | 1315 | ||
1313 | ps[0] = cpu_to_le32(CU32(hwi + ATOM_FWI_DEFSCLK_PTR)); | 1316 | ps[0] = cpu_to_le32(CU32(hwi + ATOM_FWI_DEFSCLK_PTR)); |
@@ -1317,7 +1320,17 @@ int atom_asic_init(struct atom_context *ctx) | |||
1317 | 1320 | ||
1318 | if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT)) | 1321 | if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT)) |
1319 | return 1; | 1322 | return 1; |
1320 | return atom_execute_table(ctx, ATOM_CMD_INIT, ps); | 1323 | ret = atom_execute_table(ctx, ATOM_CMD_INIT, ps); |
1324 | if (ret) | ||
1325 | return ret; | ||
1326 | |||
1327 | memset(ps, 0, 64); | ||
1328 | |||
1329 | if (rdev->family < CHIP_R600) { | ||
1330 | if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL)) | ||
1331 | atom_execute_table(ctx, ATOM_CMD_SPDFANCNTL, ps); | ||
1332 | } | ||
1333 | return ret; | ||
1321 | } | 1334 | } |
1322 | 1335 | ||
1323 | void atom_destroy(struct atom_context *ctx) | 1336 | void atom_destroy(struct atom_context *ctx) |
diff --git a/drivers/gpu/drm/radeon/atom.h b/drivers/gpu/drm/radeon/atom.h index 93cfe2086ba0..25fea631dad2 100644 --- a/drivers/gpu/drm/radeon/atom.h +++ b/drivers/gpu/drm/radeon/atom.h | |||
@@ -44,6 +44,7 @@ | |||
44 | #define ATOM_CMD_SETSCLK 0x0A | 44 | #define ATOM_CMD_SETSCLK 0x0A |
45 | #define ATOM_CMD_SETMCLK 0x0B | 45 | #define ATOM_CMD_SETMCLK 0x0B |
46 | #define ATOM_CMD_SETPCLK 0x0C | 46 | #define ATOM_CMD_SETPCLK 0x0C |
47 | #define ATOM_CMD_SPDFANCNTL 0x39 | ||
47 | 48 | ||
48 | #define ATOM_DATA_FWI_PTR 0xC | 49 | #define ATOM_DATA_FWI_PTR 0xC |
49 | #define ATOM_DATA_IIO_PTR 0x32 | 50 | #define ATOM_DATA_IIO_PTR 0x32 |