From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] Add i.MX5 framebuffer driver
Date: Thu, 14 Apr 2011 10:49:51 +0200 [thread overview]
Message-ID: <20110414084951.GX7285@pengutronix.de> (raw)
In-Reply-To: <1302710016-3569-3-git-send-email-weitway@gmail.com>
Hi Jason,
On Wed, Apr 13, 2011 at 11:53:32PM +0800, weitway at gmail.com wrote:
>
> +
> +static int imx_ipu_fb_map_video_memory(struct fb_info *fbi)
> +{
> + int size;
> +
> + size = fbi->var.yres_virtual * fbi->fix.line_length;
> +
> + if (fbi->screen_base) {
> + if (fbi->fix.smem_len >= size)
> + return 0;
> +
> + dma_free_writecombine(fbi->device, fbi->fix.smem_len,
> + fbi->screen_base, fbi->fix.smem_start);
> + }
> +
> + fbi->screen_base = dma_alloc_writecombine(fbi->device,
> + size,
> + (dma_addr_t *)&fbi->fix.smem_start,
> + GFP_DMA);
> + if (fbi->screen_base == 0) {
> + dev_err(fbi->device, "Unable to allocate framebuffer memory (%d)\n",
> + fbi->fix.smem_len);
> + fbi->fix.smem_len = 0;
> + fbi->fix.smem_start = 0;
> + return -ENOMEM;
> + }
On which version of the driver I posted did you base this on? At least
in the last version removed this remapping feature.
You don't know whether the framebuffer is still mapped somewhere, so
you can't reallocate the framebuffer memory without corrupting your
memory. Simple test: run fbtest on one console, switch to a higher
resolution on another console and see your board go down...
IMO the only sane solution is to allocate memory for the largest
possible resolution at probe time.
> +
> + INIT_LIST_HEAD(&fbi->modelist);
> + for (i = 0; i < plat_data->num_modes; i++)
> + fb_add_videomode(&plat_data->modes[i], &fbi->modelist);
> +
> + /*if (plat_data->flags & IMX_IPU_FB_USE_MODEDB) {
> + for (i = 0; i < num_fb_modes; i++)
> + fb_add_videomode(&fb_modes[i], &fbi->modelist);
> + }*/
> +
You should remove this.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2011-04-14 8:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 15:53 [PATCH 1/7] Add a mfd IPUv3 driver weitway at gmail.com
2011-04-13 15:53 ` [PATCH 2/7] ARM i.MX5: Add IPU device support weitway at gmail.com
2011-04-14 9:25 ` Sascha Hauer
2011-04-14 12:40 ` Jason Chen
2011-04-13 15:53 ` [PATCH 3/7] Add i.MX5 framebuffer driver weitway at gmail.com
2011-04-14 8:49 ` Sascha Hauer [this message]
2011-04-13 15:53 ` [PATCH 4/7] ARM i.MX51 babbage: Add framebuffer support weitway at gmail.com
2011-04-13 15:53 ` [PATCH 5/7] ARM i.MX53 loco: " weitway at gmail.com
2011-04-14 8:57 ` Sascha Hauer
2011-04-14 9:01 ` Chen Jie-B02280
2011-04-14 9:12 ` Sascha Hauer
2011-04-14 12:37 ` Jason Chen
2011-04-13 15:53 ` [PATCH 6/7] ARM i.MX53: add pwm devices support weitway at gmail.com
2011-04-13 15:53 ` [PATCH 7/7] ARM: i.MX53 loco: add pwm backlight device weitway at gmail.com
2011-04-14 9:08 ` [PATCH 1/7] Add a mfd IPUv3 driver Sascha Hauer
-- strict thread matches above, loose matches on Subject: below --
2011-02-16 14:10 [PATCH v3] Add i.MX51/53 IPU framebuffer support Sascha Hauer
2011-02-16 14:10 ` [PATCH 3/7] Add i.MX5 framebuffer driver Sascha Hauer
2011-02-18 9:22 ` Jason Chen
2011-02-18 9:52 ` Sascha Hauer
2011-02-19 2:22 ` Jason Chen
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=20110414084951.GX7285@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).