diff mbox

vfb: fix video mode and line_length being set when loaded

Message ID 81bf0d1e-ee7a-29ea-d19e-ffeb41d285fe@national.shitposting.agency (mailing list archive)
State New, archived
Headers show

Commit Message

Pieter \"PoroCYon\" Sluys Dec. 20, 2017, 2:53 p.m. UTC
Geert Uytterhoeven:
> Please add your "Signed-off-by", cfr.
> Documentation/process/submitting-patches.rst.

Sorry I knew I would've messed up *something*.

> You can drop the tests for 2 and 4, as these are no longer used by the driver.

Done that.

Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Pieter "PoroCYon" Sluys <pcy@national.shitposting.agency>

---
 drivers/video/fbdev/vfb.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--
2.15.1
Fix vfb not setting the video mode and line_length when loaded.
Copyright 2017 Pieter "PoroCYon" Sluys <pcy@national.shitposting.agency>
under the terms of the GPLv2

Comments

Bartlomiej Zolnierkiewicz Jan. 4, 2018, 3:05 p.m. UTC | #1
On Wednesday, December 20, 2017 02:53:00 PM Pieter PoroCYon Sluys wrote:
> Geert Uytterhoeven:
> > Please add your "Signed-off-by", cfr.
> > Documentation/process/submitting-patches.rst.
> 
> Sorry I knew I would've messed up *something*.
> 
> > You can drop the tests for 2 and 4, as these are no longer used by the driver.
> 
> Done that.
> 
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Signed-off-by: Pieter "PoroCYon" Sluys <pcy@national.shitposting.agency>

I've queued your patch for 4.16 kernel (after fixing few minor
issues [*]), thanks!

[*] next time please remember to:

* always include full patch description in the later patch revisions

* put things that don't belong to patch description after "---" so
  they will not be included in the final commit

* in the later patch revisions include ChangeLog after "---" and also
  put patch version in the patch summary line / mail subject
  (i.e. "[PATCH v2] ...")

* add tags (i.e. "Reviewed-by: ...") from patch reviewers / testers
  into the patch description

* check your patch with scripts/checkpatch.pl tool and fix reported
  issues, i.e.:

ERROR: switch and case should be at the same indent
#69: FILE: drivers/video/fbdev/vfb.c:242:
+       switch (info->var.bits_per_pixel) {
+               case 1:
[...]
+               case 8:
[...]
+               case 16:
+               case 24:
+               case 32:

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

---
 drivers/video/fbdev/vfb.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/video/fbdev/vfb.c b/drivers/video/fbdev/vfb.c
index da653a080394..5fb360283c6b 100644
--- a/drivers/video/fbdev/vfb.c
+++ b/drivers/video/fbdev/vfb.c
@@ -239,8 +239,23 @@  static int vfb_check_var(struct fb_var_screeninfo *var,
  */
 static int vfb_set_par(struct fb_info *info)
 {
+	switch (info->var.bits_per_pixel) {
+		case 1:
+			info->fix.visual = FB_VISUAL_MONO01;
+			break;
+		case 8:
+			info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
+			break;
+		case 16:
+		case 24:
+		case 32:
+			info->fix.visual = FB_VISUAL_TRUECOLOR;
+			break;
+	}
+
 	info->fix.line_length = get_line_length(info->var.xres_virtual,
 						info->var.bits_per_pixel);
+
 	return 0;
 }
 
@@ -450,6 +465,8 @@  static int vfb_probe(struct platform_device *dev)
 		goto err2;
 	platform_set_drvdata(dev, info);
 
+	vfb_set_par(info);
+
 	fb_info(info, "Virtual frame buffer device, using %ldK of video memory\n",
 		videomemorysize >> 10);
 	return 0;
--
2.15.1