Skip to contentSkip to conversation

drm/doc: document front-buffer rendering

PATCH In review Simon Ser 4 participants 9 messages Apr 14, 2025 – May 6, 2025

Subsystems (2)
lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH v2 1/1 drm/doc: document front-buffer rendering

Explain how to perform front-buffer rendering.

v2: apply Pekka's rewrite

Cc Pekka Paalanen <[email protected]>
Cc Simona Vetter <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_blend.c +6 -0
index 6e74de833466..4e83f372ea51 100644
@@ -75,6 +75,12 @@
  * 	the currently visible vertical area of the &drm_crtc.
  * FB_ID:
  * 	Mode object ID of the &drm_framebuffer this plane should scan out.
+ *
+ *	When a KMS client is perfoming front-buffer rendering, it should set
+ *	FB_ID to the same front-buffer FB on each atomic commit. This implies
+ *	to the driver that it needs to re-read the same FB again. Otherwise
+ *	drivers which do not employ continuously repeated scanout cycles might
+ *	not update the screen.
  * CRTC_ID:
  * 	Mode object ID of the &drm_crtc this plane should be connected to.
  *
Signature · 1 line
2.49.0
#1 lore raw
Quoted 18 lines · On Mon, 14 Apr 2025 08:56:56 +0000 Simon Ser <[email protected]> wrote:

Explain how to perform front-buffer rendering.

v2: apply Pekka's rewrite

Cc Pekka Paalanen <[email protected]>
Cc Simona Vetter <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_blend.c +0 -0
index 6e74de833466..4e83f372ea51 100644
@@ -75,6 +75,12 @@
  * 	the currently visible vertical area of the &drm_crtc.
  * FB_ID:

drivers/gpu/drm/drm_blend.c line 86

Quoted 10 lines
drivers/gpu/drm/drm_blend.c +6 -0
  * 	Mode object ID of the &drm_framebuffer this plane should scan out.
+ *
+ *	When a KMS client is perfoming front-buffer rendering, it should set
+ *	FB_ID to the same front-buffer FB on each atomic commit. This implies
+ *	to the driver that it needs to re-read the same FB again. Otherwise
+ *	drivers which do not employ continuously repeated scanout cycles might
+ *	not update the screen.
  * CRTC_ID:
  * 	Mode object ID of the &drm_crtc this plane should be connected to.
  *

Looking good, but given the new wording is 100% mine, not sure I can give reviewed-by?

Co-authored-by maybe?

Thanks,
pq

author
#2 lore raw
Quoted 4 lines · Pekka Paalanen

Looking good, but given the new wording is 100% mine, not sure I can give reviewed-by?

Co-authored-by maybe?

Since it's 100% yours, probably you should be the commit author? Would you mind giving a S-o-b as well?

But I wonder, would I be able to drop a R-b tag, meaning I agree with your new wording?

#3 lore raw
Quoted 5 lines · On Thu, 17 Apr 2025 15:19:45 +0000 Simon Ser <[email protected]> wrote:
Quoted 3 lines · Pekka Paalanen

Looking good, but given the new wording is 100% mine, not sure I can give reviewed-by?

Quoted 7 lines
Quoted 1 line

Co-authored-by maybe?

Since it's 100% yours, probably you should be the commit author? Would you mind giving a S-o-b as well?

But I wonder, would I be able to drop a R-b tag, meaning I agree with your new wording?

Sure,

If I was Author, then I think your R-b would be good. I'm fine with that.

Thanks,
pq

#5 lore raw
In reply to Simon Ser
Quoted 16 lines · Simon Ser

Explain how to perform front-buffer rendering.

v2: apply Pekka's rewrite

Cc Pekka Paalanen <[email protected]>
Cc Simona Vetter <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_blend.c +0 -0
index 6e74de833466..4e83f372ea51 100644

drivers/gpu/drm/drm_blend.c line 83

Quoted 9 lines
drivers/gpu/drm/drm_blend.c +6 -0
@@ -75,6 +75,12 @@
  * 	the currently visible vertical area of the &drm_crtc.
  * FB_ID:
  * 	Mode object ID of the &drm_framebuffer this plane should scan out.
+ *
+ *	When a KMS client is perfoming front-buffer rendering, it should set
+ *	FB_ID to the same front-buffer FB on each atomic commit. This implies
+ *	to the driver that it needs to re-read the same FB again. Otherwise
+ *	drivers which do not employ continuously repeated scanout cycles might
+ *	not update the screen.

Should probably add a caveat that this needs to be a sync commit/flip. The way the async flip was specified for atomic explicitly requires the driver to ignore the plane when the fb doesn't change.

Also use dirtyfb instead if you don't want to get throttled to the vrefresh rate. Tthough I think with some drivers you might get throttled even with dirtyfb...

Quoted 6 lines
drivers/gpu/drm/drm_blend.c +0 -0
  * CRTC_ID:
  * 	Mode object ID of the &drm_crtc this plane should be connected to.
  *
Signature · 1 line
2.49.0
Signature · 2 lines
Ville Syrjälä
Intel
#6 lore raw
Quoted 31 lines · Ville Syrjälä
Quoted 16 lines · Simon Ser

Explain how to perform front-buffer rendering.

v2: apply Pekka's rewrite

Cc Pekka Paalanen <[email protected]>
Cc Simona Vetter <[email protected]>
---
 drivers/gpu/drm/drm_blend.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_blend.c +0 -0
index 6e74de833466..4e83f372ea51 100644

drivers/gpu/drm/drm_blend.c line 83

Quoted 9 lines
drivers/gpu/drm/drm_blend.c +6 -0
@@ -75,6 +75,12 @@
  * 	the currently visible vertical area of the &drm_crtc.
  * FB_ID:
  * 	Mode object ID of the &drm_framebuffer this plane should scan out.
+ *
+ *	When a KMS client is perfoming front-buffer rendering, it should set
+ *	FB_ID to the same front-buffer FB on each atomic commit. This implies
+ *	to the driver that it needs to re-read the same FB again. Otherwise
+ *	drivers which do not employ continuously repeated scanout cycles might
+ *	not update the screen.

Should probably add a caveat that this needs to be a sync commit/flip. The way the async flip was specified for atomic explicitly requires the driver to ignore the plane when the fb doesn't change.

Quoted 3 lines

Also use dirtyfb instead if you don't want to get throttled to the vrefresh rate. Tthough I think with some drivers you might get throttled even with dirtyfb...

Half the userspace wants throttling, the other half wants it gone so glxgears looks better. I don't think you want to recommend the dirtyfb ioctl for that reason at all, because it's just a ymmv ioctl in what exactly you get in terms of blocking.

It's funny.
-Sima

Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/drm_blend.c +0 -0
  * CRTC_ID:
  * 	Mode object ID of the &drm_crtc this plane should be connected to.
  *
Signature · 1 line
2.49.0
Signature · 2 lines
Ville Syrjälä
Intel
Signature · 3 lines
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author
#7 lore raw
In reply to Ville Syrjälä

Ah, sorry, I missed this message.

Quoted 3 lines · Ville Syrjälä

Should probably add a caveat that this needs to be a sync commit/flip. The way the async flip was specified for atomic explicitly requires the driver to ignore the plane when the fb doesn't change.

I don't believe so. Async flip should work fine with same FB. The kernel will only ignore other props if they match their previous value.

Quoted 3 lines

Also use dirtyfb instead if you don't want to get throttled to the vrefresh rate. Tthough I think with some drivers you might get throttled even with dirtyfb...

Like Simona, I'm really not a fan of mixing atomic and non-atomic. It's caused issues in the past, e.g. ChromeOS forcing amdgpu to reject atomic commits which could cause future cursor IOCTLs to fail.

#8 lore raw
Quoted 9 lines · Simon Ser

Ah, sorry, I missed this message.

Quoted 3 lines · Ville Syrjälä

Should probably add a caveat that this needs to be a sync commit/flip. The way the async flip was specified for atomic explicitly requires the driver to ignore the plane when the fb doesn't change.

I don't believe so. Async flip should work fine with same FB.

The way you specified this means the kernel has to explicitly ignore it because not all planes may support async flips. We can't generally mix async and sync stuff into the same commit.

Quoted 10 lines

The kernel
will only ignore other props if they match their previous value.

Quoted 3 lines

Also use dirtyfb instead if you don't want to get throttled to the vrefresh rate. Tthough I think with some drivers you might get throttled even with dirtyfb...

Like Simona, I'm really not a fan of mixing atomic and non-atomic. It's caused issues in the past, e.g. ChromeOS forcing amdgpu to reject atomic commits which could cause future cursor IOCTLs to fail.

Signature · 2 lines
Ville Syrjälä
Intel