mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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>
This commit is contained in:
parent
d37690b5e0
commit
db5be3a7d6
|
|
@ -20,6 +20,7 @@
|
||||||
#include <drm/drm_vblank.h>
|
#include <drm/drm_vblank.h>
|
||||||
|
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
|
#include <linux/device.h>
|
||||||
#include <linux/dma-mapping.h>
|
#include <linux/dma-mapping.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
|
@ -458,6 +459,9 @@ static void rcar_du_vsp_cleanup(struct drm_device *dev, void *res)
|
||||||
|
|
||||||
kfree(vsp->planes);
|
kfree(vsp->planes);
|
||||||
|
|
||||||
|
if (vsp->link)
|
||||||
|
device_link_del(vsp->link);
|
||||||
|
|
||||||
put_device(vsp->vsp);
|
put_device(vsp->vsp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -482,6 +486,18 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enforce suspend/resume ordering between the DU (consumer) and the
|
||||||
|
* VSP (supplier). The DU will be suspended before and resume after the
|
||||||
|
* VSP.
|
||||||
|
*/
|
||||||
|
vsp->link = device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS);
|
||||||
|
if (!vsp->link) {
|
||||||
|
dev_err(rcdu->dev, "Failed to create device link to VSP %s\n",
|
||||||
|
dev_name(vsp->vsp));
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ret = vsp1_du_init(vsp->vsp);
|
ret = vsp1_du_init(vsp->vsp);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#include <drm/drm_plane.h>
|
#include <drm/drm_plane.h>
|
||||||
|
|
||||||
|
struct device_link;
|
||||||
struct drm_framebuffer;
|
struct drm_framebuffer;
|
||||||
struct rcar_du_format_info;
|
struct rcar_du_format_info;
|
||||||
struct rcar_du_vsp;
|
struct rcar_du_vsp;
|
||||||
|
|
@ -26,6 +27,7 @@ struct rcar_du_vsp_plane {
|
||||||
struct rcar_du_vsp {
|
struct rcar_du_vsp {
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
struct device *vsp;
|
struct device *vsp;
|
||||||
|
struct device_link *link;
|
||||||
struct rcar_du_device *dev;
|
struct rcar_du_device *dev;
|
||||||
struct rcar_du_vsp_plane *planes;
|
struct rcar_du_vsp_plane *planes;
|
||||||
unsigned int num_planes;
|
unsigned int num_planes;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user