drm: rcar-du: track dma-buf fences
Subsystems (3)
PATCH v2 1/1 drm: rcar-du: track dma-buf fences
We have to check dma-buf reservation objects of our framebuffers before we use them. Otherwise, another driver might be writing on the same buffer which we are using. This would cause visible tearing effects on display.
We can use existing atomic helper functions to solve this problem.
v2 changes:
- Remove drm_atomic_helper_wait_for_fences() call in rcar_du_kms.c. The commit_tail() function in drm_atomic_helper.c, which calls our atomic_commit_tail() implementation, already calls it.
- Remove proposed rcar_du_vsp_set_fence_for_plane() function. Call drm_gem_fb_prepare_fb(), which calls drm_atomic_set_fence_for_plane().
--- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +2 -1
@@ -18,6 +18,7 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <linux/bitops.h> #include <linux/dma-mapping.h>
@@ -237,7 +238,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, } } -return 0 ; +return drm_gem_fb_prepare_fb (plane, state); fail:while (i--) {
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Emre,
Sorry for the late reply.
Quoted 9 lines · On Wednesday, 4 April 2018 14:03:57 EEST Emre Ucan wrote:
We have to check dma-buf reservation objects of our framebuffers before we use them. Otherwise, another driver might be writing on the same buffer which we are using. This would cause visible tearing effects on display.
We can use existing atomic helper functions to solve this problem.
I've always found the 72 columns limit in commit messages to be quite limiting, especially for the subject line. Out of curiosity, is there any specific reason why you limit it further ?
Quoted 20 lines
v2 changes:
- Removedrm_atomic_helper_wait_for_fences()call inrcar_du_kms.c. Thecommit_tail()function indrm_atomic_helper.c, which calls ouratomic_commit_tail()implementation, already calls it.
- Remove proposedrcar_du_vsp_set_fence_for_plane()function. Calldrm_gem_fb_prepare_fb(), which callsdrm_atomic_set_fence_for_plane().Signed-off-by Emre Ucan <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.cindex 2c260c3..fbad616 100644
drivers/gpu/drm/rcar-du/rcar_du_vsp.c line 21
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-0@@ -18,6 +18,7 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_gem_framebuffer_helper.h>
Nitpicking, could you please keep the headers alphabetically sorted ? It helps locating duplicates quickly.
drivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct drm_plane · line 241
Quoted 8 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-1#include <linux/bitops.h> #include <linux/dma-mapping.h> @@ -237,7 +238,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, } } -return 0 ; +return drm_gem_fb_prepare_fb (plane, state);
If drm_gem_fb_prepare_fb() fails we need to clean up the operations performed earlier in this function. I think the following would be enough.
ret = drm_gem_fb_prepare_fb(plane, state);
if (ret)
goto fail;
return 0;Could you please test this ?
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-0fail:while (i--) {
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Laurent,
Sorry for late reply.
Quoted 19 lines
-----Original Message-----
From: Laurent Pinchart [mailto:[email protected]]
Sent: Montag, 23. April 2018 23:47
To: Ucan, Emre (ADITG/ESB)
Cc: [email protected]
Subject: Re: [PATCH v2] drm: rcar-du: track dma-buf fencesHi Emre,
Sorry for the late reply.
Quoted 7 lines · On Wednesday, 4 April 2018 14:03:57 EEST Emre Ucan wrote:
We have to check dma-buf reservation objects of our framebuffers before we use them. Otherwise, another driver might be writing on the same buffer which we are using. This would cause visible tearing effects on display.
Quoted 6 lines
Quoted 2 lines
We can use existing atomic helper functions to solve this problem.
I've always found the 72 columns limit in commit messages to be quite limiting, especially for the subject line. Out of curiosity, is there any specific reason why you limit it further ?
I tried to keep lines short. But I did not check if they are shorter than 72. I will improve it.
Quoted 16 lines
Quoted 16 lines
v2 changes:
- Removedrm_atomic_helper_wait_for_fences()call inrcar_du_kms.c. Thecommit_tail()function indrm_atomic_helper.c, which calls ouratomic_commit_tail()implementation, already calls it.
- Remove proposedrcar_du_vsp_set_fence_for_plane()function. Calldrm_gem_fb_prepare_fb(), which callsdrm_atomic_set_fence_for_plane().Signed-off-by Emre Ucan <[email protected]>--- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 12 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c line 21
Quoted 9 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.cindex 2c260c3..fbad616 100644drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-0@@ -18,6 +18,7 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> Nitpicking, could you please keep the headers alphabetically sorted ? It helps locating duplicates quickly.
No problem. I will fix it.
Quoted 15 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct
Quoted 4 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-0#include <linux/bitops.h> #include <linux/dma-mapping.h> @@ -237,7 +238,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct
drm_planedrivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, · line 241
Quoted 5 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-1*plane, } } -return 0 ; +return drm_gem_fb_prepare_fb (plane, state);If
drm_gem_fb_prepare_fb()fails we need to clean up the operations performed
earlier in this function. I think the following would be enough.
Quoted 7 lines
ret = drm_gem_fb_prepare_fb(plane, state); if (ret) goto fail; return 0;Could you please test this ?
No problem.
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, · line 244
Quoted 3 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-0fail:while (i--) {--
Regards,Laurent Pinchart
I will send a new patch with these changes after I tested it. Is it possible that improved patch lands on 4.17 and 4.14 stable versions? What is the process to propose a patch to a stable release ?
Best Regards,
Emre Ucan
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Emre,
Quoted 3 lines · Emre (ADITG/ESB)
Hi Laurent,
Sorry for late reply.
No worries.
Quoted 73 lines · On Montag, 23. April 2018 23:47 Laurent Pinchart wrote:
Quoted 8 lines · On Wednesday, 4 April 2018 14:03:57 EEST Emre Ucan wrote:
Quoted 7 lines
We have to check dma-buf reservation objects of our framebuffers before we use them. Otherwise, another driver might be writing on the same buffer which we are using. This would cause visible tearing effects on display.
Quoted 6 lines
Quoted 2 lines
We can use existing atomic helper functions to solve this problem.
I've always found the 72 columns limit in commit messages to be quite limiting, especially for the subject line. Out of curiosity, is there any specific reason why you limit it further ?
I tried to keep lines short. But I did not check if they are shorter than
72. I will improve it.Quoted 17 lines
Quoted 17 lines
v2 changes:
- Removedrm_atomic_helper_wait_for_fences()call inrcar_du_kms.c. Thecommit_tail()function indrm_atomic_helper.c, which calls ouratomic_commit_tail()implementation, already calls it.- Remove proposed
rcar_du_vsp_set_fence_for_plane()function. Calldrm_gem_fb_prepare_fb(), which callsdrm_atomic_set_fence_for_plane().Signed-off-by Emre Ucan <[email protected]>---
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Quoted 12 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c line 21
Quoted 9 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_vsp.cindex 2c260c3..fbad616 100644drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-0@@ -18,6 +18,7 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_plane_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> Nitpicking, could you please keep the headers alphabetically sorted ? It helps locating duplicates quickly.
No problem. I will fix it.
Quoted 14 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct · line 242
Quoted 10 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +1
-1#include <linux/bitops.h> #include <linux/dma-mapping.h> @@ -237,7 +238,7 @@ static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, } } -return 0 ; +return drm_gem_fb_prepare_fb (plane, state);If
drm_gem_fb_prepare_fb()fails we need to clean up the operations performed earlier in this function. I think the following would be enough.Quoted 7 lines
ret = drm_gem_fb_prepare_fb(plane, state); if (ret) goto fail; return 0;Could you please test this ?
Quoted 8 lines
No problem.
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c static int rcar_du_vsp_plane_prepare_fb(struct drm_plane *plane, · line 244
Quoted 2 lines
drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0
-0fail:while (i--) {I will send a new patch with these changes after I tested it. Is it possible that improved patch lands on 4.17 and 4.14 stable versions? What is the process to propose a patch to a stable release ?
The process is pretty simple, it's documented in Documentation/process/stable- kernel-rules.rst. The file states the following requirement for a patch to be eligible for stable backporting:
- It must fix a problem that causes a build error (but not for things marked CONFIG_BROKEN), an oops, a hang, data corruption, a real security issue, or some "oh, that's not good" issue. In short, something critical
I'll let you decide whether this patch qualifies, as it could be argued that it implements a new feature.
Signature · 10 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Laurent,
(snip)
Quoted 14 lines
Quoted 3 lines
I will send a new patch with these changes after I tested it. Is it possible that improved patch lands on 4.17 and 4.14 stable versions? What is the process to propose a patch to a stable release ?
The process is pretty simple, it's documented in
Documentation/process/stable-kernel-rules.rst. The file states the following requirement for a patch to be eligible for stable backporting:- It must fix a problem that causes a build error (but not for things marked
CONFIG_BROKEN), an oops, a hang, data corruption, a real security issue, or some "oh, that's not good" issue. In short, something critical
Quoted 9 lines
I'll let you decide whether this patch qualifies, as it could be argued that it implements a new feature.
--
Regards,Laurent Pinchart
IMHO, it is not a new feature, but It is a bug. Because explicit fencing is a recent kernel feature. As Daniel Vetter stated, most X and wayland setups still rely on implicit fencing.
Anyway this patch must be integrated first to Linus' tree, before I can propose to the stable release. It would be great if it can be part of 4.17.
Best Regards,
Emre Ucan
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel