diff options
author | Dave Airlie <airlied@redhat.com> | 2009-10-15 13:04:39 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-10-15 13:04:39 +1000 |
commit | 779d3f06431eadaad8a1805f7942266d63fc74a0 (patch) | |
tree | 74af5ec5eb83288d89d708247ed0cb7108ef274c | |
parent | 5b9e40dca5c3ca5e3e97e7b848e6bcf49aec7281 (diff) |
radeon: fix clock cntl read/write + add tmds
-rw-r--r-- | radeontool.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/radeontool.c b/radeontool.c index 7db461d..51406fb 100644 --- a/radeontool.c +++ b/radeontool.c @@ -86,9 +86,17 @@ static void radeon_set(unsigned long offset, const char *name, unsigned int valu static unsigned int radeon_get_indexed(unsigned long index_offset, unsigned long data_offset, - unsigned long offset, const char *name) + unsigned long offset, + const char *name, + unsigned long index_mask) { - radeon_set(index_offset, "index", offset); + unsigned int temp = offset; + if (index_mask) { + temp = radeon_get(index_offset, "index"); + temp &= ~index_mask; + temp += offset; + } + radeon_set(index_offset, "index", temp); return radeon_get(data_offset, name); } @@ -104,7 +112,7 @@ static unsigned int radeon_get_clk(unsigned long offset, const char *name) { return radeon_get_indexed(RADEON_CLOCK_CNTL_INDEX, RADEON_CLOCK_CNTL_DATA, - offset, name); + offset, name, 0x3f); } static void radeon_set_clk(unsigned long offset, const char *name, @@ -133,7 +141,7 @@ static void usage(void) void radeon_cmd_regs(void) { #define SHOW_REG(r) printf("%s\t%08x\n", #r, radeon_get(r, #r)) -#define SHOW_CLK_REG(r) printf("%s\t%08x\n", #r, radeon_get_indexed(RADEON_CLOCK_CNTL_INDEX, RADEON_CLOCK_CNTL_DATA, (r), #r)) +#define SHOW_CLK_REG(r) printf("%s\t%08x\n", #r, radeon_get_indexed(RADEON_CLOCK_CNTL_INDEX, RADEON_CLOCK_CNTL_DATA, (r), #r, 0x3f)) SHOW_REG(RADEON_DAC_CNTL); SHOW_REG(RADEON_DAC_EXT_CNTL); SHOW_REG(RADEON_DAC_MACRO_CNTL); @@ -158,6 +166,8 @@ void radeon_cmd_regs(void) SHOW_REG(RADEON_FP2_GEN_CNTL); SHOW_CLK_REG(RADEON_PIXCLKS_CNTL); SHOW_REG(RADEON_MEM_TIMING_CNTL); + SHOW_REG(RADEON_TMDS_PLL_CNTL); + SHOW_REG(RADEON_TMDS_TRANSMITTER_CNTL); } #define REGLIST(r) { "", #r, radeon_get, radeon_set, RADEON_ ## r } |