Re: [PATCH] drm/rockchip: Return -EBUSY if there's already a pending flip event v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016年03月31日 16:08, Tomeu Vizoso wrote:
As per the docs, atomic_commit should return -EBUSY "if an asycnhronous
updated is requested and there is an earlier updated pending".

v2: Use the status of the workqueue instead of vop->event, and don't add
a superfluous wait on the workqueue.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
---
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 3b8f652698f8..285f8cd5afe1 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -282,6 +282,9 @@ int rockchip_drm_atomic_commit(struct drm_device *dev,
 	struct rockchip_atomic_commit *commit = &private->commit;
 	int ret;
 
+	if (async && work_busy(&commit->work))
+		return -EBUSY;
+

Sorry for reply late.

There is a comment on work_busy function describe :

    "the test result is  unreliable and only useful as advisory hints or for debugging."

I don't know if it's suitable to use it here, does some guys know it?

And then, the "flush_work(&commit->work);" is no needed if return -EBUSY here.
you can remove it at this patch.


 	ret = drm_atomic_helper_prepare_planes(dev, state);
 	if (ret)
 		return ret;



-- 
Mark Yao
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux