Skip to contentSkip to conversation

drm/fb-helper: Add TODO for making drm_fb_helper_alloc_fbi fill apertures

PATCH In review Hans de Goede 2 participants 3 messages Mar 26, 2020 – Mar 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/fb-helper: Add TODO for making drm_fb_helper_alloc_fbi fill apertures

Currently drivers using drm_fbdev_generic_setup() end up with a single empty aperture in their fb_info struct.

Not having the proper info in the apertures list causes register_framebuffer to not remove conflicting framebuffers, which some drivers currently workaround by manually calling drm_fb_helper_remove_conflicting_pci_framebuffers().

Add a TODO as a reminder that we need to fix this.

---
 drivers/gpu/drm/drm_fb_helper.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +8 -0
index 4c7cbce7bae7..16b8dc38d022 100644
@@ -526,6 +526,14 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
 	if (ret)
 		goto err_release;
 
+	/*
+	 * TODO: We really should be smarter here and alloc an apperture
+	 * for each IORESOURCE_MEM resource helper->dev->dev has and also
+	 * init the ranges of the appertures based on the resources.
+	 * Note some drivers currently count on there being only 1 empty
+	 * aperture and fill this themselves, these will need to be dealt
+	 * with somehow when fixing this.
+	 */
 	info->apertures = alloc_apertures(1);
 	if (!info->apertures) {
 		ret = -ENOMEM;
Signature · 6 lines
2.26.0.rc2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Hans de Goede

Currently drivers using drm_fbdev_generic_setup() end up with a single empty aperture in their fb_info struct.

Not having the proper info in the apertures list causes register_framebuffer to not remove conflicting framebuffers, which some drivers currently workaround by manually calling drm_fb_helper_remove_conflicting_pci_framebuffers().

Add a TODO as a reminder that we need to fix this.

---
 drivers/gpu/drm/drm_fb_helper.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +0 -0
index 4c7cbce7bae7..16b8dc38d022 100644
@@ -526,6 +526,14 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
        if (ret)

drivers/gpu/drm/drm_fb_helper.c struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper) · line 536

Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +8 -0
                goto err_release;
 
+       /*
+        * TODO: We really should be smarter here and alloc an apperture
+        * for each IORESOURCE_MEM resource helper->dev->dev has and also
+        * init the ranges of the appertures based on the resources.
+        * Note some drivers currently count on there being only 1 empty
+        * aperture and fill this themselves, these will need to be dealt
+        * with somehow when fixing this.
+        */

Ah yes this is a bit more involved than first apperances suggest - we might want to have a dedicated solution for the generic_setup helper only, so we don't break all the other drivers using this function directly.

Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +0 -1
        info->apertures = alloc_apertures(1);
        if (!info->apertures) {
                ret = -ENOMEM;
--

2.26.0.rc2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi,

Quoted 39 lines · Daniel Vetter
Quoted 22 lines · Hans de Goede

Currently drivers using drm_fbdev_generic_setup() end up with a single empty aperture in their fb_info struct.

Not having the proper info in the apertures list causes register_framebuffer to not remove conflicting framebuffers, which some drivers currently workaround by manually calling drm_fb_helper_remove_conflicting_pci_framebuffers().

Add a TODO as a reminder that we need to fix this.

---
  drivers/gpu/drm/drm_fb_helper.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +0 -0
index 4c7cbce7bae7..16b8dc38d022 100644
@@ -526,6 +526,14 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
         if (ret)

drivers/gpu/drm/drm_fb_helper.c struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper) · line 536

Quoted 10 lines
drivers/gpu/drm/drm_fb_helper.c +8 -0
                 goto err_release;
 
+       /*
+        * TODO: We really should be smarter here and alloc an apperture
+        * for each IORESOURCE_MEM resource helper->dev->dev has and also
+        * init the ranges of the appertures based on the resources.
+        * Note some drivers currently count on there being only 1 empty
+        * aperture and fill this themselves, these will need to be dealt
+        * with somehow when fixing this.
+        */

Ah yes this is a bit more involved than first apperances suggest - we might want to have a dedicated solution for the generic_setup helper only, so we don't break all the other drivers using this function directly.

Quoted 1 line

Thank you, pushed to drm-misc-next.

Any chance you can perhaps take (another) look at:
https://patchwork.freedesktop.org/patch/340140/

? We had an interesting discussion about that which seems (to me) to end in agreement and you asking for more documentation. I replied to that that the patch already added some (but not much) documentation and then the discussion ended. I would still like to get this patch upstream, as I have a userspace patch (for plymouth) pending which depends on it.

Regards,

Hans

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel