lib: detect PCH_LPT and PCH_NONE
PATCH 1/6 lib: detect PCH_LPT and PCH_NONE
From: Paulo Zanoni <[email protected]>
So we don't assign PCH_IBX to anything that's not PCH_CPT nor PCH_LPT.
--- lib/intel_gpu_tools.h | 4 ++++ lib/intel_pci.c | 21 ++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-)
lib/intel_gpu_tools.h +4 -0
@@ -92,13 +92,17 @@ uint64_t intel_get_total_swap_mb(void);void intel_map_file (char *);enum pch_type { +PCH_NONE ,PCH_IBX ,PCH_CPT , +PCH_LPT , };extern enum pch_type pch;void intel_check_pch (void ); +#define HAS_IBX (pch == PCH_IBX)#define HAS_CPT (pch == PCH_CPT) +#define HAS_LPT (pch == PCH_LPT)#endif /* INTEL_GPU_TOOLS_H */
lib/intel_pci.c +18 -3
@@ -100,9 +100,24 @@ intel_check_pch(void)if (pch_dev ==NULL )return ; -if (pch_dev->vendor_id ==0x8086 && - (((pch_dev->device_id &0xff00 ) ==0x1c00 ) || - (pch_dev->device_id &0xff00 ) ==0x1e00 )) +if (pch_dev->vendor_id !=0x8086 ) +return ; + +switch (pch_dev->device_id &0xff00 ) { +case 0x3b00 : + pch =PCH_IBX ; +break ; +case 0x1c00 : +case 0x1e00 : pch =PCH_CPT ; +break ; +case 0x8c00 : +case 0x9c00 : + pch =PCH_LPT ; +break ; +default : + pch =PCH_NONE ; +return ; + } }
Signature · 1 line
1.7.10.4
PATCH 2/6 intel_reg_dumper: recognize LPT
From: Paulo Zanoni <[email protected]>
--- tools/intel_reg_dumper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/intel_reg_dumper.c +5 -1
@@ -2326,8 +2326,12 @@ int main(int argc, char** argv)if (devid) {if (IS_GEN5 (devid)) pch =PCH_IBX ; -else +else if (IS_GEN6 (devid) ||IS_IVYBRIDGE (devid)) pch =PCH_CPT ; +else if (IS_HASWELL (devid)) + pch =PCH_LPT ; +else + pch =PCH_NONE ; }else {printf ("Dumping from file without -d argument. " "Assuming Ironlake machine.\n" );
Signature · 1 line
1.7.10.4
Re: [PATCH IGT 2/6] intel_reg_dumper: recognize LPT
Quoted 12 lines · Paulo Zanoni
From: Paulo Zanoni <[email protected]>
Signed-off-by Paulo Zanoni <[email protected]>--- tools/intel_reg_dumper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)tools/intel_reg_dumper.c +0
-0
tools/intel_reg_dumper.c int main(int argc, char** argv) · line 2334
Quoted 10 lines
tools/intel_reg_dumper.c +5
-1@@ -2326,8 +2326,12 @@ int main(int argc, char** argv)if (devid) {if (IS_GEN5 (devid)) pch =PCH_IBX ; -else +else if (IS_GEN6 (devid) ||IS_IVYBRIDGE (devid)) pch =PCH_CPT ; +else if (IS_HASWELL (devid)) + pch =PCH_LPT ; +else + pch =PCH_NONE ;
In patch 6/6 you're fixing the PCH detection code in lib/ maybe it'd be a good idea to use it to detect the PCH of having heuristics on device 2 -> PCH mappings?
Signature · 1 line
Damien
Re: [PATCH IGT 2/6] intel_reg_dumper: recognize LPT
Hi
2013/3/5 Damien Lespiau <[email protected]>:
Quoted 19 lines · Paulo Zanoni
Quoted 18 lines
From: Paulo Zanoni <[email protected]>
Signed-off-by Paulo Zanoni <[email protected]>--- tools/intel_reg_dumper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)tools/intel_reg_dumper.c +1
-1@@ -2326,8 +2326,12 @@ int main(int argc, char** argv)if (devid) {if (IS_GEN5 (devid)) pch =PCH_IBX ; -else +else if (IS_GEN6 (devid) ||IS_IVYBRIDGE (devid)) pch =PCH_CPT ;
Quoted 8 lines
tools/intel_reg_dumper.c int main(int argc, char** argv) · line 2334
Quoted 4 lines
tools/intel_reg_dumper.c +4
-0+else if (IS_HASWELL (devid)) + pch =PCH_LPT ; +else + pch =PCH_NONE ;In patch 6/6 you're fixing the PCH detection code in
lib/maybe it'd be a good idea to use it to detect the PCH of having heuristics on device 2 -> PCH mappings?
Do you mean 1/6? We can't use intel_check_pch() here because we're using the "file" and "devid" options: we're dumping registers from a file, not from real hardware. So sometimes you create the file on one machine (e.g., IVB) and dump on another (e.g. ILK).
Quoted 3 lines
--
Damien
Signature · 1 line
Paulo Zanoni
Re: [PATCH IGT 2/6] intel_reg_dumper: recognize LPT
Quoted 31 lines · Paulo Zanoni
Hi
2013/3/5 Damien Lespiau <[email protected]>:
Quoted 19 lines · Paulo Zanoni
Quoted 18 lines
From: Paulo Zanoni <[email protected]>
Signed-off-by Paulo Zanoni <[email protected]>--- tools/intel_reg_dumper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)tools/intel_reg_dumper.c +1
-1@@ -2326,8 +2326,12 @@ int main(int argc, char** argv)if (devid) {if (IS_GEN5 (devid)) pch =PCH_IBX ; -else +else if (IS_GEN6 (devid) ||IS_IVYBRIDGE (devid)) pch =PCH_CPT ;Quoted 8 lines
tools/intel_reg_dumper.c int main(int argc, char** argv) · line 2334
Quoted 4 lines
tools/intel_reg_dumper.c +4
-0+else if (IS_HASWELL (devid)) + pch =PCH_LPT ; +else + pch =PCH_NONE ;In patch 6/6 you're fixing the PCH detection code in
lib/maybe it'd be a good idea to use it to detect the PCH of having heuristics on device 2 -> PCH mappings?
Quoted 4 lines
Do you mean 1/6? We can't use
intel_check_pch()here because we're using the "file" and "devid" options: we're dumping registers from a file, not from real hardware. So sometimes you create the file on one machine (e.g., IVB) and dump on another (e.g. ILK).
Ah, of course, not enough context for that to be obvious :) For that I guess I get to review the rest of the patches.
Signature · 1 line
Damien
PATCH 3/6 intel_reg_dumper: make Haswell dump useful
In reply to Paulo ZanoniFrom: Paulo Zanoni <[email protected]>
It was previously printing ironlake_debug_regs and haswell_debug_regs. Since ironlake_debug_regs contains a lot of registers that don't exist on Haswell, running intel_reg_dumper on Haswell caused "unclaimed register" messages. Now I've copied the existing registers from ironlake_debug_regs to haswell_debug_regs, so we won't print the registers that don't exist anymore.
Also removed DP_TP_STATUS_A since it doesn't exist.
--- lib/intel_reg.h | 16 ++++++ tools/intel_reg_dumper.c | 131 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 140 insertions(+), 7 deletions(-)
lib/intel_reg.h +16 -0
@@ -1106,6 +1106,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#define BCLRPAT_C 0x62020#define VSYNCSHIFT_C 0x62028 +#define HTOTAL_EDP 0x6F000 +#define HBLANK_EDP 0x6F004 +#define HSYNC_EDP 0x6F008 +#define VTOTAL_EDP 0x6F00c +#define VBLANK_EDP 0x6F010 +#define VSYNC_EDP 0x6F014 +#define VSYNCSHIFT_EDP 0x6F028 +#define PP_STATUS 0x61200# define PP_ON (1 << 31)/**
@@ -2541,6 +2549,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.#define PIPEC_DP_LINK_M 0x72060#define PIPEC_DP_LINK_N 0x72064 +#define PIPEEDPCONF 0x7F008 +#define DSPACNTR 0x70180#define DSPBCNTR 0x71180#define DSPCCNTR 0x72180
@@ -3031,6 +3041,12 @@ typedef enum {#define PIPEC_LINK_M2 0x62048#define PIPEC_LINK_N2 0x6204c +#define PIPEEDP_DATA_M1 0x6F030 +#define PIPEEDP_DATA_N1 0x6F034 + +#define PIPEEDP_LINK_M1 0x6F040 +#define PIPEEDP_LINK_N1 0x6F044 +/* PIPECONF for pipe A/B addr is same */ /* cusor A is only connected to pipe A,
tools/intel_reg_dumper.c +124 -7
161 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 4/6 intel_reg_dumper: decode some useful Haswell registers
In reply to Paulo ZanoniFrom: Paulo Zanoni <[email protected]>
I've checked the value of these registers many many many times during development.
--- tools/intel_reg_dumper.c | 248 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 230 insertions(+), 18 deletions(-)
tools/intel_reg_dumper.c +230 -18
@@ -1571,6 +1571,218 @@ DEBUGSTRING(ilk_debug_pp_control) (val & (1 << 0)) ? "on" : "off"); } +DEBUGSTRING (hsw_debug_port_clk_sel) +{ +const char *clock; + +switch ((val >>29 ) &7 ) { +case 0 : + clock ="LCPLL 2700" ; +break ; +case 1 : + clock ="LCPLL 1350" ; +break ; +case 2 : + clock ="LCPLL 810" ; +break ; +case 3 : + clock ="SPLL" ; +break ; +case 4 : + clock ="WRPLL 1" ; +break ; +case 5 : + clock ="WRPLL 2" ; +break ; +case 6 : + clock ="Reserved" ; +break ; +case 7 : + clock ="None" ; +break ; + } + +snprintf (result, len,"%s" , clock); +} + +DEBUGSTRING (hsw_debug_pipe_clk_sel) +{ +const char *clock; + +switch ((val >>29 ) &7 ) { +case 0 : + clock ="None" ; +break ; +case 2 : + clock ="DDIB" ; +break ; +case 3 : + clock ="DDIC" ; +break ; +case 4 : + clock ="DDID" ; +break ; +case 5 : + clock ="DDIE" ; +break ; +default : + clock ="Reserved" ; +break ; + } + +snprintf (result, len,"%s" , clock); +} + +DEBUGSTRING (hsw_debug_ddi_buf_ctl) +{ +const char *enable, *reversal, *width, *detected; + + enable = (val & (1 <<31 )) ?"enabled" :"disabled" ; + reversal = (val & (1 <<16 )) ?"reversed" :"not reversed" ; + +switch ((val >>1 ) &7 ) { +case 0 : + width ="x1" ; +break ; +case 1 : + width ="x2" ; +break ; +case 3 : + width ="x4" ; +break ; +default : + width ="reserved" ; +break ; + } + + detected = (val &1 ) ?"detected" :"not detected" ; + +snprintf (result, len,"%s %s %s %s" , enable, reversal, width, detected); +} + +DEBUGSTRING (hsw_debug_sfuse_strap) +{ +const char *display, *crt, *lane_reversal, *portb, *portc, *portd; + + display = (val & (1 <<7 )) ?"disabled" :"enabled" ; + crt = (val & (1 <<6 )) ?"yes" :"no" ; + lane_reversal = (val & (1 <<4 )) ?"yes" :"no" ; + portb = (val & (1 <<2 )) ?"yes" :"no" ; + portc = (val & (1 <<1 )) ?"yes" :"no" ; + portd = (val & (1 <<0 )) ?"yes" :"no" ; + +snprintf (result, len,"display %s, crt %s, lane reversal %s, " +"port b %s, port c %s, port d %s" , display, crt, lane_reversal, + portb, portc, portd); +} + +DEBUGSTRING (hsw_debug_pipe_ddi_func_ctl) +{ +const char *enable, *port, *mode, *bpc, *vsync, *hsync, *edp_input; +const char *width; + + enable = (val & (1 <<31 )) ?"enabled" :"disabled" ; + +switch ((val >>28 ) &7 ) { +case 0 : + port ="no port" ; +break ; +case 1 : + port ="DDIB" ; +break ; +case 2 : + port ="DDIC" ; +break ; +case 3 : + port ="DDID" ; +break ; +case 4 : + port ="DDIE" ; +break ; +default : + port ="port reserved" ; +break ; + } + +switch ((val >>24 ) &7 ) { +case 0 : + mode ="HDMI" ; +break ; +case 1 : + mode ="DVI" ; +break ; +case 2 : + mode ="DP SST" ; +break ; +case 3 : + mode ="DP MST" ; +break ; +case 4 : + mode ="FDI" ; +break ; +case 5 : + mode ="mode reserved" ; +break ; + } + +switch ((val >>20 ) &7 ) { +case 0 : + bpc ="8 bpc" ; +break ; +case 1 : + bpc ="10 bpc" ; +break ; +case 2 : + bpc ="6 bpc" ; +break ; +case 3 : + bpc ="12 bpc" ; +break ; +default : + bpc ="bpc reserved" ; +break ; + } + + hsync = (val & (1 <<16 )) ?"+HSync" :"-HSync" ; + vsync = (val & (1 <<17 )) ?"+VSync" :"-VSync" ; + +switch ((val >>12 ) &7 ) { +case 0 : + edp_input ="EDP A ON" ; +break ; +case 4 : + edp_input ="EDP A ONOFF" ; +break ; +case 5 : + edp_input ="EDP B ONOFF" ; +break ; +case 6 : + edp_input ="EDP C ONOFF" ; +break ; +default : + edp_input ="EDP input reserved" ; +break ; + } + +switch ((val >>1 ) &7 ) { +case 0 : + width ="x1" ; +break ; +case 1 : + width ="x2" ; +break ; +case 3 : + width ="x4" ; +break ; +default : + width ="reserved width" ; +break ; + } + +snprintf (result, len,"%s, %s, %s, %s, %s, %s, %s, %s" , enable, + port, mode, bpc, vsync, hsync, edp_input, width); +} +static struct reg_debug ironlake_debug_regs[] = {DEFINEREG (PGETBL_CTL ),DEFINEREG (GEN6_INSTDONE_1 ),
@@ -1846,10 +2058,10 @@ static struct reg_debug haswell_debug_regs[] = {DEFINEREG (HSW_PWR_WELL_CTL6 ),/* DDI pipe function */ -DEFINEREG (PIPE_DDI_FUNC_CTL_A ), -DEFINEREG (PIPE_DDI_FUNC_CTL_B ), -DEFINEREG (PIPE_DDI_FUNC_CTL_C ), -DEFINEREG (PIPE_DDI_FUNC_CTL_EDP ), +DEFINEREG2 (PIPE_DDI_FUNC_CTL_A , hsw_debug_pipe_ddi_func_ctl), +DEFINEREG2 (PIPE_DDI_FUNC_CTL_B , hsw_debug_pipe_ddi_func_ctl), +DEFINEREG2 (PIPE_DDI_FUNC_CTL_C , hsw_debug_pipe_ddi_func_ctl), +DEFINEREG2 (PIPE_DDI_FUNC_CTL_EDP , hsw_debug_pipe_ddi_func_ctl),/* DP transport control */ DEFINEREG(DP_TP_CTL_A),
@@ -1865,11 +2077,11 @@ static struct reg_debug haswell_debug_regs[] = {DEFINEREG (DP_TP_STATUS_E ),/* DDI buffer control */ -DEFINEREG (DDI_BUF_CTL_A ), -DEFINEREG (DDI_BUF_CTL_B ), -DEFINEREG (DDI_BUF_CTL_C ), -DEFINEREG (DDI_BUF_CTL_D ), -DEFINEREG (DDI_BUF_CTL_E ), +DEFINEREG2 (DDI_BUF_CTL_A , hsw_debug_ddi_buf_ctl), +DEFINEREG2 (DDI_BUF_CTL_B , hsw_debug_ddi_buf_ctl), +DEFINEREG2 (DDI_BUF_CTL_C , hsw_debug_ddi_buf_ctl), +DEFINEREG2 (DDI_BUF_CTL_D , hsw_debug_ddi_buf_ctl), +DEFINEREG2 (DDI_BUF_CTL_E , hsw_debug_ddi_buf_ctl),/* Clocks */ DEFINEREG(SPLL_CTL),
@@ -1878,16 +2090,16 @@ static struct reg_debug haswell_debug_regs[] = {DEFINEREG (WRPLL_CTL2 ),/* DDI port clock control */ -DEFINEREG (PORT_CLK_SEL_A ), -DEFINEREG (PORT_CLK_SEL_B ), -DEFINEREG (PORT_CLK_SEL_C ), -DEFINEREG (PORT_CLK_SEL_D ), -DEFINEREG (PORT_CLK_SEL_E ), +DEFINEREG2 (PORT_CLK_SEL_A , hsw_debug_port_clk_sel), +DEFINEREG2 (PORT_CLK_SEL_B , hsw_debug_port_clk_sel), +DEFINEREG2 (PORT_CLK_SEL_C , hsw_debug_port_clk_sel), +DEFINEREG2 (PORT_CLK_SEL_D , hsw_debug_port_clk_sel), +DEFINEREG2 (PORT_CLK_SEL_E , hsw_debug_port_clk_sel),/* Pipe clock control */ -DEFINEREG (PIPE_CLK_SEL_A ), -DEFINEREG (PIPE_CLK_SEL_B ), -DEFINEREG (PIPE_CLK_SEL_C ), +DEFINEREG2 (PIPE_CLK_SEL_A , hsw_debug_pipe_clk_sel), +DEFINEREG2 (PIPE_CLK_SEL_B , hsw_debug_pipe_clk_sel), +DEFINEREG2 (PIPE_CLK_SEL_C , hsw_debug_pipe_clk_sel),/* Pipe line time */ DEFINEREG(PIPE_WM_LINETIME_A),
@@ -1895,7 +2107,7 @@ static struct reg_debug haswell_debug_regs[] = {DEFINEREG (PIPE_WM_LINETIME_C ),/* Fuses */ -DEFINEREG (SFUSE_STRAP ), +DEFINEREG2 (SFUSE_STRAP , hsw_debug_sfuse_strap),/* Pipe A */ DEFINEREG2(PIPEASRC, i830_debug_yxminus1),
Signature · 1 line
1.7.10.4
PATCH 5/6 intel_reg_dumper: dump HSW watermark registers
In reply to Paulo ZanoniFrom: Paulo Zanoni <[email protected]>
--- lib/intel_reg.h | 12 ++++++++++++ tools/intel_reg_dumper.c | 26 +++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-)
lib/intel_reg.h +12 -0
@@ -3752,6 +3752,18 @@ typedef enum {#define LCPLL_CD2X_CLOCK_DISABLE (1<<23)/* Pipe WM_LINETIME - watermark line time */ +#define WM_PIPE_A 0x45100 +#define WM_PIPE_B 0x45104 +#define WM_PIPE_C 0x45200 +#define WM_LP1 0x45108 +#define WM_LP2 0x4510C +#define WM_LP3 0x45110 +#define WM_LP1_SPR 0x45120 +#define WM_LP2_SPR 0x45124 +#define WM_LP3_SPR 0x45128 +#define WM_MISC 0x45260 +#define WM_SR_CNT 0x45264 +#define WM_DBG 0x45270#define PIPE_WM_LINETIME_A 0x45270#define PIPE_WM_LINETIME_B 0x45274#define PIPE_WM_LINETIME_C 0x45278
tools/intel_reg_dumper.c +25 -1
@@ -1783,6 +1783,18 @@ DEBUGSTRING(hsw_debug_pipe_ddi_func_ctl) port, mode, bpc, vsync, hsync, edp_input, width); } +DEBUGSTRING (hsw_debug_wm_pipe) +{ +uint32_t primary, sprite, cursor; + + primary = (val >>16 ) &0x7F ; + sprite = (val >>8 ) &0x7F ; + cursor = val &0x3F ; + +snprintf (result, len,"primary %d, sprite %d, pipe %d" , primary, + sprite, cursor); +} +static struct reg_debug ironlake_debug_regs[] = {DEFINEREG (PGETBL_CTL ),DEFINEREG (GEN6_INSTDONE_1 ),
@@ -2101,10 +2113,22 @@ static struct reg_debug haswell_debug_regs[] = {DEFINEREG2 (PIPE_CLK_SEL_B , hsw_debug_pipe_clk_sel),DEFINEREG2 (PIPE_CLK_SEL_C , hsw_debug_pipe_clk_sel), -/* Pipe line time */ +/* Watermarks */ +DEFINEREG2 (WM_PIPE_A , hsw_debug_wm_pipe), +DEFINEREG2 (WM_PIPE_B , hsw_debug_wm_pipe), +DEFINEREG2 (WM_PIPE_C , hsw_debug_wm_pipe), +DEFINEREG (WM_LP1 ), +DEFINEREG (WM_LP2 ), +DEFINEREG (WM_LP3 ), +DEFINEREG (WM_LP1_SPR ), +DEFINEREG (WM_LP2_SPR ), +DEFINEREG (WM_LP3_SPR ), +DEFINEREG (WM_MISC ), +DEFINEREG (WM_SR_CNT ),DEFINEREG (PIPE_WM_LINETIME_A ),DEFINEREG (PIPE_WM_LINETIME_B ),DEFINEREG (PIPE_WM_LINETIME_C ), +DEFINEREG (WM_DBG ),/* Fuses */ DEFINEREG2(SFUSE_STRAP, hsw_debug_sfuse_strap),
Signature · 1 line
1.7.10.4
PATCH 6/6 lib: fix HAS_PCH_SPLIT check
In reply to Paulo ZanoniFrom: Paulo Zanoni <[email protected]>
So HAS_PCH_SPLIT on't be true on VLV.
--- lib/intel_chipset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/intel_chipset.h +1 -1
@@ -261,7 +261,7 @@#define HAS_PCH_SPLIT (devid) (IS_GEN5(devid) || \ IS_GEN6(devid) || \ - IS_GEN7(devid)) + IS_IVYBRIDGE(devid) || IS_HASWELL(devid))#define HAS_BLT_RING (devid) (IS_GEN6(devid) || \ IS_GEN7(devid))
Signature · 1 line
1.7.10.4