Document the interconnects property which is a list of interconnect
paths that is used by the framebuffer and therefore needs to be kept
alive when the framebuffer is being used.
Signed-off-by: Luca Weiss <redacted>
---
Documentation/devicetree/bindings/display/simple-framebuffer.yaml | 3 +++
1 file changed, 3 insertions(+)
@@ -79,6 +79,9 @@ properties:power-domains:description:List of power domains used by the framebuffer.+interconnects:+description:List of interconnect paths used by the framebuffer.+width:$ref:/schemas/types.yaml#/definitions/uint32description:Width of the framebuffer in pixels
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/gpu/drm/sysfb/simpledrm.c | 83 +++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
@@ -225,6 +226,10 @@ struct simpledrm_device {structdevice**pwr_dom_devs;structdevice_link**pwr_dom_links;#endif+#if defined CONFIG_OF && defined CONFIG_INTERCONNECT+unsignedinticc_count;+structicc_path**icc_paths;+#endif/* modesetting */u32formats[DRM_SYSFB_PLANE_NFORMATS(1)];
@@ -547,6 +552,81 @@ static int simpledrm_device_attach_genpd(struct simpledrm_device *sdev)}#endif+#if defined CONFIG_OF && defined CONFIG_PM_GENERIC_DOMAINS+/*+*Genericinterconnectpathhandlingcode.+*/+staticvoidsimpledrm_device_detach_icc(void*res)+{+structsimpledrm_device*sdev=res;+inti;++for(i=sdev->icc_count-1;i>=0;i--){+if(!IS_ERR_OR_NULL(sdev->icc_paths[i]))+icc_put(sdev->icc_paths[i]);+}+}++staticintsimpledrm_device_attach_icc(structsimpledrm_device*sdev)+{+structdevice*dev=sdev->sysfb.dev.dev;+intret,count,i;++count=of_count_phandle_with_args(dev->of_node,"interconnects",+"#interconnect-cells");+if(count<0)+return0;++/* An interconnect path consists of two elements */+if(count%2){+drm_err(&sdev->sysfb.dev,+"invalid interconnects value\n");+return-EINVAL;+}+sdev->icc_count=count/2;++sdev->icc_paths=devm_kcalloc(dev,sdev->icc_count,+sizeof(*sdev->icc_paths),+GFP_KERNEL);+if(!sdev->icc_paths)+return-ENOMEM;++for(i=0;i<sdev->icc_count;i++){+sdev->icc_paths[i]=of_icc_get_by_index(dev,i);+if(IS_ERR_OR_NULL(sdev->icc_paths[i])){+ret=PTR_ERR(sdev->icc_paths[i]);+if(ret==-EPROBE_DEFER)+gotoerr;+drm_err(&sdev->sysfb.dev,"failed to get interconnect path %u: %d\n",+i,ret);+continue;+}++ret=icc_set_bw(sdev->icc_paths[i],0,UINT_MAX);+if(ret){+drm_err(&sdev->sysfb.dev,"failed to set interconnect bandwidth %u: %d\n",+i,ret);+continue;+}+}++returndevm_add_action_or_reset(dev,simpledrm_device_detach_icc,sdev);++err:+while(i){+--i;+if(!IS_ERR_OR_NULL(sdev->icc_paths[i]))+icc_put(sdev->icc_paths[i]);+}+returnret;+}+#else+staticintsimpledrm_device_attach_icc(structsimpledrm_device*sdev)+{+return0;+}+#endif+/**Modesetting*/
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
@@ -89,6 +90,10 @@ struct simplefb_par {u32regulator_count;structregulator**regulators;#endif+#if defined CONFIG_OF && defined CONFIG_INTERCONNECT+unsignedinticc_count;+structicc_path**icc_paths;+#endif};staticvoidsimplefb_clocks_destroy(structsimplefb_par*par);
@@ -525,6 +530,80 @@ static int simplefb_attach_genpds(struct simplefb_par *par,}#endif+#if defined CONFIG_OF && defined CONFIG_PM_GENERIC_DOMAINS+/*+*Genericinterconnectpathhandlingcode.+*/+staticvoidsimplefb_detach_icc(void*res)+{+structsimplefb_par*par=res;+inti;++for(i=par->icc_count-1;i>=0;i--){+if(!IS_ERR_OR_NULL(par->icc_paths[i]))+icc_put(par->icc_paths[i]);+}+}++staticintsimplefb_attach_icc(structsimplefb_par*par,+structplatform_device*pdev)+{+structdevice*dev=&pdev->dev;+intret,count,i;++count=of_count_phandle_with_args(dev->of_node,"interconnects",+"#interconnect-cells");+if(count<0)+return0;++/* An interconnect path consists of two elements */+if(count%2){+dev_err(dev,"invalid interconnects value\n");+return-EINVAL;+}+par->icc_count=count/2;++par->icc_paths=devm_kcalloc(dev,par->icc_count,+sizeof(*par->icc_paths),+GFP_KERNEL);+if(!par->icc_paths)+return-ENOMEM;++for(i=0;i<par->icc_count;i++){+par->icc_paths[i]=of_icc_get_by_index(dev,i);+if(IS_ERR_OR_NULL(par->icc_paths[i])){+ret=PTR_ERR(par->icc_paths[i]);+if(ret==-EPROBE_DEFER)+gotoerr;+dev_err(dev,"failed to get interconnect path %u: %d\n",i,ret);+continue;+}++ret=icc_set_bw(par->icc_paths[i],0,UINT_MAX);+if(ret){+dev_err(dev,"failed to set interconnect bandwidth %u: %d\n",i,ret);+continue;+}+}++returndevm_add_action_or_reset(dev,simplefb_detach_icc,par);++err:+while(i){+--i;+if(!IS_ERR_OR_NULL(par->icc_paths[i]))+icc_put(par->icc_paths[i]);+}+returnret;+}+#else+staticintsimplefb_attach_icc(structsimplefb_par*par,+structplatform_device*pdev)+{+return0;+}+#endif+staticintsimplefb_probe(structplatform_device*pdev){intret;
@@ -615,6 +694,10 @@ static int simplefb_probe(struct platform_device *pdev)if(ret<0)gotoerror_regulators;+ret=simplefb_attach_icc(par,pdev);+if(ret<0)+gotoerror_regulators;+simplefb_clocks_enable(par,pdev);simplefb_regulators_enable(par,pdev);
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2025-06-20 11:01:26
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted hunk
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/gpu/drm/sysfb/simpledrm.c | 83 +++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
Alphabetical sorting please.
Apart from this nitpick, the patch looks good. For the update:
Reviewed-by: Thomas Zimmermann <tzimmermann>
Best regards
Thomas
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2025-06-20 11:02:16
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted hunk
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2025-06-20 11:03:32
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
Document the interconnects property which is a list of interconnect
paths that is used by the framebuffer and therefore needs to be kept
alive when the framebuffer is being used.
Signed-off-by: Luca Weiss <redacted>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Maybe also get someone with DT expertise to look over this patch as well.
Best regards
Thomas
@@ -79,6 +79,9 @@ properties:power-domains:description:List of power domains used by the framebuffer.+interconnects:+description:List of interconnect paths used by the framebuffer.+width:$ref:/schemas/types.yaml#/definitions/uint32description:Width of the framebuffer in pixels
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Hi Thomas,
On Fri Jun 20, 2025 at 1:02 PM CEST, Thomas Zimmermann wrote:
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
With alphabetical sorting:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the reviews!
For both simpledrm.c and simplefb.c, the includes are not strictly
alphabetically sorted (1 mis-sort in simpledrm, 3 in simplefb), shall I
just try and slot it into the best fitting place, or make them sorted in
my patch? Or I can add a separate commit for each driver before to sort
them.
Let me know!
Regards
Luca
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2025-06-20 11:28:55
Hi
Am 20.06.25 um 13:07 schrieb Luca Weiss:
Hi Thomas,
On Fri Jun 20, 2025 at 1:02 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
With alphabetical sorting:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the reviews!
For both simpledrm.c and simplefb.c, the includes are not strictly
alphabetically sorted (1 mis-sort in simpledrm, 3 in simplefb), shall I
just try and slot it into the best fitting place, or make them sorted in
my patch? Or I can add a separate commit for each driver before to sort
them.
Let me know!
Best is to try to fit it into the <linux/*> block. In simpledrm, it's
probably my mistake. Don't bother with sending an extra cleanup if you
don't want to.
Best regards
Thomas
On Fri Jun 20, 2025 at 1:28 PM CEST, Thomas Zimmermann wrote:
Hi
Am 20.06.25 um 13:07 schrieb Luca Weiss:
quoted
Hi Thomas,
On Fri Jun 20, 2025 at 1:02 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
With alphabetical sorting:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the reviews!
For both simpledrm.c and simplefb.c, the includes are not strictly
alphabetically sorted (1 mis-sort in simpledrm, 3 in simplefb), shall I
just try and slot it into the best fitting place, or make them sorted in
my patch? Or I can add a separate commit for each driver before to sort
them.
Let me know!
Best is to try to fit it into the <linux/*> block. In simpledrm, it's
probably my mistake. Don't bother with sending an extra cleanup if you
don't want to.
I was mostly asking whether this diff is okay as part of my patch (for
just adding <linux/interconnect.h>)
Or if you want this churn to be a separate commit. Either way is fine
with me, just trying to figure out the preferences of this subsystem :)
Regards
Luca
From: Thomas Zimmermann <tzimmermann@suse.de> Date: 2025-06-20 12:36:41
Hi
Am 20.06.25 um 14:07 schrieb Luca Weiss:
quoted hunk
On Fri Jun 20, 2025 at 1:28 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 13:07 schrieb Luca Weiss:
quoted
Hi Thomas,
On Fri Jun 20, 2025 at 1:02 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
With alphabetical sorting:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the reviews!
For both simpledrm.c and simplefb.c, the includes are not strictly
alphabetically sorted (1 mis-sort in simpledrm, 3 in simplefb), shall I
just try and slot it into the best fitting place, or make them sorted in
my patch? Or I can add a separate commit for each driver before to sort
them.
Let me know!
Best is to try to fit it into the <linux/*> block. In simpledrm, it's
probably my mistake. Don't bother with sending an extra cleanup if you
don't want to.
I was mostly asking whether this diff is okay as part of my patch (for
just adding <linux/interconnect.h>)
On Fri Jun 20, 2025 at 2:36 PM CEST, Thomas Zimmermann wrote:
Hi
Am 20.06.25 um 14:07 schrieb Luca Weiss:
quoted
On Fri Jun 20, 2025 at 1:28 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 13:07 schrieb Luca Weiss:
quoted
Hi Thomas,
On Fri Jun 20, 2025 at 1:02 PM CEST, Thomas Zimmermann wrote:
quoted
Hi
Am 20.06.25 um 12:31 schrieb Luca Weiss:
quoted
Some devices might require keeping an interconnect path alive so that
the framebuffer continues working. Add support for that by setting the
bandwidth requirements appropriately for all provided interconnect
paths.
Signed-off-by: Luca Weiss <redacted>
---
drivers/video/fbdev/simplefb.c | 83 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 83 insertions(+)
With alphabetical sorting:
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks for the reviews!
For both simpledrm.c and simplefb.c, the includes are not strictly
alphabetically sorted (1 mis-sort in simpledrm, 3 in simplefb), shall I
just try and slot it into the best fitting place, or make them sorted in
my patch? Or I can add a separate commit for each driver before to sort
them.
Let me know!
Best is to try to fit it into the <linux/*> block. In simpledrm, it's
probably my mistake. Don't bother with sending an extra cleanup if you
don't want to.
I was mostly asking whether this diff is okay as part of my patch (for
just adding <linux/interconnect.h>)
drivers/video/fbdev/simplefb.c:542:14: error: 'struct simplefb_par' has no member named 'icc_count'
542 | for (i = par->icc_count - 1; i >= 0; i--) {
| ^~
quoted
drivers/video/fbdev/simplefb.c:543:26: error: 'struct simplefb_par' has no member named 'icc_paths'
543 | if (!IS_ERR_OR_NULL(par->icc_paths[i]))
| ^~
drivers/video/fbdev/simplefb.c:544:15: error: 'struct simplefb_par' has no member named 'icc_paths'
544 | icc_put(par->icc_paths[i]);
| ^~
drivers/video/fbdev/simplefb.c: In function 'simplefb_attach_icc':
drivers/video/fbdev/simplefb.c:564:5: error: 'struct simplefb_par' has no member named 'icc_count'
564 | par->icc_count = count / 2;
| ^~
drivers/video/fbdev/simplefb.c:566:5: error: 'struct simplefb_par' has no member named 'icc_paths'
566 | par->icc_paths = devm_kcalloc(dev, par->icc_count,
| ^~
drivers/video/fbdev/simplefb.c:566:40: error: 'struct simplefb_par' has no member named 'icc_count'
566 | par->icc_paths = devm_kcalloc(dev, par->icc_count,
| ^~
drivers/video/fbdev/simplefb.c:567:22: error: 'struct simplefb_par' has no member named 'icc_paths'
567 | sizeof(*par->icc_paths),
| ^~
drivers/video/fbdev/simplefb.c:569:10: error: 'struct simplefb_par' has no member named 'icc_paths'
569 | if (!par->icc_paths)
| ^~
drivers/video/fbdev/simplefb.c:572:21: error: 'struct simplefb_par' has no member named 'icc_count'
572 | for (i = 0; i < par->icc_count; i++) {
| ^~
drivers/video/fbdev/simplefb.c:573:6: error: 'struct simplefb_par' has no member named 'icc_paths'
573 | par->icc_paths[i] = of_icc_get_by_index(dev, i);
| ^~
drivers/video/fbdev/simplefb.c:574:25: error: 'struct simplefb_par' has no member named 'icc_paths'
574 | if (IS_ERR_OR_NULL(par->icc_paths[i])) {
| ^~
drivers/video/fbdev/simplefb.c:575:21: error: 'struct simplefb_par' has no member named 'icc_paths'
575 | ret = PTR_ERR(par->icc_paths[i]);
| ^~
drivers/video/fbdev/simplefb.c:582:23: error: 'struct simplefb_par' has no member named 'icc_paths'
582 | ret = icc_set_bw(par->icc_paths[i], 0, UINT_MAX);
| ^~
drivers/video/fbdev/simplefb.c:594:26: error: 'struct simplefb_par' has no member named 'icc_paths'
594 | if (!IS_ERR_OR_NULL(par->icc_paths[i]))
| ^~
drivers/video/fbdev/simplefb.c:595:15: error: 'struct simplefb_par' has no member named 'icc_paths'
595 | icc_put(par->icc_paths[i]);
| ^~
vim +542 drivers/video/fbdev/simplefb.c
532
533 #if defined CONFIG_OF && defined CONFIG_PM_GENERIC_DOMAINS
534 /*
535 * Generic interconnect path handling code.
536 */
537 static void simplefb_detach_icc(void *res)
538 {
539 struct simplefb_par *par = res;
540 int i;
541
> 542 for (i = par->icc_count - 1; i >= 0; i--) {
> 543 if (!IS_ERR_OR_NULL(par->icc_paths[i]))
544 icc_put(par->icc_paths[i]);
545 }
546 }
547
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki