static void dump_lcd_layer_info(void) { #ifndef MT65XX_NEW_DISP unsigned int roi_ctl = AS_UINT32(&LCD_REG->WROI_CONTROL); unsigned int i = 0; DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "------------------------------------------\n" "[mtkfb] dump lcd layer information\n" "------------------------------------------\n"); for (i = 0; i < 6; ++ i) { unsigned int layer_en = is_layer_enable(roi_ctl, i); DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "Layer[%d] is %s\n", i, layer_en ? "enabled" : "disabled"); if (!layer_en) continue; DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", " size : %d x %d\n", LCD_REG->LAYER[i].SIZE.WIDTH, LCD_REG->LAYER[i].SIZE.HEIGHT); DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", " offset : (%d, %d)\n", LCD_REG->LAYER[i].OFFSET.X, LCD_REG->LAYER[i].OFFSET.Y); DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", " format : %s\n", narrate_lcd_layer_format(LCD_REG->LAYER[i].CONTROL.CLRDPT)); DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", " dlink : %d\n", (AS_UINT32(&LCD_REG->WROI_DC) >> (31 - i)) & 0x1); } DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "\n"); #else LCD_DumpLayer(); #endif }
static void layer_enable_upto(uint8_t max_layer) { // FIXME clean this up // pressing a key implicitly activates all lower layers as well for (uint8_t layer=0; layer <= KB_LAYERS; layer++) { void (*key_function)(void) = kb_layout_press_get(layer, main_arg_row, main_arg_col); if (is_layer_enable(key_function)) { uint8_t enable_layer = kb_layout_get(layer, main_arg_row, main_arg_col); if (enable_layer <= max_layer) { main_layers_enable(enable_layer, eStickyNone); } } } }