Skip to content

Commit

Permalink
drm/radeon/kms/legacy: set common regs to sane value
Browse files Browse the repository at this point in the history
The DDX and radeonfb always set these regs to a sane value.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Alex Deucher authored and Dave Airlie committed Dec 7, 2009
1 parent 6b02af1 commit 92cde00
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/gpu/drm/radeon/r100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,17 @@ int r100_gpu_reset(struct radeon_device *rdev)
return 0;
}

void r100_set_common_regs(struct radeon_device *rdev)
{
/* set these so they don't interfere with anything */
WREG32(RADEON_OV0_SCALE_CNTL, 0);
WREG32(RADEON_SUBPIC_CNTL, 0);
WREG32(RADEON_VIPH_CONTROL, 0);
WREG32(RADEON_I2C_CNTL_1, 0);
WREG32(RADEON_DVI_I2C_CNTL_1, 0);
WREG32(RADEON_CAP0_TRIG_CNTL, 0);
WREG32(RADEON_CAP1_TRIG_CNTL, 0);
}

/*
* VRAM info
Expand Down Expand Up @@ -3129,6 +3140,9 @@ static int r100_startup(struct radeon_device *rdev)
{
int r;

/* set common regs */
r100_set_common_regs(rdev);
/* program mc */
r100_mc_program(rdev);
/* Resume clock */
r100_clock_startup(rdev);
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/r300.c
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,9 @@ static int r300_startup(struct radeon_device *rdev)
{
int r;

/* set common regs */
r100_set_common_regs(rdev);
/* program mc */
r300_mc_program(rdev);
/* Resume clock */
r300_clock_startup(rdev);
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/radeon/r420.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ static int r420_startup(struct radeon_device *rdev)
{
int r;

/* set common regs */
r100_set_common_regs(rdev);
/* program mc */
r300_mc_program(rdev);
/* Resume clock */
r420_clock_resume(rdev);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/radeon.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ extern int r100_cs_packet_parse(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt,
unsigned idx);
extern void r100_enable_bm(struct radeon_device *rdev);
extern void r100_set_common_regs(struct radeon_device *rdev);

/* rv200,rv250,rv280 */
extern void r200_set_safe_registers(struct radeon_device *rdev);
Expand Down

0 comments on commit 92cde00

Please sign in to comment.