[BPI-R2] Hdmi in uboot and linux

(Frank W.) #101

Have you tried your adapter?

@Ryder.Lee can you explain this hsync-values: Hdmi in uboot and linux ? For 1024x768@60 i need near 48khz…800x600 should be 38khz


Hello Frank,

when i compile, i get these two warnings:

drivers/gpu/drm/mediatek/mtk_drm_fbdev.c: In function 'mtk_fbdev_probe':
./include/drm/drm_print.h:236:2: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\
drivers/gpu/drm/mediatek/mtk_drm_fbdev.c:61:6: note: 'err' was declared here
  int err;
In file included from ./include/linux/cdev.h:8:0,
                 from ./include/drm/drmP.h:36,
                 from drivers/gpu/drm/mediatek/mtk_dpi.c:14:
drivers/gpu/drm/mediatek/mtk_dpi.c: In function 'mtk_dpi_probe':
./include/linux/device.h:1357:36: warning: 'bridge_node' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
drivers/gpu/drm/mediatek/mtk_dpi.c:731:27: note: 'bridge_node' was declared here
  struct device_node *ep, *bridge_node;

Which I have solved with the following changes.

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fbdev.c b/drivers/gpu/drm/mediatek/mtk_drm_fbdev.c
index 2bff6bc1c7b7..173fe6702841 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_fbdev.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_fbdev.c
@@ -78,17 +78,17 @@ static int mtk_fbdev_probe(struct drm_fb_helper *helper,

        info = drm_fb_helper_alloc_fbi(helper);
        if (IS_ERR(info)) {
+                err = PTR_ERR(info);
                DRM_DEV_ERROR(dev->dev, "failed to allocate framebuffer info, %d\n",
-               err = PTR_ERR(info);
                goto out;

        fb = mtk_drm_framebuffer_create(dev, &mode, private->fbdev_bo);
        if (IS_ERR(fb)) {
+                err = PTR_ERR(fb);
                DRM_DEV_ERROR(dev->dev, "failed to allocate DRM framebuffer, %d\n",
-               err = PTR_ERR(fb);
                goto out;
        helper->fb = fb;


diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index c58b39f55374..40a111820e2d 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -782,16 +782,15 @@ static int mtk_dpi_probe(struct platform_device *pdev)
        if (ep) {
                bridge_node = of_graph_get_remote_port_parent(ep);
-       }
-       if (!bridge_node) {
+               if (!bridge_node) {
                dev_err(dev, "Failed to find bridge node\n");
                return -ENODEV;
+               }
+               dev_info(dev, "Found bridge node: %pOF\n", bridge_node);
+               dpi->encoder.bridge = of_drm_find_bridge(bridge_node);
+               of_node_put(bridge_node);

-       dev_info(dev, "Found bridge node: %pOF\n", bridge_node);
-       dpi->encoder.bridge = of_drm_find_bridge(bridge_node);
-       of_node_put(bridge_node);
        if (!dpi->encoder.bridge)
                return -EPROBE_DEFER;

could you also add nfs (at least as a client) to your defconfig.

When importing the changes over nfs at least the SD card slot is spared.

(Frank W.) #103

You use 4.16 or 4.14? In one hdmi-branch i fixed both by initializing them with 0/NULL

err-patch makes more sense than my one…committed to 4.16-hdmi

added nfs-options to 4.16-main


I use the 4.16-hdmi branch which also works with the console. The Xserver quits his service with the following error message.

MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/mediatek_dri.so: cannot open shared object file: No such file or directory
failed to load driver: mediatek
EGL_MESA_drm_image required.
xinit: connection to X server lost

any idea

(Frank W.) #105

There is no mediatek-dri…have you tried to install software-dri?

apt-get install libgl1-mesa-dri


yes is installed.

Is there a config entry, that forces xserver to load the software driver.

(Frank W.) #107

You can look if there is a /etc/X11/xorg.conf? In my test all config was done on the fly and this file does not exist

Which os do you use? Was xorg installed or have you done this?


I use debian stretch. How did you install the xserver with task desktop or individual packages.

startx brings me only a black screen with mouse pointer and can only kill by kill -9

xinit even a xterm that I can end with the input of exit

(Frank W.) #109

I installed lxde, it’s a full and light desktop environment

how do you fixed your xserver-issue?


yes lxde was a good tip.

I uninstalled everything and reinstalled task-lxde.

then it worked immediately with almost all resolutions

(Frank W.) #111

Can you create a post here: Searching testing people for hdmi + wifi in Kernel 4.16

With the following Informations:

  • kernel used (4.14/4.16)
  • operation system (debian/ubuntu with version)
  • resolutions and frequency (vsync)
  • adapters used (dvi/vga) if any
  • tested function (fbconsole/xorg)
  • problems

(Frank W.) #112

i merged hdmi-branch in 4.14-main and hdmi+wlan to 4.16-main and uploaded new precompiled kernels (4.14main+4.16-main)

(Frank W.) #113

@DeadMeat have you tried porting hdmi+fbdev to 4.18?

(Frank W.) #114

@ryder.lee any progress on getting other (800x600,1024x768) resolutions to work?


We don’t have plan to support these resolutions now. I think the current options are enough for user.


Just some food for thought… It wasn’t until recently that I picked up a new monitor that would support better then 1024x768 resolutions. These SBC’s and small cheep monitors go hand in hand.

(Frank W.) #117

I also cannot use my test-monitor (15" 1024x768+800x600) at the moment with r2.

Hdmi is needed for users not using a debug-uart


Sorry for the late response. We will add it in todo list as uboot upstream and rewrite pinctrl driver are both my first priority now

(Frank W.) #119

@ryder.lee Does this mean mt7623 will get supported by newer uboot-versions?

(Frank W.) #120

just to inform you:

i got signed-off by CK Hu for fbdev-patch, but cannot send patch to mailing list because mail from all my email-adresses (gmx.de, web.de, fw-web.de, gmail.com) got blocked by a blacklist which is down by near 6 years: https://www.dnsbl.info/dnsbl-njabl-org.php

rebased tree to add info CK Hu give me