Advertisement
Guest User

Untitled

a guest
Aug 17th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. diff --git a/firmware/target/arm/rk27xx/debug-rk27xx.c b/firmware/target/arm/rk27xx/debug-rk27xx.c
  2. index 5c2d356..994ae78 100644
  3. --- a/firmware/target/arm/rk27xx/debug-rk27xx.c
  4. +++ b/firmware/target/arm/rk27xx/debug-rk27xx.c
  5. @@ -43,6 +43,8 @@
  6. extern unsigned long sd_debug_time_rd;
  7. extern unsigned long sd_debug_time_wr;
  8.  
  9. +extern int updating, update_count, intr_count;
  10. +
  11. bool dbg_hw_info(void)
  12. {
  13. int line;
  14. @@ -65,6 +67,13 @@ bool dbg_hw_info(void)
  15. line++;
  16. _DEBUG_PRINTF("sd_debug_time_rd: %d", sd_debug_time_rd);
  17. _DEBUG_PRINTF("sd_debug_time_wr: %d", sd_debug_time_wr);
  18. +
  19. + _DEBUG_PRINTF("updating: %d", updating);
  20. + _DEBUG_PRINTF("intr_count: %d", intr_count);
  21. + _DEBUG_PRINTF("update_count: %d", update_count);
  22. + _DEBUG_PRINTF("diff: %d", update_count - intr_count);
  23. +
  24. +
  25. lcd_update();
  26. switch(button_get_w_tmo(HZ/20))
  27. {
  28. diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  29. index fd683c4..f1f950f 100644
  30. --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  31. +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
  32. @@ -26,6 +26,18 @@
  33. #include "cpu.h"
  34. #include "lcdif-rk27xx.h"
  35.  
  36. +int updating = 0;
  37. +int intr_count = 0;
  38. +int update_count = 0;
  39. +
  40. +void INT_DWDMA(void)
  41. +{
  42. + DWDMA_CLEAR_TFR |= 1;
  43. +
  44. + updating = 0;
  45. + intr_count++;
  46. +}
  47. +
  48.  
  49. unsigned int lcd_data_transform(unsigned int data)
  50. {
  51. @@ -127,6 +139,8 @@ static void dwdma_init(void)
  52. DWDMA_DMA_CHEN = 0xf00;
  53. DWDMA_CLEAR_BLOCK = 0x0f;
  54. DWDMA_DMA_CFG = 1; /* global enable */
  55. + INTC_IECR |= (1<<25);
  56. + INTC_IMR |= (1<<25);
  57. }
  58.  
  59. /* dwdma linked list struct */
  60. @@ -157,6 +171,7 @@ static void llp_setup(void *src, void *dst, struct llp_t *llp, uint32_t size)
  61. (2<<4) |
  62. (3<<11) |
  63. (3<<14) |
  64. + 1 |
  65. (1<<27) |
  66. (1<<28);
  67. }
  68. @@ -176,6 +191,7 @@ static void dwdma_start(uint8_t ch, struct llp_t *llp, uint8_t handshake)
  69. (1<<23) |
  70. (1<<17) |
  71. (2<<1) |
  72. + 1 |
  73. (2<<4) |
  74. (3<<11) |
  75. (3<<14) |
  76. @@ -187,7 +203,7 @@ static void dwdma_start(uint8_t ch, struct llp_t *llp, uint8_t handshake)
  77. DWDMA_CFG_H(ch) = (handshake<<11)|(1<<2);
  78. DWDMA_SGR(ch) = (13<<20);
  79. DWDMA_DMA_CHEN = (0x101<<ch);
  80. -
  81. + DWDMA_MASK_TFR = (1 << (ch+8)) | (1<<ch);
  82. }
  83.  
  84.  
  85. @@ -200,7 +216,7 @@ void create_llp(void)
  86. llp_setup((void *)FBADDR(0,i), (void*)(&LCD_BUFF+((i%4)*LCD_WIDTH/2)), &(scr_llp[i]), LCD_WIDTH/2);
  87.  
  88. /* this seems to work with 2,3 and 4 dunno why is this */
  89. - llp_end(&scr_llp[LCD_HEIGHT-4]);
  90. + llp_end(&scr_llp[LCD_HEIGHT-1]);
  91. }
  92.  
  93. void lcdif_init(enum lcdif_mode_t mode)
  94. @@ -213,6 +229,7 @@ void lcdif_init(enum lcdif_mode_t mode)
  95.  
  96. void lcd_update()
  97. {
  98. + update_count++;
  99. lcd_set_gram_area(0, 0, LCD_WIDTH, LCD_HEIGHT);
  100. lcdctrl_bypass(0);
  101.  
  102. @@ -223,5 +240,5 @@ void lcd_update()
  103.  
  104. MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
  105.  
  106. - while (DWDMA_CTL_L(0) & (1<<27));
  107. + //while (DWDMA_CTL_L(0) & (1<<27));
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement