diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-23 12:27:46 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-01-03 15:27:03 +0000 |
commit | 0cd009d9d0c56f473ae5a6234916800aa708bb36 (patch) | |
tree | c84c498baf41d3f3bc4a20e5f2b1c28c508706bf | |
parent | ca06600afdc8b8b28a1c06edb74dc59e1cad76aa (diff) |
avivotool: dump enabled HDMI blocks on Evergreen
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | avivotool.c | 22 | ||||
-rw-r--r-- | radeon_reg.h | 12 |
2 files changed, 32 insertions, 2 deletions
diff --git a/avivotool.c b/avivotool.c index f853090..5db6371 100644 --- a/avivotool.c +++ b/avivotool.c @@ -934,14 +934,15 @@ static uint32_t eg_offsets[] = { EVERGREEN_CRTC0_REGISTER_OFFSET, EVERGREEN_CRTC #define EG_NUM_OFFSETS (sizeof(eg_offsets) / sizeof(eg_offsets[0])) -#define EG_GET_MODE_REG(index, reg) GET_REG((reg) + eg_offsets[(index)]) +#define EG_MODE_REG_OFFSET(index, reg) ((reg) + eg_offsets[(index)]) +#define EG_GET_MODE_REG(index, reg) GET_REG(EG_MODE_REG_OFFSET(index, reg)) void eg_cmd_regs(const char *type) { int show_all = (strcmp(type, "all") == 0); int show_mc = (show_all || strstr(type, "mc")); int show_hdmi = (show_all || strstr(type, "hdmi")); int show_grphs = 0; - int i; + int i, j; uint32_t tmp, tmp1; char tmpname[10]; @@ -1099,6 +1100,23 @@ void eg_cmd_regs(const char *type) SHOW_REG(EVERGREEN_AUDIO_RATE_BPS_CHANNEL); SHOW_REG(EVERGREEN_AUDIO_PLAYING); SHOW_REG(EVERGREEN_AUDIO_CAT_STATUS); + + for (i = 0; i < EG_NUM_OFFSETS; i++) { + tmp = EG_GET_MODE_REG(i, EVERGREEN_DIG_CNTL); + if (!(tmp & 0x01000100)) /* Encoder not enabled */ + continue; + tmp1 = (tmp & EVERGREEN_DIG_CNTL_ENC_MODE_MASK) >> + EVERGREEN_DIG_CNTL_ENC_MODE_SHIFT; + if (tmp1 != EVERGREEN_DIG_CNTL_ENC_MODE_DP && + tmp1 != EVERGREEN_DIG_CNTL_ENC_MODE_HDMI) + continue; + + printf("\nHDMI block %d:\n", i); + for (j = 0; j < 0xf0; j += 4) { + tmp1 = EG_GET_MODE_REG(i, EVERGREEN_HDMI_BASE + j); + printf("%08lx\t%08x (%d)\n", EG_MODE_REG_OFFSET(i, EVERGREEN_HDMI_BASE + j), tmp1, tmp1); + } + } } } diff --git a/radeon_reg.h b/radeon_reg.h index 84c0f0b..f84c091 100644 --- a/radeon_reg.h +++ b/radeon_reg.h @@ -3124,6 +3124,18 @@ /* CRTC blocks at 0x6df0, 0x79f0, 0x105f0, 0x111f0, 0x11df0, 0x129f0 */ #define EVERGREEN_CRTC_CONTROL 0x6e70 +#define EVERGREEN_DIG_CNTL 0x7000 +# define EVERGREEN_DIG_CNTL_ENC_MODE_MASK 0x7000 +# define EVERGREEN_DIG_CNTL_ENC_MODE_SHIFT 12 +# define EVERGREEN_DIG_CNTL_ENC_MODE_DP 0 +# define EVERGREEN_DIG_CNTL_ENC_MODE_LVDS 1 +# define EVERGREEN_DIG_CNTL_ENC_MODE_DVI 2 +# define EVERGREEN_DIG_CNTL_ENC_MODE_HDMI 3 +# define EVERGREEN_DIG_CNTL_ENC_MODE_SDVO 4 + +/* HDMI blocks at 0x7030, 0x7c30, 0x10830, 0x11430, 0x12030, 0x12c30 */ +#define EVERGREEN_HDMI_BASE 0x7030 + /* from ROM tables, EG DAC1 is at 0x66b0 and DAC2 at 0x6790 */ #define EVERGREEN_DACA_BASE 0x6690 #define EVERGREEN_DACB_BASE 0x6790 |