diff --git a/core/embed/trezorhal/stm32f4/dma2d_bitblt.c b/core/embed/trezorhal/stm32f4/dma2d_bitblt.c index b2d20f949..ae2d809a0 100644 --- a/core/embed/trezorhal/stm32f4/dma2d_bitblt.c +++ b/core/embed/trezorhal/stm32f4/dma2d_bitblt.c @@ -56,19 +56,6 @@ void dma2d_rgb565_fill(const gl_bitblt_t* bb) { HAL_DMA2D_Start(&dma2d_handle, gl_color_to_color32(bb->src_fg), (uint32_t)bb->dst_row + bb->dst_x * sizeof(uint16_t), bb->width, bb->height); - /* - - MODIFY_REG(dma2d_handle.Instance->CR, DMA2D_CR_MODE, DMA2D_R2M); - MODIFY_REG(dma2d_handle.Instance->OPFCCR, DMA2D_OPFCCR_CM, - DMA2D_OUTPUT_RGB565); MODIFY_REG(dma2d_handle.Instance->OOR, - DMA2D_OOR_LO, bb->dst_stride / sizeof(uint16_t) - bb->width); - MODIFY_REG(dma2d_handle.Instance->NLR, (DMA2D_NLR_NL|DMA2D_NLR_PL), - (bb->height| (bb->width << 16))); WRITE_REG(dma2d_handle.Instance->OMAR, - (uint32_t)bb->dst_row + bb->dst_x * sizeof(uint16_t)); - WRITE_REG(dma2d_handle.Instance->OCOLR, - gl_color_to_color32(bb->src_fg)); - ((dma2d_handle).Instance->CR |= DMA2D_CR_START); - */ } else { #ifdef STM32U5 dma2d_handle.Init.ColorMode = DMA2D_OUTPUT_RGB565; @@ -111,42 +98,6 @@ void dma2d_rgb565_fill(const gl_bitblt_t* bb) { } } -/* -static void dma2d_config_clut(uint32_t layer, gl_color_t fg, gl_color_t bg) { - - #define LAYER_COUNT 2 - #define GRADIENT_STEPS 16 - - static struct { - gl_color32_t gradient[GRADIENT_STEPS]; - } cache[LAYER_COUNT] = { 0 }; - - if (layer >= LAYER_COUNT) { - return; - } - - uint32_t c_fg = gl_color_to_color32(fg); - uint32_t c_bg = gl_color_to_color32(bg); - - uint32_t* gradient = cache[layer].gradient; - - if (c_bg != gradient[0] || c_fg != gradient[GRADIENT_STEPS - 1]) { - for (int step = 0; step < GRADIENT_STEPS; step++) { - gradient[step] = gl_color32_blend_a4(fg, bg, step); - } - - DMA2D_CLUTCfgTypeDef clut; - clut.CLUTColorMode = DMA2D_CCM_ARGB8888; - clut.Size = GRADIENT_STEPS - 1; - clut.pCLUT = gradient; - - HAL_DMA2D_ConfigCLUT(&dma2d_handle, clut, layer); - - while (HAL_DMA2D_PollForTransfer(&dma2d_handle, 10) != HAL_OK) - ; - } -}*/ - static void dma2d_config_clut(uint32_t layer, gl_color_t fg, gl_color_t bg) { #define LAYER_COUNT 2 #define GRADIENT_STEPS 16