From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 08/13] fb: i.MX IPU: move fb_info initialization to a single function
Date: Fri, 22 Oct 2010 15:15:26 +0200 [thread overview]
Message-ID: <1287753331-7696-9-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1287753331-7696-1-git-send-email-s.hauer@pengutronix.de>
The bitfield information was only added to fb_info when the
framebuffer actually was enabled. That made it impossible to
call 'bmp' before enabling the display.
So, move all fb_info init to a single place and make it a function
to better allow for multiple displays later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/video/imx-ipu-fb.c | 63 ++++++++++++++++++++++++-------------------
1 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 399af75..08036aa 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -729,7 +729,6 @@ static void sdc_enable_channel(struct ipu_fb_info *fbi, void *fbmem)
static int mx3fb_set_par(struct fb_info *info)
{
struct ipu_fb_info *fbi = info->priv;
- struct imx_ipu_fb_rgb *rgb;
struct fb_videomode *mode = info->mode;
int ret;
@@ -740,29 +739,6 @@ static int mx3fb_set_par(struct fb_info *info)
reg_write(fbi, (mode->left_margin << 16) | mode->upper_margin,
SDC_BG_POS);
- switch (info->bits_per_pixel) {
- case 32:
- rgb = &def_rgb_32;
- break;
- case 24:
- rgb = &def_rgb_24;
- break;
- case 16:
- default:
- rgb = &def_rgb_16;
- break;
- }
-
- /*
- * Copy the RGB parameters for this display
- * from the machine specific parameters.
- */
- info->red = rgb->red;
- info->green = rgb->green;
- info->blue = rgb->blue;
- info->transp = rgb->transp;
-
-
return 0;
}
@@ -853,6 +829,39 @@ static struct fb_ops imxfb_ops = {
.fb_disable = ipu_fb_disable,
};
+static void imxfb_init_info(struct fb_info *info, struct fb_videomode *mode,
+ int bpp)
+{
+ struct imx_ipu_fb_rgb *rgb;
+
+ info->mode = mode;
+ info->xres = mode->xres;
+ info->yres = mode->yres;
+ info->bits_per_pixel = bpp;
+
+ switch (info->bits_per_pixel) {
+ case 32:
+ rgb = &def_rgb_32;
+ break;
+ case 24:
+ rgb = &def_rgb_24;
+ break;
+ case 16:
+ default:
+ rgb = &def_rgb_16;
+ break;
+ }
+
+ /*
+ * Copy the RGB parameters for this display
+ * from the machine specific parameters.
+ */
+ info->red = rgb->red;
+ info->green = rgb->green;
+ info->blue = rgb->blue;
+ info->transp = rgb->transp;
+}
+
static int imxfb_probe(struct device_d *dev)
{
struct ipu_fb_info *fbi;
@@ -869,13 +878,11 @@ static int imxfb_probe(struct device_d *dev)
fbi->regs = (void *)dev->map_base;
fbi->dev = dev;
info->priv = fbi;
- info->mode = pdata->mode;
- info->xres = pdata->mode->xres;
- info->yres = pdata->mode->yres;
- info->bits_per_pixel = pdata->bpp;
info->fbops = &imxfb_ops;
fbi->enable = pdata->enable;
+ imxfb_init_info(info, pdata->mode, pdata->bpp);
+
dev_info(dev, "i.MX Framebuffer driver\n");
/*
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-10-22 13:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 13:15 more patches for next Sascha Hauer
2010-10-22 13:15 ` [PATCH 01/13] ARM pca100: Use a flash bbt Sascha Hauer
2010-10-22 13:15 ` [PATCH 02/13] i.MX nand: optimize nand boot code for size Sascha Hauer
2010-10-22 13:15 ` [PATCH 03/13] mci-core: add multiple block support Sascha Hauer
2010-10-22 13:40 ` Juergen Beisert
2010-10-22 14:03 ` Juergen Beisert
2010-10-22 13:15 ` [PATCH 04/13] i.MX51: Fix mmcclk rate Sascha Hauer
2010-10-22 13:15 ` [PATCH 05/13] i.MX esdctl: Add register bits from redboot Sascha Hauer
2010-10-22 13:15 ` [PATCH 06/13] i.MX35 regs: Add watchdog base Sascha Hauer
2010-10-22 13:15 ` [PATCH 07/13] fb: i.MX IPU: remove unnecessary printf Sascha Hauer
2010-10-22 13:15 ` Sascha Hauer [this message]
2010-10-22 13:15 ` [PATCH 09/13] fb: i.MX IPU: fold mx3fb_set_par into its only user Sascha Hauer
2010-10-22 13:15 ` [PATCH 10/13] mci: align data for commands Sascha Hauer
2010-10-22 13:41 ` Juergen Beisert
2010-10-22 13:15 ` [PATCH 11/13] ARM: Add Garz+Fricke Cupid board support Sascha Hauer
2010-10-22 13:15 ` [PATCH 12/13] defaultenv: fix mtdparts Sascha Hauer
2010-10-22 13:15 ` [PATCH 13/13] ARM: Add defconfig for Garz+Fricke cupid board Sascha Hauer
2010-10-26 9:20 ` more patches for next Juergen Beisert
2010-10-26 9:48 ` Marc Kleine-Budde
2010-10-26 18:58 ` Sascha Hauer
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=1287753331-7696-9-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.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