Hi Yucai,

On 27/4/26 14:47, Peter Maydell wrote:
From: Yucai Liu <[email protected]>

Implement a basic i.MX6UL LCDIF controller model with MMIO registers,
frame-done interrupt behavior, and framebuffer-backed display updates
for RGB565 and XRGB8888 input formats.

Place the LCDIF device under hw/display and build it via a dedicated
CONFIG_IMX6UL_LCDIF symbol. Model register fields with
registerfields.h helpers and provide migration support via vmstate.

Signed-off-by: Yucai Liu <[email protected]>
Message-id: [email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
---
  MAINTAINERS                       |   2 +
  hw/display/Kconfig                |   4 +
  hw/display/imx6ul_lcdif.c         | 453 ++++++++++++++++++++++++++++++
  hw/display/meson.build            |   1 +
  include/hw/display/imx6ul_lcdif.h |  37 +++
  5 files changed, 497 insertions(+)
  create mode 100644 hw/display/imx6ul_lcdif.c
  create mode 100644 include/hw/display/imx6ul_lcdif.h

diff --git a/hw/display/imx6ul_lcdif.c b/hw/display/imx6ul_lcdif.c


+static void imx6ul_lcdif_reset(DeviceState *dev)
+{
+    IMX6ULLCDIFState *s = IMX6UL_LCDIF(dev);
+
+    memset(s->regs, 0, sizeof(s->regs));
+    s->regs[IMX6UL_LCDIF_REG_CTRL1] = LCDIF_RESET_CTRL1;
+    s->fb_base = 0;
+    s->src_width = 0;
+    s->rows = 0;
+    s->src_bpp = 0;
+    s->invalidate = true;
+    timer_del(s->frame_timer);
+    imx6ul_lcdif_update_irq(s);
+}

+static void imx6ul_lcdif_class_init(ObjectClass *klass, const void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->realize = imx6ul_lcdif_realize;
+    dc->unrealize = imx6ul_lcdif_unrealize;
+    dc->vmsd = &vmstate_imx6ul_lcdif;
+    device_class_set_legacy_reset(dc, imx6ul_lcdif_reset);

Please do not use the legacy API. See for example this commit
to convert to the newer API:
https://gitlab.com/qemu-project/qemu/-/commit/ce788d3740f

+    dc->desc = "i.MX6UL LCDIF";
+}

Reply via email to