Skip to contentSkip to conversation

simplefb: print some info about the registered fb

PATCH New Tom Gundersen 5 participants 9 messages Sep 6, 2013 – Oct 9, 2013 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 simplefb: print some info about the registered fb

This is similar to the output printed by efifb.

Cc Stephen Warren <[email protected]>
Cc David Herrmann <[email protected]>
---
 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +8 -0
index 8d78106..4196686 100644
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = (void *)(info + 1);
 
+	dev_info(&pdev->dev, "framebuffer at 0x%lx, mapped to 0x%p\n",
+			     info->fix.smem_start, info->screen_base);
+	dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+			     params.format->name,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel,
+			     info->fix.line_length);
+
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/1 simplefb: print some info about the registered fb

This is similar to the output printed by efifb.

Cc Stephen Warren <[email protected]>
Cc David Herrmann <[email protected]>

---

Hi,

Sorry for the resend, got the ml address wrong.

-t

 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +8 -0
index 8d78106..4196686 100644
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = (void *)(info + 1);
 
+	dev_info(&pdev->dev, "framebuffer at 0x%lx, mapped to 0x%p\n",
+			     info->fix.smem_start, info->screen_base);
+	dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+			     params.format->name,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel,
+			     info->fix.line_length);
+
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
Signature · 1 line
1.8.4
#3 lore raw
In reply to Tom Gundersen

Hi Tom

Quoted 21 lines · Tom Gundersen

This is similar to the output printed by efifb.

Cc Stephen Warren <[email protected]>
Cc David Herrmann <[email protected]>

---

Hi,

Sorry for the resend, got the ml address wrong.

(quoted diff) +0 -1
-t
 
 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +0 -0
index 8d78106..4196686 100644

drivers/video/simplefb.c static int simplefb_probe(struct platform_device *pdev) · line 224

Quoted 5 lines
drivers/video/simplefb.c +2 -0
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
        }
        info->pseudo_palette = (void *)(info + 1);
 
+       dev_info(&pdev->dev, "framebuffer at 0x%lx, mapped to 0x%p\n",
+                            info->fix.smem_start, info->screen_base);

Could we get smem_len, too? Something like:

      dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%lx bytes, mapped
to 0x%p\n",
                           info->fix.smem_start, (unsigned

long)info->fix.smem_len, info->screen_base);

(smem_len is __u32, so cast it to avoid truncation if it's defined as long somewhere. Not sure whether we actually have 16bit int somewhere, though)

Cheers
David

Quoted 12 lines
drivers/video/simplefb.c +6 -1
+       dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+                            params.format->name,
+                            info->var.xres, info->var.yres,
+                            info->var.bits_per_pixel,
+                            info->fix.line_length);
+
        ret = register_framebuffer(info);
        if (ret < 0) {
                dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
--

1.8.4

#4 lore raw

PATCH v2 1/1 simplefb: print some info about the registered fb

This is similar to the output printed by efifb.

---

v2: also print smem_len as requested by David

 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +8 -0
index 8d78106..80cf074 100644
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = (void *)(info + 1);
 
+	dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%lx bytes, mapped to 0x%p\n",
+			     info->fix.smem_start, (unsigned long) info->fix.smem_len,
+			     info->screen_base);
+	dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+			     params.format->name,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel, info->fix.line_length);
+
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
Signature · 1 line
1.8.4
#5 lore raw

drivers/video/simplefb.c static int simplefb_probe(struct platform_device *pdev) · line 224

Quoted 2 lines · Tom Gundersen
drivers/video/simplefb.c +2 -0
+       dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%lx bytes, mapped to 0x%p\n",
+                            info->fix.smem_start, (unsigned long) info->fix.smem_len,

Please drop the cast, and use 0x%x. __u32 is unsigned int everywhere (where it matters --- we don't do 16-bit ints).

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#6 lore raw

PATCH v3 1/1 simplefb: print some info about the registered fb

This is similar to the output printed by efifb.

---
v2: also print smem_len, as requested by David
v3: don't cast, as requested by Geert

 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +8 -0
index a29f1c4..50cbceb 100644
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = (void *)(info + 1);
 
+	dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",
+			     info->fix.smem_start, info->fix.smem_len,
+			     info->screen_base);
+	dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+			     params.format->name,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel, info->fix.line_length);
+
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
Signature · 1 line
1.8.4
#8 lore raw
In reply to Tom Gundersen
Quoted 22 lines · Tom Gundersen

This is similar to the output printed by efifb.

---
v2: also print smem_len, as requested by David
v3: don't cast, as requested by Geert

 drivers/video/simplefb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/video/simplefb.c +1 -0
index a29f1c4..50cbceb 100644
@@ -220,6 +220,14 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = (void *)(info + 1);
 
+	dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",

drivers/video/simplefb.c static int simplefb_probe(struct platform_device *pdev) · line 233

Quoted 10 lines
drivers/video/simplefb.c +7 -0
+			     info->fix.smem_start, info->fix.smem_len,
+			     info->screen_base);
+	dev_info(&pdev->dev, "format=%s, mode=%dx%dx%d, linelength=%d\n",
+			     params.format->name,
+			     info->var.xres, info->var.yres,
+			     info->var.bits_per_pixel, info->fix.line_length);
+
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);

Thanks, queued for 3.13.

Tomi