[PATCH v6 07/12] video: rockchip: vop2: Add video bridge support

Dang Huynh dang.huynh at mainlining.org
Tue Mar 24 11:08:43 CET 2026


Hi Peter,

On Wed, Mar 04, 2026 at 12:29:27PM +0000, Peter Robinson wrote:
> Hey Dang,
> 
> Finally started to play with this patch set.
> 
> > From: Dang Huynh <dang.huynh at mainlining.org>
> >
> > Add support for video bridge to VOP2 so we can use the MIPI DSI
> > bridge driver that we have.
> 
> I see a link failure when using this patch set with the
> anbernic-rgxx3-rk3566_defconfig using 2026.04-rc3.
> 
> /usr/bin/ld.bfd: drivers/video/rockchip/rk_vop2.o: in function
> `rk_display_init':
> /builddir/build/BUILD/uboot-tools-2026.04-build/u-boot-2026.04-rc3/drivers/video/rockchip/rk_vop2.c:422:(.text.rk_vop2_probe+0x360):
> undefined reference to `display_in_use'
> /usr/bin/ld.bfd:
> /builddir/build/BUILD/uboot-tools-2026.04-build/u-boot-2026.04-rc3/drivers/video/rockchip/rk_vop2.c:437:(.text.rk_vop2_probe+0x388):
> undefined reference to `display_read_timing'
> /usr/bin/ld.bfd:
> /builddir/build/BUILD/uboot-tools-2026.04-build/u-boot-2026.04-rc3/drivers/video/rockchip/rk_vop2.c:492:(.text.rk_vop2_probe+0x794):
> undefined reference to `display_enable'
You need to enable CONFIG_DISPLAY. I'll be fixing this in the next series.

> 
> Cheers,
> Peter
> 
> 
> > Reviewed-by: Svyatoslav Ryhel <clamor95 at gmail.com>
> > Signed-off-by: Dang Huynh <dang.huynh at mainlining.org>
> > ---
> >  drivers/video/rockchip/rk_vop2.c | 81 +++++++++++++++++++++++++++++-----------
> >  1 file changed, 59 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/video/rockchip/rk_vop2.c b/drivers/video/rockchip/rk_vop2.c
> > index 992f215d416..156daafa0c3 100644
> > --- a/drivers/video/rockchip/rk_vop2.c
> > +++ b/drivers/video/rockchip/rk_vop2.c
> > @@ -13,10 +13,12 @@
> >  #include <dm/device_compat.h>
> >  #include <edid.h>
> >  #include <log.h>
> > +#include <panel.h>
> >  #include <regmap.h>
> >  #include <reset.h>
> >  #include <syscon.h>
> >  #include <video.h>
> > +#include <video_bridge.h>
> >  #include <asm/global_data.h>
> >  #include <asm/gpio.h>
> >  #include <asm/io.h>
> > @@ -291,6 +293,7 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)
> >         int vop_id, port_id, win_id;
> >         struct display_timing timing;
> >         struct udevice *disp;
> > +       struct udevice *bridge;
> >         int ret;
> >         u32 remote_phandle;
> >         struct display_plat *disp_uc_plat;
> > @@ -357,8 +360,11 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)
> >                         return -EINVAL;
> >                 }
> >
> > +               if (IS_ENABLED(CONFIG_VIDEO_BRIDGE))
> > +                       uclass_find_device_by_ofnode(UCLASS_VIDEO_BRIDGE, remote, &bridge);
> > +
> >                 uclass_find_device_by_ofnode(UCLASS_DISPLAY, remote, &disp);
> > -               if (disp)
> > +               if (disp || bridge)
> >                         break;
> >         };
> >         compat = ofnode_get_property(remote, "compatible", NULL);
> > @@ -390,27 +396,49 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)
> >         if (ret < 0)
> >                 return ret;
> >
> > -       disp_uc_plat = dev_get_uclass_plat(disp);
> > -       debug("Found device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
> > -       if (display_in_use(disp)) {
> > -               debug("   - device in use\n");
> > -               return -EBUSY;
> > -       }
> > +       if (bridge) {
> > +               /* video bridge detected, probe it */
> > +               ret = device_probe(bridge);
> > +               if (ret) {
> > +                       dev_err(dev, "Failed to probe video bridge: %d\n", ret);
> > +                       return ret;
> > +               }
> >
> > -       disp_uc_plat->source_id = vop_id;
> > -       disp_uc_plat->src_dev = dev;
> > +               /* Attach the DSI controller and the display to the bridge. */
> > +               ret = video_bridge_attach(bridge);
> > +               if (ret) {
> > +                       dev_err(dev, "Failed to attach video bridge: %d\n", ret);
> > +                       return ret;
> > +               }
> >
> > -       ret = device_probe(disp);
> > -       if (ret) {
> > -               debug("%s: device '%s' display won't probe (ret=%d)\n",
> > -                     __func__, dev->name, ret);
> > -               return ret;
> > -       }
> > +               ret = video_bridge_get_display_timing(bridge, &timing);
> > +               if (ret) {
> > +                       dev_err(dev, "Failed to read timings: %d\n", ret);
> > +                       return ret;
> > +               }
> > +       } else {
> > +               disp_uc_plat = dev_get_uclass_plat(disp);
> > +               debug("Found device '%s', disp_uc_priv=%p\n", disp->name, disp_uc_plat);
> > +               if (display_in_use(disp)) {
> > +                       debug("   - device in use\n");
> > +                       return -EBUSY;
> > +               }
> >
> > -       ret = display_read_timing(disp, &timing);
> > -       if (ret) {
> > -               debug("%s: Failed to read timings\n", __func__);
> > -               return ret;
> > +               disp_uc_plat->source_id = vop_id;
> > +               disp_uc_plat->src_dev = dev;
> > +
> > +               ret = device_probe(disp);
> > +               if (ret) {
> > +                       debug("%s: device '%s' display won't probe (ret=%d)\n",
> > +                             __func__, dev->name, ret);
> > +                       return ret;
> > +               }
> > +
> > +               ret = display_read_timing(disp, &timing);
> > +               if (ret) {
> > +                       debug("%s: Failed to read timings\n", __func__);
> > +                       return ret;
> > +               }
> >         }
> >
> >         /* Set clock rate on video port to display timings */
> > @@ -453,9 +481,18 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)
> >
> >         rkvop2_mode_set(dev, &timing, vop_id, port_id, platdata);
> >
> > -       ret = display_enable(disp, 1 << l2bpp, &timing);
> > -       if (ret)
> > -               return ret;
> > +       if (bridge) {
> > +               /* Attach the DSI controller and the display to the bridge. */
> > +               ret = video_bridge_set_backlight(bridge, 60);
> > +               if (ret) {
> > +                       dev_err(dev, "Failed to start the video bridge: %d\n", ret);
> > +                       return ret;
> > +               }
> > +       } else {
> > +               ret = display_enable(disp, 1 << l2bpp, &timing);
> > +               if (ret)
> > +                       return ret;
> > +       }
> >
> >         uc_priv->xsize = timing.hactive.typ;
> >         uc_priv->ysize = timing.vactive.typ;
> >
> > --
> > 2.51.2
> >
> >


More information about the U-Boot mailing list