Skip to contentSkip to conversation

Revert "drm/fb-helper: improve DRM fbdev emulation device names"

PATCH Superseded Javier Martinez Canillas 3 participants 4 messages Oct 8, 2021 – Oct 20, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/fb-helper: improve DRM fbdev emulation device names"

This reverts commit b3484d2b03e4c940a9598aa841a52d69729c582a.

That change attempted to improve the DRM drivers fbdev emulation device names to avoid having confusing names like "simpledrmdrmfb" in /proc/fb.

But unfortunately there are user-space programs, such as pm-utils that query that information and so broke after the mentioned commit. Since the names in /proc/fb are used programs that consider it an ABI, let's restore the old names even when this lead to silly naming like the one mentioned above as an example.

---

 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 3ab07832104..8993b02e783 100644
@@ -1737,7 +1737,7 @@ void drm_fb_helper_fill_info(struct fb_info *info,
 			       sizes->fb_width, sizes->fb_height);
 
 	info->par = fb_helper;
-	snprintf(info->fix.id, sizeof(info->fix.id), "%s",
+	snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
 		 fb_helper->dev->driver->name);
 
 }
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Javier Martinez Canillas

This reverts commit b3484d2b03e4c940a9598aa841a52d69729c582a.

That change attempted to improve the DRM drivers fbdev emulation device names to avoid having confusing names like "simpledrmdrmfb" in /proc/fb.

But unfortunately there are user-space programs, such as pm-utils that query that information and so broke after the mentioned commit. Since the names in /proc/fb are used programs that consider it an ABI, let's restore the old names even when this lead to silly naming like the one mentioned above as an example.

The usage Johannes listed was this specificially:
using_kms() { grep -q -E '(nouveau|drm)fb' /proc/fb; }

So it actually looks like Daniel's
commit f243dd06180a ("drm/nouveau: Use drm_fb_helper_fill_info") also broke the abi. But for the pm-utils use case at least just having the "drmfb" in there should cover even nouveau.

Quoted 23 lines

---

 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +1 -1
index 3ab07832104..8993b02e783 100644
@@ -1737,7 +1737,7 @@ void drm_fb_helper_fill_info(struct fb_info *info,
 			       sizes->fb_width, sizes->fb_height);
 
 	info->par = fb_helper;
-	snprintf(info->fix.id, sizeof(info->fix.id), "%s",
+	snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
 		 fb_helper->dev->driver->name);
 
 }
Signature · 1 line
2.31.1
Signature · 2 lines
Ville Syrjälä
Intel
#2 lore raw
Quoted 38 lines · Ville Syrjälä
Quoted 10 lines · Javier Martinez Canillas

This reverts commit b3484d2b03e4c940a9598aa841a52d69729c582a.

That change attempted to improve the DRM drivers fbdev emulation device names to avoid having confusing names like "simpledrmdrmfb" in /proc/fb.

But unfortunately there are user-space programs, such as pm-utils that query that information and so broke after the mentioned commit. Since the names in /proc/fb are used programs that consider it an ABI, let's restore the old names even when this lead to silly naming like the one mentioned above as an example.

The usage Johannes listed was this specificially:
using_kms() { grep -q -E '(nouveau|drm)fb' /proc/fb; }

So it actually looks like Daniel's
commit f243dd06180a ("drm/nouveau: Use drm_fb_helper_fill_info") also broke the abi. But for the pm-utils use case at least just having the "drmfb" in there should cover even nouveau.

Quoted 15 lines

---

 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_fb_helper.c +0 -0
index 3ab07832104..8993b02e783 100644
@@ -1737,7 +1737,7 @@ void drm_fb_helper_fill_info(struct fb_info *info,
 			       sizes->fb_width, sizes->fb_height);
 
Quoted 2 lines

drivers/gpu/drm/drm_fb_helper.c void drm_fb_helper_fill_info(struct fb_info *info, · line 1740

Quoted 2 lines
drivers/gpu/drm/drm_fb_helper.c +0 -1
 	info->par = fb_helper;
-	snprintf(info->fix.id, sizeof(info->fix.id), "%s",

Please add a comment here that drmfb is uapi because pm-utils matches against it ...

Otherwise this will be lost in time again :-(
-Daniel

Quoted 10 lines
Quoted 6 lines
drivers/gpu/drm/drm_fb_helper.c +1 -0
+	snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
 		 fb_helper->dev->driver->name);
 
 }
Signature · 1 line
2.31.1
Signature · 2 lines
Ville Syrjälä
Intel
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#3 lore raw

Hello Daniel,

Quoted 7 lines · Daniel Vetter
Quoted 3 lines

drivers/gpu/drm/drm_fb_helper.c void drm_fb_helper_fill_info(struct fb_info *info, · line 1740

Quoted 3 lines
drivers/gpu/drm/drm_fb_helper.c +0 -1
 	info->par = fb_helper;
-	snprintf(info->fix.id, sizeof(info->fix.id), "%s",

Please add a comment here that drmfb is uapi because pm-utils matches against it ...

Sure, I'll do that and send a v2.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Linux Engineering
Red Hat