From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Heiko Schocher <hs-ynQEQJNshbs@public.gmane.org>
Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Vincent Sanders <vince-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>,
Randy Dunlap <rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>,
Paul Mundt <lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org>
Subject: Re: [PATCH v6 3/6] video, sm501: add edid and commandline support
Date: Mon, 2 May 2011 16:27:16 -0600 [thread overview]
Message-ID: <20110502222716.GB15187@ponder.secretlab.ca> (raw)
In-Reply-To: <1300782452-528-4-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
On Tue, Mar 22, 2011 at 09:27:29AM +0100, Heiko Schocher wrote:
> - add commandline options:
> sm501fb.mode:
> Specify resolution as "<xres>x<yres>[-<bpp>][@<refresh>]"
> sm501fb.bpp:
> Specify bit-per-pixel if not specified mode
>
> - Add support for encoding display mode information
> in the device tree using verbatim EDID block.
>
> If the "edid" entry in the "smi,sm501" node is present,
> the driver will build mode database using EDID data
> and allow setting the display modes from this database.
>
> Signed-off-by: Heiko Schocher <hs-ynQEQJNshbs@public.gmane.org>
Merged, thanks.
g.
> cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> cc: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
> cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
> cc: Ben Dooks <ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
> cc: Vincent Sanders <vince-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
> cc: Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> cc: Randy Dunlap <rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
> cc: Wolfgang Denk <wd-ynQEQJNshbs@public.gmane.org>
> cc: Paul Mundt <lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
> ---
> - changes since v1:
> add Ben Dooks, Vincent Sanders and Samuel Ortiz to cc, as suggested from
> Paul Mundt.
> - changes since v2:
> add comments from Randy Dunlap:
> - move parameter documentation to Documentation/fb/sm501.txt
> - changes since v3:
> - rebased against v2.6.38-rc2
> - split in 3 patches
> - of support patch
> - i/o routine patch
> - edid support patch
> - changes since v4:
> - add "info->pdata = &sm501fb_def_pdata;" in sm501fb_probe()
> as Paul Mundt suggested (and I wrongly deleted)
> - move kfree(info->edid_data); to patch 3/4
> as edid_data is only allocated in the CONFIG_OF case
> - changes for v6:
> - repost complete patchserie
> - rebased against current head
>
> Documentation/fb/sm501.txt | 10 +++++++
> drivers/video/sm501fb.c | 65 ++++++++++++++++++++++++++++++++++++++++---
> 2 files changed, 70 insertions(+), 5 deletions(-)
> create mode 100644 Documentation/fb/sm501.txt
>
> diff --git a/Documentation/fb/sm501.txt b/Documentation/fb/sm501.txt
> new file mode 100644
> index 0000000..8d17aeb
> --- /dev/null
> +++ b/Documentation/fb/sm501.txt
> @@ -0,0 +1,10 @@
> +Configuration:
> +
> +You can pass the following kernel command line options to sm501 videoframebuffer:
> +
> + sm501fb.bpp= SM501 Display driver:
> + Specifiy bits-per-pixel if not specified by 'mode'
> +
> + sm501fb.mode= SM501 Display driver:
> + Specify resolution as
> + "<xres>x<yres>[-<bpp>][@<refresh>]"
> diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
> index 5df406c..f31252c 100644
> --- a/drivers/video/sm501fb.c
> +++ b/drivers/video/sm501fb.c
> @@ -41,6 +41,26 @@
> #include <linux/sm501.h>
> #include <linux/sm501-regs.h>
>
> +#include "edid.h"
> +
> +static char *fb_mode = "640x480-16@60";
> +static unsigned long default_bpp = 16;
> +
> +static struct fb_videomode __devinitdata sm501_default_mode = {
> + .refresh = 60,
> + .xres = 640,
> + .yres = 480,
> + .pixclock = 20833,
> + .left_margin = 142,
> + .right_margin = 13,
> + .upper_margin = 21,
> + .lower_margin = 1,
> + .hsync_len = 69,
> + .vsync_len = 3,
> + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + .vmode = FB_VMODE_NONINTERLACED
> +};
> +
> #define NR_PALETTE 256
>
> enum sm501_controller {
> @@ -77,6 +97,7 @@ struct sm501fb_info {
> void __iomem *regs2d; /* 2d remapped registers */
> void __iomem *fbmem; /* remapped framebuffer */
> size_t fbmem_len; /* length of remapped region */
> + u8 *edid_data;
> };
>
> /* per-framebuffer private data */
> @@ -1725,9 +1746,16 @@ static int sm501fb_init_fb(struct fb_info *fb,
> fb->var.vmode = FB_VMODE_NONINTERLACED;
> fb->var.bits_per_pixel = 16;
>
> + if (info->edid_data) {
> + /* Now build modedb from EDID */
> + fb_edid_to_monspecs(info->edid_data, &fb->monspecs);
> + fb_videomode_to_modelist(fb->monspecs.modedb,
> + fb->monspecs.modedb_len,
> + &fb->modelist);
> + }
> +
> if (enable && (pd->flags & SM501FB_FLAG_USE_INIT_MODE) && 0) {
> /* TODO read the mode from the current display */
> -
> } else {
> if (pd->def_mode) {
> dev_info(info->dev, "using supplied mode\n");
> @@ -1737,12 +1765,34 @@ static int sm501fb_init_fb(struct fb_info *fb,
> fb->var.xres_virtual = fb->var.xres;
> fb->var.yres_virtual = fb->var.yres;
> } else {
> - ret = fb_find_mode(&fb->var, fb,
> + if (info->edid_data)
> + ret = fb_find_mode(&fb->var, fb, fb_mode,
> + fb->monspecs.modedb,
> + fb->monspecs.modedb_len,
> + &sm501_default_mode, default_bpp);
> + else
> + ret = fb_find_mode(&fb->var, fb,
> NULL, NULL, 0, NULL, 8);
>
> - if (ret == 0 || ret == 4) {
> - dev_err(info->dev,
> - "failed to get initial mode\n");
> + switch (ret) {
> + case 1:
> + dev_info(info->dev, "using mode specified in "
> + "@mode\n");
> + break;
> + case 2:
> + dev_info(info->dev, "using mode specified in "
> + "@mode with ignored refresh rate\n");
> + break;
> + case 3:
> + dev_info(info->dev, "using mode default "
> + "mode\n");
> + break;
> + case 4:
> + dev_info(info->dev, "using mode from list\n");
> + break;
> + default:
> + dev_info(info->dev, "ret = %d\n", ret);
> + dev_info(info->dev, "failed to find mode\n");
> return -EINVAL;
> }
> }
> @@ -2157,6 +2207,11 @@ static void __exit sm501fb_cleanup(void)
> module_init(sm501fb_init);
> module_exit(sm501fb_cleanup);
>
> +module_param_named(mode, fb_mode, charp, 0);
> +MODULE_PARM_DESC(mode,
> + "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
> +module_param_named(bpp, default_bpp, ulong, 0);
> +MODULE_PARM_DESC(bpp, "Specify bit-per-pixel if not specified mode");
> MODULE_AUTHOR("Ben Dooks, Vincent Sanders");
> MODULE_DESCRIPTION("SM501 Framebuffer driver");
> MODULE_LICENSE("GPL v2");
> --
> 1.7.4
>
next prev parent reply other threads:[~2011-05-02 22:27 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-04 8:23 [PATCH 1/2] video, sm501: add OF binding to support SM501 Heiko Schocher
2010-12-08 5:36 ` Paul Mundt
2010-12-09 6:49 ` Heiko Schocher
2010-12-09 15:03 ` Samuel Ortiz
2010-12-11 6:31 ` [PATCH v2 " Heiko Schocher
2010-12-11 18:28 ` Randy Dunlap
2010-12-11 22:34 ` Randy Dunlap
2010-12-13 7:01 ` Heiko Schocher
2011-01-06 4:47 ` Paul Mundt
2011-01-24 9:57 ` [PATCH 2/4 v4] video, sm501: add edid and commandline support Heiko Schocher
[not found] ` <1295863047-11131-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
2011-01-25 7:51 ` Paul Mundt
[not found] ` <20110125075104.GJ11673-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
2011-01-25 8:04 ` Heiko Schocher
2011-01-24 9:57 ` [PATCH 3/4 v4] video, sm501: add OF binding to support SM501 Heiko Schocher
2011-01-25 6:38 ` Paul Mundt
2011-01-31 10:52 ` Samuel Ortiz
2011-01-25 7:20 ` Heiko Schocher
2011-01-25 7:48 ` Paul Mundt
[not found] ` <20110125074820.GI11673-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
2011-01-25 8:02 ` Heiko Schocher
2011-01-26 7:21 ` [PATCH 2/4 v5] video, sm501: add edid and commandline support Heiko Schocher
2011-01-26 7:21 ` [PATCH 3/4 v5] video, sm501: add OF binding to support SM501 Heiko Schocher
2011-03-15 7:26 ` Heiko Schocher
2011-03-16 15:36 ` Paul Mundt
[not found] ` <20110316153601.GA13315-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
2011-03-17 6:12 ` Heiko Schocher
2011-03-22 8:20 ` Paul Mundt
[not found] ` <20110322082047.GG25925-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>
2011-03-22 8:25 ` Heiko Schocher
2011-02-06 23:45 ` [PATCH 1/2] " Benjamin Herrenschmidt
[not found] ` <1291451028-22532-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
2011-01-24 9:57 ` [PATCH 1/4 v4] video, sm501: add I/O functions for use on powerpc Heiko Schocher
2011-01-31 10:50 ` Samuel Ortiz
2011-03-22 8:27 ` [PATCH v6 0/6] powerpc, 52xx: add charon board support Heiko Schocher
2011-03-22 8:27 ` [PATCH v1 1/6] powerpc, 5200: add support for charon board Heiko Schocher
2011-03-22 9:06 ` Wolfram Sang
2011-03-22 8:27 ` [PATCH v6 2/6] video, sm501: add I/O functions for use on powerpc Heiko Schocher
[not found] ` <1300782452-528-3-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
2011-05-02 22:24 ` Grant Likely
[not found] ` <1300782452-528-1-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
2011-03-22 8:27 ` [PATCH v6 3/6] video, sm501: add edid and commandline support Heiko Schocher
[not found] ` <1300782452-528-4-git-send-email-hs-ynQEQJNshbs@public.gmane.org>
2011-05-02 22:27 ` Grant Likely [this message]
2011-05-02 22:37 ` Grant Likely
2011-05-03 5:27 ` Heiko Schocher
2011-05-03 5:43 ` Grant Likely
2011-03-22 8:27 ` [PATCH v6 6/6] powerpc, tqm5200: update tqm5200_defconfig to fit for charon board Heiko Schocher
2011-03-22 9:10 ` Wolfram Sang
2011-05-02 22:31 ` Grant Likely
2011-03-22 8:27 ` [PATCH v6 4/6] video, sm501: add OF binding to support SM501 Heiko Schocher
2011-05-02 22:28 ` Grant Likely
2011-03-22 8:27 ` [PATCH v6 5/6] powerpc, video: add SM501 support for charon board Heiko Schocher
2011-03-22 20:58 ` [PATCH v6 0/6] powerpc, 52xx: add charon board support Grant Likely
2011-05-02 22:14 ` Grant Likely
2011-05-03 5:17 ` Heiko Schocher
2011-05-03 5:42 ` Grant Likely
2011-05-03 7:24 ` Heiko Schocher
2011-05-03 13:22 ` Grant Likely
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=20110502222716.GB15187@ponder.secretlab.ca \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=ben-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org \
--cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
--cc=hs-ynQEQJNshbs@public.gmane.org \
--cc=lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org \
--cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=rdunlap-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=vince-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org \
--cc=wd-ynQEQJNshbs@public.gmane.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;
as well as URLs for NNTP newsgroup(s).