Libinput and libev not working after 8.3 to 9.3 update

Description

What MCU/Processor/Board and compiler are you using?

Variscite IMX8MM on a custom carrier board. I am using GCC to compile

What LVGL version are you using?

9.3

What do you want to achieve?

I want my touch screen input device to work with lvgl 9.3

What have you tried so far?

I have LVGL 8.3 working great with my input device using the following code:

    /*Linux frame buffer device init*/
    fbdev_init();

   /*A small buffer for LittlevGL to draw the screen's content*/
    static lv_color_t buf[DISP_BUF_SIZE];

    /*Initialize a descriptor for the buffer*/
    static lv_disp_draw_buf_t disp_buf;
    lv_disp_draw_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);

    /*Initialize and register a display driver*/
    static lv_disp_drv_t disp_drv;
    lv_disp_drv_init(&disp_drv);
    disp_drv.draw_buf   = &disp_buf;
    disp_drv.flush_cb   = fbdev_flush;
    disp_drv.hor_res    = 720;
    disp_drv.ver_res    = 1280;
    disp_drv.full_refresh = 0;
    lv_disp_drv_register(&disp_drv);

//    lv_color_t color  = lv_color_make(255, 255, 255);
//    lv_disp_set_bg_color(disp_drv, color);

  /* Linux input device init */
	evdev_init();

	/* Set up touchpad input device interface */
	lv_indev_drv_t indev_drv;
	lv_indev_drv_init(&indev_drv);
	indev_drv.type = LV_INDEV_TYPE_POINTER;
	indev_drv.read_cb = evdev_read;
	lv_indev_drv_register(&indev_drv);

Code to reproduce

I have switched my code base to LVGL 9.3 and I am trying to use the following code provided by the documentation to use the same input device.

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

    /*LVGL init*/
    lv_init();

    //https://docs.lvgl.io/master/details/integration/driver/display/fbdev.html
    lv_display_t *disp = lv_linux_fbdev_create();
    lv_linux_fbdev_set_file(disp, "/dev/fb0");

//    lv_indev_t *indev = lv_libinput_create(LV_INDEV_TYPE_POINTER, "/dev/input/event1");
    lv_indev_t *touch = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event1");
    lv_indev_set_display(touch, disp);

I can successfully cat /dev/input/event3 and see that my input device is still working. What should be my next step in debugging this?

I started poking around in lv_evdev.c and found the _evdev_process_pointer function.

This function assigns the x and y values to an lv_point_t after running it through the _evdev_calibrate function. That function seems to be mangling the input. Changing the following lines gives me a working input device:

    lv_point_t p;
    p.x = x;//_evdev_calibrate(swapped_x, dsc->min_x, dsc->max_x, offset_x, offset_x + width - 1);
    p.y = y;//_evdev_calibrate(swapped_y, dsc->min_y, dsc->max_y, offset_y, offset_y + height - 1);

Started looking through pull requests for “calibration” and found this:

Which led me to the lv_evdev_set_calibration function so that I can override the ABS_X and ABS_Y values of the touch panel that I am using. This makes it so I don’t have to modify the LVGL source.