Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm: rcar-du: Ensure correct suspend/resume ordering with VSP

The VSP serves as an interface to memory and a compositor to the DU. It
therefore needs to be suspended after and resumed before the DU, to be
properly stopped and restarted in a controlled fashion driven by the DU
driver. This currently works by chance. Avoid relying on luck by
enforcing the correct suspend/resume ordering with device links.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Link: https://patch.msgid.link/20260323164526.2292491-2-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

authored by

Laurent Pinchart and committed by
Tomi Valkeinen
db5be3a7 d37690b5

+18
+16
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
··· 20 20 #include <drm/drm_vblank.h> 21 21 22 22 #include <linux/bitops.h> 23 + #include <linux/device.h> 23 24 #include <linux/dma-mapping.h> 24 25 #include <linux/of_platform.h> 25 26 #include <linux/platform_device.h> ··· 459 458 460 459 kfree(vsp->planes); 461 460 461 + if (vsp->link) 462 + device_link_del(vsp->link); 463 + 462 464 put_device(vsp->vsp); 463 465 } 464 466 ··· 485 481 ret = drmm_add_action_or_reset(&rcdu->ddev, rcar_du_vsp_cleanup, vsp); 486 482 if (ret < 0) 487 483 return ret; 484 + 485 + /* 486 + * Enforce suspend/resume ordering between the DU (consumer) and the 487 + * VSP (supplier). The DU will be suspended before and resume after the 488 + * VSP. 489 + */ 490 + vsp->link = device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS); 491 + if (!vsp->link) { 492 + dev_err(rcdu->dev, "Failed to create device link to VSP %s\n", 493 + dev_name(vsp->vsp)); 494 + return -EINVAL; 495 + } 488 496 489 497 ret = vsp1_du_init(vsp->vsp); 490 498 if (ret < 0)
+2
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.h
··· 12 12 13 13 #include <drm/drm_plane.h> 14 14 15 + struct device_link; 15 16 struct drm_framebuffer; 16 17 struct rcar_du_format_info; 17 18 struct rcar_du_vsp; ··· 27 26 struct rcar_du_vsp { 28 27 unsigned int index; 29 28 struct device *vsp; 29 + struct device_link *link; 30 30 struct rcar_du_device *dev; 31 31 struct rcar_du_vsp_plane *planes; 32 32 unsigned int num_planes;