Hello everyone,
I have an IMX8QXP MEK board to which I connected a panel via the LVDS0 interface. I added support for the panel in board/freescale/imx8qxp_mek/imx8qxp_mek.c as shown below:
struct display_info_t const displays[] = {{
.bus = 0, /* LVDS0 */
.addr = 0, /* LVDS0 */
.pixfmt = IMXDPUV1_PIX_FMT_BGRA32,
.detect = NULL,
.enable = enable_lvds,
.mode = {
.name = "MYPANEL",
.refresh = 60,
.xres = 256,
.yres = 1920,
.pixclock = 13468, /* 74250000 */
.left_margin = 150,
.right_margin = 150,
.upper_margin = 20,
.lower_margin = 20,
.hsync_len = 72,
.vsync_len = 8,
.sync = FB_SYNC_EXT,
.vmode = FB_VMODE_NONINTERLACED
} }};
In u-boot, I configured the display like this:
=> setenv panel MYPANEL
=> saveenv
Now I can see the NXP logo during u-boot like shown in the picture below:
The issue here is that the logo is mirrored, so I need to flip it then rotate it (90°) clockwise.
So I edited video_hw_init(void) in arch/arm/mach-imx/imx8/video_common.c like this:
imxdpuv1_init_channel_buffer(imxdpuv1_id,
channel.common.chan,
gmode.hlen * imxdpuv1_bytes_per_pixel(IMXDPUV1_PIX_FMT_RGB32),
IMXDPUV1_ROTATE_90_RIGHT_HFLIP, /* rotation mode */
(dma_addr_t)fb,
0,
0);
I found rotation modes are defined like this in include/imxdpuv1.h:
/*!
* Enumeration of IMXDPU rotation modes
*/
typedef enum {
/* todo: these need to aligh to imxdpu scan direction */
IMXDPUV1_ROTATE_NONE = 0,
IMXDPUV1_ROTATE_VERT_FLIP = 1,
IMXDPUV1_ROTATE_HORIZ_FLIP = 2,
IMXDPUV1_ROTATE_180 = 3,
IMXDPUV1_ROTATE_90_RIGHT = 4,
IMXDPUV1_ROTATE_90_RIGHT_VFLIP = 5,
IMXDPUV1_ROTATE_90_RIGHT_HFLIP = 6,
IMXDPUV1_ROTATE_90_LEFT = 7,
} imxdpuv1_rotate_mode_t;
I tried different rotation modes but none has worked, it seems that screen rotation is not implemented. So what's the best way to achieve this? I need pointers.
Thank you for your help.
Have a nice day.