Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: atmel-hlcdc: reset layer A2Q and UPDATE bits when disabling it

The A2Q (Add To Queue) and UPDATE bits are left in their previous state
when resetting the layer.
This lead to weird behavior when enabling the plane again: the framebuffer
previously queued is dequeued and we end up with access to an old memory
region.

Reset those bits when resetting the channel.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

+2 -1
+2 -1
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c
··· 311 311 312 312 /* Disable the layer */ 313 313 regmap_write(regmap, desc->regs_offset + ATMEL_HLCDC_LAYER_CHDR, 314 - ATMEL_HLCDC_LAYER_RST); 314 + ATMEL_HLCDC_LAYER_RST | ATMEL_HLCDC_LAYER_A2Q | 315 + ATMEL_HLCDC_LAYER_UPDATE); 315 316 316 317 /* Clear all pending interrupts */ 317 318 regmap_read(regmap, desc->regs_offset + ATMEL_HLCDC_LAYER_ISR, &isr);