drm/radeon/kms: fix fans after resume
Subsystems (2)
PATCH 1/1 drm/radeon/kms: fix fans after resume
From: Alex Deucher <[email protected]>
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
--- drivers/gpu/drm/radeon/atom.c | 15 ++++++++++++++- drivers/gpu/drm/radeon/atom.h | 1 + 2 files changed, 15 insertions(+), 1 deletions(-)
drivers/gpu/drm/radeon/atom.c +14 -1
@@ -1306,8 +1306,11 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)int atom_asic_init (struct atom_context *ctx) { +struct radeon_device *rdev = ctx->card->dev->dev_private;int hwi =CU16 (ctx->data_table +ATOM_DATA_FWI_PTR );uint32_t ps[16 ]; +int ret; +memset (ps,0 ,64 ); ps[0 ] =cpu_to_le32 (CU32 (hwi +ATOM_FWI_DEFSCLK_PTR ));
@@ -1317,7 +1320,17 @@ int atom_asic_init(struct atom_context *ctx)if (!CU16 (ctx->cmd_table +4 +2 *ATOM_CMD_INIT ))return 1 ; -return atom_execute_table (ctx,ATOM_CMD_INIT , ps); + ret =atom_execute_table (ctx,ATOM_CMD_INIT , ps); +if (ret) +return ret; + +memset (ps,0 ,64 ); + +if (rdev->family <CHIP_R600 ) { +if (CU16 (ctx->cmd_table +4 +2 *ATOM_CMD_SPDFANCNTL )) +atom_execute_table (ctx,ATOM_CMD_SPDFANCNTL , ps); + } +return ret; }void atom_destroy (struct atom_context *ctx)
drivers/gpu/drm/radeon/atom.h +1 -0
@@ -44,6 +44,7 @@#define ATOM_CMD_SETSCLK 0x0A#define ATOM_CMD_SETMCLK 0x0B#define ATOM_CMD_SETPCLK 0x0C +#define ATOM_CMD_SPDFANCNTL 0x39#define ATOM_DATA_FWI_PTR 0xC#define ATOM_DATA_IIO_PTR 0x32
Signature · 1 line
1.7.7.5
Quoted 24 lines · On Don, 2012-03-29 at 19:04 -0400, [email protected] wrote:
From: Alex Deucher <[email protected]>
On pre-R600 asics, the SpeedFanControl table is not executed as part of
ASIC_Initas it is on newer asics.Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29412Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/radeon/atom.c | 15 ++++++++++++++- drivers/gpu/drm/radeon/atom.h | 1 + 2 files changed, 15 insertions(+), 1 deletions(-)drivers/gpu/drm/radeon/atom.c +0
-0@@ -1317,7 +1320,17 @@ int atom_asic_init(struct atom_context *ctx)if (!CU16 (ctx->cmd_table +4 +2 *ATOM_CMD_INIT ))return 1 ;
drivers/gpu/drm/radeon/atom.c int atom_asic_init(struct atom_context *ctx) · line 1331
Quoted 10 lines
drivers/gpu/drm/radeon/atom.c +9
-1-return atom_execute_table (ctx,ATOM_CMD_INIT , ps); + ret =atom_execute_table (ctx,ATOM_CMD_INIT , ps); +if (ret) +return ret; + +memset (ps,0 ,64 ); + +if (rdev->family <CHIP_R600 ) { +if (CU16 (ctx->cmd_table +4 +2 *ATOM_CMD_SPDFANCNTL )) +atom_execute_table (ctx,ATOM_CMD_SPDFANCNTL , ps);
Should the return value of atom_execute_table() be assigned to ret here as well? Either way,
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Debian, X and DRI developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
2012/3/30 Michel Dänzer <[email protected]>:
Quoted 39 lines · On Don, 2012-03-29 at 19:04 -0400, [email protected] wrote:
Quoted 24 lines
From: Alex Deucher <[email protected]>
On pre-R600 asics, the SpeedFanControl table is not executed as part of
ASIC_Initas it is on newer asics.Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=29412Signed-off-by Alex Deucher <[email protected]>---
drivers/gpu/drm/radeon/atom.c | 15 ++++++++++++++-drivers/gpu/drm/radeon/atom.h| 1 +2 files changed, 15 insertions(+), 1 deletions(-)drivers/gpu/drm/radeon/atom.c +0
-0@@ -1317,7 +1320,17 @@ int atom_asic_init(struct atom_context *ctx) if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT)) return 1;drivers/gpu/drm/radeon/atom.c int atom_asic_init(struct atom_context *ctx) · line 1331
Quoted 10 lines
drivers/gpu/drm/radeon/atom.c +9
-1- return atom_execute_table(ctx, ATOM_CMD_INIT, ps); + ret = atom_execute_table(ctx, ATOM_CMD_INIT, ps); + if (ret) + return ret; + + memset(ps, 0, 64); + + if (rdev->family < CHIP_R600) { + if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL)) + atom_execute_table(ctx, ATOM_CMD_SPDFANCNTL, ps);Should the return value of
atom_execute_table()be assigned to ret here as well? Either way,
Quoted 2 lines
Reviewed-by Michel Dänzer <[email protected]>
Yeah, I went back and forth with that. I left it as is since asic_init is the part we care most about in this case.
Alex
Quoted 4 lines
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer