From: "Pieter \"PoroCYon\" Sluys" <pcy@national.shitposting.agency>
To: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] vfb: fix video mode and line_length being set when loaded
Date: Wed, 20 Dec 2017 14:53:00 +0000 [thread overview]
Message-ID: <81bf0d1e-ee7a-29ea-d19e-ffeb41d285fe@national.shitposting.agency> (raw)
In-Reply-To: <CAMuHMdXjkY=6=CDMPNFtxtjw8g52ivV-HdnKX3-mao0TPTabMw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]
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(+)
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
[-- Attachment #2: README --]
[-- Type: text/plain, Size: 166 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: vfb.c.patch --]
[-- Type: text/x-patch; name="vfb.c.patch", Size: 1089 bytes --]
---
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
next prev parent reply other threads:[~2017-12-20 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 0:24 [PATCH] vfb: fix video mode and line_length being set when loaded Pieter "PoroCYon" Sluys
2017-12-20 8:26 ` Geert Uytterhoeven
2017-12-20 14:53 ` Pieter "PoroCYon" Sluys [this message]
2018-01-04 15:05 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81bf0d1e-ee7a-29ea-d19e-ffeb41d285fe@national.shitposting.agency \
--to=pcy@national.shitposting.agency \
--cc=b.zolnierkie@samsung.com \
--cc=geert@linux-m68k.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox