BSP6 IMX6ULL Change display to BGRA

I am using BSP6 and in the device tree i can change the operating frequency of the LCD output using

   panel_dpi: panel-dpi {
	compatible = "panel-dpi";
            label = "lcddisp";
	backlight = <&backlight>;
	power-supply = <&reg_3v3>;
	status = "disabled";

	port {
		lcd_panel_in: endpoint {
			remote-endpoint = <&lcdif_out>;
		};
	};

           panel-timing {
                clock-frequency = <33300000>;
                hactive = <800>;
                vactive = <480>;
                hfront-porch = <210>;
                hback-porch = <4>;
                hsync-len = <46>;
                vback-porch = <2>;
                vfront-porch = <22>;
                vsync-len = <23>;

                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <1>;
           };

};

And the size is correct i.e. 800x480 but i believe the colors are wrong.

fbset gives

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

I believe i need bgra instead of rgba.

Up to now i have been building to BSP3 and i believe i changed a .c file to correct this (but this was a few years ago so i cannot remember)

With a module built to BSP3 i get

fbset
mode “800x480-71”
# D: 33.260 MHz, H: 38.630 kHz, V: 71.404 Hz
geometry 800 480 800 480 32
timings 30066 50 10 50 10 1 1
accel false
rgba 8/16,8/8,8/0,0/0
endmode

Just wondering why this shows timing values and the BSP6 does not ?

Hello @adrian ,
in your post you say:

Could you please share a picture of this wrong behavior VS the expected behavior?

Best regards,
Josep

This is the same hardware with a IMX6ULL module built to BSP3

This is the same hardware with a IMX6ULL module built to BSP6

So the hardware must be correct , but the driver/settings needs changing

So it has been a while since i have had to rebuild the kernel and device tree for any hardware.
I believe my hardware is using the fb0 and lcdif but i am a bit confused if this is true as i have seen mention of mxsfb ??
(I am using the default LCD output of the IMX6ULL)

Hello @adrian ,
The documentation about displays in the iMX6ULL is here:

and yes, they mention mxsfb, and lcdif.
I would advise to use lcdif instead of panel-dpi. In lcdif you can set the bits-per-pixel parameter, which I think it is the cause of your color artifacts.

Best regards,
Josep

Hello, i have taken a look at that link and i have tried adding ’ display-timings` into &lcdif but this does not work.

I am wondering if that page is out of date as with the build i am using there are no mention of ‘display-timings’ or ‘port’ or ‘compatible’

So from the build i have , i have the following

lcdif: lcdif@21c8000 {
compatible = “fsl,imx6ul-lcdif”, “fsl,imx6sx-lcdif”;
reg = <0x021c8000 0x4000>;
interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_LCDIF_PIX>,
<&clks IMX6UL_CLK_LCDIF_APB>,
<&clks IMX6UL_CLK_DUMMY>;
clock-names = “pix”, “axi”, “disp_axi”;
status = “disabled”;
};

Then …

  panel_dpi: panel-dpi {
	compatible = "panel-dpi";
	backlight = <&backlight>;
	power-supply = <&reg_3v3>;
	status = "disabled";

	port {
		lcd_panel_in: endpoint {
			remote-endpoint = <&lcdif_out>;
		};
	};

           panel-timing {
                clock-frequency = <33300000>;
                hactive = <800>;
                vactive = <480>;
                hfront-porch = <210>;
                hback-porch = <4>;
                hsync-len = <46>;
                vback-porch = <2>;
                vfront-porch = <22>;
                vsync-len = <23>;

                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <1>;
           };

};

&lcdif {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_lcdif_dat
&pinctrl_lcdif_ctrl>;
status = “disabled”;

port {
	lcdif_out: endpoint {
		remote-endpoint = <&lcd_panel_in>;
	};
};

};

I am lost here as its very rare that i have to build a device tree for new hardware.
Can you tell me what i need to change on the above to change to using ‘lcdif’ as you suggested.

I have noticed this in the boot up terminal output

[ 1.739107] mxsfb 21c8000.lcdif: [drm] fb0: mxsfb-drmdrmfb frame buffer device

Q. Do i need to change a settings in my image config ( set via menuconfig) ?

Hello @adrian ,

I would suggest to read the documentation about device tree overlays (which is a feature available from BSP 5 on)

and then have a look at the integration of our Resistive Touch Display 7" Parallel screen as starting point for your display:

This is the overlay
https://git.toradex.com/cgit/device-tree-overlays.git/tree/overlays/colibri-imx6ull_panel-res-touch-7inch_overlay.dts

which makes use of this device tree overlays:
This one to enable the parallel RGB interface
https://git.toradex.com/cgit/device-tree-overlays.git/tree/overlays/colibri-imx6ull_parallel-rgb_overlay.dtsi

And this other one to set the panel timings for the display
https://git.toradex.com/cgit/device-tree-overlays.git/tree/overlays/display-lt161010_overlay.dtsi

Best regards,
Josep