Wrong colors using IMX8MP native LVDS and 18 bit screen

Hello everyone,

I am currently connecting our LVDS screen from the native LVDS output of the SoC and fail to get a proper color output. It looks like it is encoded in RGB 444 instead of RGB 666 (18 bits), or coming from a quantization step.
Our screen is 18 bits, but we can feed it using 24 bits too (and discards the last lane of VESA-24).
I use the 5.7.0 BSP.

Here are some commands:
weston-info

*** Please use wayland-info instead
*** weston-info is deprecated and will be removed in a future version

interface: 'wl_compositor', version: 4, name: 1
interface: 'wl_subcompositor', version: 1, name: 2
interface: 'wp_viewporter', version: 1, name: 3
interface: 'zxdg_output_manager_v1', version: 2, name: 4
        xdg_output_v1
                output: 20
                name: 'LVDS-1'
                logical_x: 0, logical_y: 0
                logical_width: 800, logical_height: 480
interface: 'wp_presentation', version: 1, name: 5
        presentation clock id: 1 (CLOCK_MONOTONIC)
interface: 'zwp_alpha_compositing_v1', version: 1, name: 6
interface: 'zwp_relative_pointer_manager_v1', version: 1, name: 7
interface: 'zwp_pointer_constraints_v1', version: 1, name: 8
interface: 'zwp_input_timestamps_manager_v1', version: 1, name: 9
interface: 'wl_data_device_manager', version: 3, name: 10
interface: 'wl_shm', version: 1, name: 11
        formats: 'YUYV'(0x56595559) 'NV12'(0x3231564e) 'YU12'(0x32315559) RGB565 XRGB8888 ARGB8888
interface: 'wl_viv', version: 1, name: 12
interface: 'wl_drm', version: 2, name: 13
interface: 'wl_seat', version: 7, name: 14
        name: default
        capabilities: keyboard
        keyboard repeat rate: 40
        keyboard repeat delay: 400
interface: 'zwp_linux_dmabuf_v1', version: 3, name: 15
        formats:
        'YU12'(0x32315559), modifier: 0x0000000000000000
        'NV12'(0x3231564e), modifier: 0x0000000000000000
        'YUYV'(0x56595559), modifier: 0x0000000000000000
        'RG16'(0x36314752), modifier: 0x0000000000000000
        'XR24'(0x34325258), modifier: 0x0000000000000000
        'AR24'(0x34325241), modifier: 0x0000000000000000
interface: 'weston_direct_display_v1', version: 1, name: 16
interface: 'zwp_linux_explicit_synchronization_v1', version: 2, name: 17
interface: 'weston_content_protection', version: 1, name: 18
interface: 'zwp_hdr10_metadata_v1', version: 1, name: 19
interface: 'wl_output', version: 3, name: 20
        x: 0, y: 0, scale: 1,
        physical_width: 154 mm, physical_height: 91 mm,
        make: 'unknown', model: 'unknown',
        subpixel_orientation: unknown, output_transform: normal,
        mode:
                width: 800 px, height: 480 px, refresh: 63.991 Hz,
                flags: current preferred
interface: 'xdg_wm_base', version: 1, name: 21
interface: 'zxdg_shell_v6', version: 1, name: 22
interface: 'wl_shell', version: 1, name: 23
interface: 'wl_seat', version: 7, name: 24
        name: default
        capabilities: pointer keyboard
        keyboard repeat rate: 40
        keyboard repeat delay: 400
interface: 'wl_seat', version: 7, name: 25
        name: default
        capabilities: pointer keyboard
        keyboard repeat rate: 40
        keyboard repeat delay: 400

fbset

mode "800x480-0"
        # D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
        geometry 800 480 800 480 32
        timings 0 0 0 0 0 0 0
        accel true
        rgba 8/16,8/8,8/0,0/0
endmode

Overlay:


&lvds_channel0 {
	fsl,data-mapping = "jeida";
	fsl,data-width = <24>;
	primary;
};

&panel_lvds {
	data-mapping = "vesa-24";
	panel-timing {
			clock-frequency = <37125000>;
			hactive = <800>;
			vactive = <480>;
			hback-porch = <220>;
			hfront-porch = <40>;
			vback-porch = <21>;
			vfront-porch = <7>;
			hsync-len = <60>;
			vsync-len = <10>;
	};
};

with jeida-18 as a data mapping, the result is exactly the same.
Do you have any idea of what is missing ? Maybe a config in wayland ?

Thanks
Adrian

Dear @luciolis,

Hope you’re doing good. Could you please share with us the following information?

  • Which exact module and version are you using?
  • Which is your carrier board and version?
  • What is the output of a cat /boot/overlays.txt?

At the moment, what I can give of input to you already is that panel_lvds doesn’t seem to be a node defined in the Verdin Family. Instead, you can find it on Apalis modules only. In addition, I can’t confirm with your files only that the lvds node is enabled (status = "okay";). If you want to take inspiration from our base overlays to make your custom one, I’d suggest you to have a look at the following files:

  • touch-atmel-mxt_overlay.dtbo → Responsible for the touch controler
  • verdin-imx8mp_sn65dsi84-lt170410_overlay.dtbo → Set the display timings
  • verdin-imx8mp_sn65dsi84_overlay.dtbo → Enables the lvds_ti_sn65dsi83 node

They are the ones created for the Verdin imx8mp as stated here: Device Tree Overlays (Linux) | Toradex Developer Center

To set the status of the lvds interface to “okay” you can follow this example from the overlays mentioned above:

&lvds_ti_sn65dsi83 {
	status = "okay";

	port {
		dsi85_in: endpoint {
			remote-endpoint = <&mipi_dsi_bridge1_out>;
		};
	};
};

Please tell me if this helps you.

Best regards,
Guilherme

Hi !

Finally I got it right with the same config (it was an hardware issue). However, do you know how to define color bit encoding in wayland/weston ? with framebuffer we can choose between RGB565, RGB666, RGB444, RGB888 etc, but i couldn’t find anything with weston.

Thanks
Adrian

Dear @luciolis,

How are you? I’m glad you got things working on your side. About your last question:
I think that you may have a look at the gbm-format Ubuntu Manpage: weston.ini - configuration file for Weston - the reference Wayland compositor. This is a property that you can define on the weston.ini file. Hope this helps you.

If yes, could you please mark the thread as solved?

Best regards,

I’ve see that already but only xrgb8888 is implemented in current weston version. It’s a bit of a mess with wayland, nothing is working properly. I had to monkey patch weston to get VNC working (like you did with torizon) but I still struggle to get GPU acceleration and good power consumption.
In my opinion it was not a good choice to ditch X11 in the BSP.

Dear @luciolis,

Thanks for the update. I understand it can be a struggle to build some things using Yocto. If you want, you could open a separate thread about GPU Acceleration with the issues you’re facing and we could help with this.

Also, thanks for the feedback on the use of X11. There is constant work to update our reference layers and therefore every customer feedback is highly appreciated.

Best regards,