AOSP and mipi-dsi

I connected the display (LD070WX5) via the mipi interface.
What actions do I need to do to make it work?
To set the HDMI settings, need to edit the parameter video = HDMI-A-1: 1280x800 @ 60 in device / linaro / hikey / hikey / BoardConfig.mk
What do I need to specify in this line if I want to switch the video to MIPI-DSI?
Do I need to manually change DSI_SEL_GPIO0_1?

Do you have the panel MIPI DSI DCS initialization code for the LD070WX5? You need that to bringup the panel. Once you have it, convert it so that you can create a DRM driver. This guide helped me a lot: https://github.com/freedreno/freedreno/wiki/DSI-Panel-Driver-Porting. Then if you didn’t have it already, clone and build AOSP for HiKey (Using Reference Boards  |  Android Open Source Project). you only need to build and deploy the whole thing once, after that you can build only the kernel.

Then you can make a copy of an existing panel $AOSP_ROOT/hikey-linaro/drivers/gpu/drm/panel, modify it with the correct DCS init sequence and timings. Then you need to add a configuration for it in the Kconfig and add the source files to the Makefile and enable it in the defconfig. Then I also needed to make some changes in the drm section of the device tree. I used Hikey960, so I’m not exactly sure where to find panel settings. Rebuild the kernel and closely watch dmesg output for any mistakes you made during the process.

Personally I would recommend getting a Dragonboard and follow the Qualcomm method first. Doesn’t work with AOSP, but their method is a bit more straightforward (you can skip the LK bit). Once you have validated your panel adapter PCB is working correctly, move over to the HikEy / AOSP method.

Thank you so much!

Well, I will create a new DRM driver for LD070WX5 based on panel_simple.c (which contains a driver for a very similar matrix ld070wx3).
Are my further actions correct?

  1. create DRM driver (drivers \ gpu \ drm \ panel \ panel-ld070wx5.c)
  2. edit the files Kconfig and Makefile (drivers \ gpu \ drm \ panel ).
  3. execute the commands:
    make ARCH = arm64 hikey_defconfig
    make ARCH = arm64 menuconfig
  4. enable DRM driver for LD070WX5 in menuconfig.

So we get a kernel with support for my panel.
But I still have a question
There will be two drivers for outputting video to LD070WX5 (LCD panel) and to ADV7533 (mipi to hdmi converter). Where will the video go and how will it be managed?

That’s the basic idea yes. I have only managed to make it work once and forgot to take notes, so I may have missed a step. I’m also pretty new to Android/Linux development so I just do a lot of trial & error, stackoverflow and pray it works :slight_smile: .

You’ll have two drivers indeed. The DSI code looks like it can support those at the same time, in the sense that the HDMI bridge takes a precedence over the DSI when connected. In my case I only get the panel output, whether I connect HDMI or not. But I think it should be possible because this:

https://android.googlesource.com/kernel/hikey-linaro/+/android-hikey-linaro-4.14/drivers/gpu/drm/hisilicon/kirin960/dw_drm_dsi.c#270

Haven’t figured out yet why it doesn’t work but it is of low priority to me.

Anyway once you get it to work you’ll first see the ADV7533 init in dmesg, followed by a panel init and a switch to the panel, as shown in that same piece of code.

Kernels HiKey960 and HiKey differ.
Switching mipi / hdmi for HiKey is possible by changing gpio_dsi_sel.
The value of gpio_dsi_sel is set only in the drivers \ media \ i2c \ adv7533.c (sets to low).
So I do not know how to switch the hdmi / panel.