* Re: [PATCH 49/55] video: irq: Remove IRQF_DISABLED
From: Florian Tobias Schandinat @ 2011-10-04 20:20 UTC (permalink / raw)
To: Yong Zhang
Cc: linux-fbdev, Paul Gortmaker, Laurent Pinchart, Daniel Walker,
linux-arch, Kukjin Kim, Tomi Valkeinen, Archit Taneja,
David Brown, Anatolij Gustschin, cbe-oss-dev, Wan ZongShun,
linux-arm-msm, Ben Dooks, tglx, linux-omap, linux-arm-kernel,
Geoff Levand, Jiri Kosina, linux-kernel, Bryan Huntsman,
Andrew Morton, linuxppc-dev
In-Reply-To: <1316681962-8217-50-git-send-email-yong.zhang0@gmail.com>
On 09/22/2011 08:59 AM, Yong Zhang wrote:
> Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
> We run all interrupt handlers with interrupts disabled
> and we even check and yell when an interrupt handler
> returns with interrupts enabled (see commit [b738a50a:
> genirq: Warn when handler enables interrupts]).
>
> So now this flag is a NOOP and can be removed.
>
> Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
> Acked-by: David Brown <davidb@codeaurora.org>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> drivers/video/au1200fb.c | 2 +-
> drivers/video/bf54x-lq043fb.c | 2 +-
> drivers/video/bfin-lq035q1-fb.c | 2 +-
> drivers/video/bfin-t350mcqb-fb.c | 2 +-
> drivers/video/bfin_adv7393fb.c | 2 +-
> drivers/video/mb862xx/mb862xxfbdrv.c | 4 ++--
> drivers/video/msm/mddi.c | 2 +-
> drivers/video/msm/mdp.c | 2 +-
> drivers/video/nuc900fb.c | 2 +-
> drivers/video/omap2/displays/panel-taal.c | 2 +-
> drivers/video/ps3fb.c | 2 +-
> drivers/video/pxa3xx-gcu.c | 2 +-
> drivers/video/pxafb.c | 2 +-
> drivers/video/s3c2410fb.c | 2 +-
> drivers/video/sa1100fb.c | 3 +--
> drivers/video/sh_mobile_lcdcfb.c | 2 +-
> drivers/video/tmiofb.c | 2 +-
> drivers/video/vt8500lcdfb.c | 2 +-
> 18 files changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
> index a19a40e..7200559 100644
> --- a/drivers/video/au1200fb.c
> +++ b/drivers/video/au1200fb.c
> @@ -1673,7 +1673,7 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
> /* Now hook interrupt too */
> irq = platform_get_irq(dev, 0);
> ret = request_irq(irq, au1200fb_handle_irq,
> - IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
> + IRQF_SHARED, "lcd", (void *)dev);
> if (ret) {
> print_err("fail to request interrupt line %d (err: %d)",
> irq, ret);
> diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
> index 2464b91..56720fb 100644
> --- a/drivers/video/bf54x-lq043fb.c
> +++ b/drivers/video/bf54x-lq043fb.c
> @@ -633,7 +633,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - if (request_irq(info->irq, bfin_bf54x_irq_error, IRQF_DISABLED,
> + if (request_irq(info->irq, bfin_bf54x_irq_error, 0,
> "PPI ERROR", info) < 0) {
> printk(KERN_ERR DRIVER_NAME
> ": unable to request PPI ERROR IRQ\n");
> diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
> index 23b6c4b..c633068 100644
> --- a/drivers/video/bfin-lq035q1-fb.c
> +++ b/drivers/video/bfin-lq035q1-fb.c
> @@ -695,7 +695,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - ret = request_irq(info->irq, bfin_lq035q1_irq_error, IRQF_DISABLED,
> + ret = request_irq(info->irq, bfin_lq035q1_irq_error, 0,
> DRIVER_NAME" PPI ERROR", info);
> if (ret < 0) {
> dev_err(&pdev->dev, "unable to request PPI ERROR IRQ\n");
> diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
> index d8de29f..d5e1267 100644
> --- a/drivers/video/bfin-t350mcqb-fb.c
> +++ b/drivers/video/bfin-t350mcqb-fb.c
> @@ -529,7 +529,7 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
> goto out7;
> }
>
> - ret = request_irq(info->irq, bfin_t350mcqb_irq_error, IRQF_DISABLED,
> + ret = request_irq(info->irq, bfin_t350mcqb_irq_error, 0,
> "PPI ERROR", info);
> if (ret < 0) {
> printk(KERN_ERR DRIVER_NAME
> diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
> index 8486f54..811dd7f 100644
> --- a/drivers/video/bfin_adv7393fb.c
> +++ b/drivers/video/bfin_adv7393fb.c
> @@ -481,7 +481,7 @@ static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
> goto out_4;
> }
>
> - if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, IRQF_DISABLED,
> + if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, 0,
> "PPI ERROR", fbdev) < 0) {
> dev_err(&client->dev, "unable to request PPI ERROR IRQ\n");
> ret = -EFAULT;
> diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
> index 12a634a..11a7a33 100644
> --- a/drivers/video/mb862xx/mb862xxfbdrv.c
> +++ b/drivers/video/mb862xx/mb862xxfbdrv.c
> @@ -738,7 +738,7 @@ static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
> if (mb862xx_gdc_init(par))
> goto io_unmap;
>
> - if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED,
> + if (request_irq(par->irq, mb862xx_intr, 0,
> DRV_NAME, (void *)par)) {
> dev_err(dev, "Cannot request irq\n");
> goto io_unmap;
> @@ -1074,7 +1074,7 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
> if (mb862xx_pci_gdc_init(par))
> goto io_unmap;
>
> - if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED | IRQF_SHARED,
> + if (request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
> DRV_NAME, (void *)par)) {
> dev_err(dev, "Cannot request irq\n");
> goto io_unmap;
> diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
> index 178b072..4527cbf 100644
> --- a/drivers/video/msm/mddi.c
> +++ b/drivers/video/msm/mddi.c
> @@ -715,7 +715,7 @@ static int __devinit mddi_probe(struct platform_device *pdev)
>
> mddi->int_enable = 0;
> mddi_writel(mddi->int_enable, INTEN);
> - ret = request_irq(mddi->irq, mddi_isr, IRQF_DISABLED, "mddi",
> + ret = request_irq(mddi->irq, mddi_isr, 0, "mddi",
> &mddi->client_data);
> if (ret) {
> printk(KERN_ERR "mddi: failed to request enable irq!\n");
> diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
> index 2750ed2..cb2ddf1 100644
> --- a/drivers/video/msm/mdp.c
> +++ b/drivers/video/msm/mdp.c
> @@ -426,7 +426,7 @@ int mdp_probe(struct platform_device *pdev)
> goto error_get_clk;
> }
>
> - ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp);
> + ret = request_irq(mdp->irq, mdp_isr, 0, "msm_mdp", mdp);
> if (ret)
> goto error_request_irq;
> disable_irq(mdp->irq);
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 37dd850..d1fbbd8 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -587,7 +587,7 @@ static int __devinit nuc900fb_probe(struct platform_device *pdev)
> fbinfo->flags = FBINFO_FLAG_DEFAULT;
> fbinfo->pseudo_palette = &fbi->pseudo_pal;
>
> - ret = request_irq(irq, nuc900fb_irqhandler, IRQF_DISABLED,
> + ret = request_irq(irq, nuc900fb_irqhandler, 0,
> pdev->name, fbinfo);
> if (ret) {
> dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
> diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
> index 7f91002..80c3f6a 100644
> --- a/drivers/video/omap2/displays/panel-taal.c
> +++ b/drivers/video/omap2/displays/panel-taal.c
> @@ -1034,7 +1034,7 @@ static int taal_probe(struct omap_dss_device *dssdev)
> gpio_direction_input(gpio);
>
> r = request_irq(gpio_to_irq(gpio), taal_te_isr,
> - IRQF_DISABLED | IRQF_TRIGGER_RISING,
> + IRQF_TRIGGER_RISING,
> "taal vsync", dssdev);
>
> if (r) {
> diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c
> index 65560a1..213fbbc 100644
> --- a/drivers/video/ps3fb.c
> +++ b/drivers/video/ps3fb.c
> @@ -1082,7 +1082,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
> }
>
> retval = request_irq(ps3fb.irq_no, ps3fb_vsync_interrupt,
> - IRQF_DISABLED, DEVICE_NAME, &dev->core);
> + 0, DEVICE_NAME, &dev->core);
> if (retval) {
> dev_err(&dev->core, "%s: request_irq failed %d\n", __func__,
> retval);
> diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
> index d8de557..1ed8b36 100644
> --- a/drivers/video/pxa3xx-gcu.c
> +++ b/drivers/video/pxa3xx-gcu.c
> @@ -676,7 +676,7 @@ pxa3xx_gcu_probe(struct platform_device *dev)
> }
>
> ret = request_irq(irq, pxa3xx_gcu_handle_irq,
> - IRQF_DISABLED, DRV_NAME, priv);
> + 0, DRV_NAME, priv);
> if (ret) {
> dev_err(&dev->dev, "request_irq failed\n");
> ret = -EBUSY;
> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> index 0f4e8c9..e89778f 100644
> --- a/drivers/video/pxafb.c
> +++ b/drivers/video/pxafb.c
> @@ -2191,7 +2191,7 @@ static int __devinit pxafb_probe(struct platform_device *dev)
> goto failed_free_mem;
> }
>
> - ret = request_irq(irq, pxafb_handle_irq, IRQF_DISABLED, "LCD", fbi);
> + ret = request_irq(irq, pxafb_handle_irq, 0, "LCD", fbi);
> if (ret) {
> dev_err(&dev->dev, "request_irq failed: %d\n", ret);
> ret = -EBUSY;
> diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
> index 798144a..ee4c0df 100644
> --- a/drivers/video/s3c2410fb.c
> +++ b/drivers/video/s3c2410fb.c
> @@ -910,7 +910,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
> for (i = 0; i < 256; i++)
> info->palette_buffer[i] = PALETTE_BUFF_CLEAR;
>
> - ret = request_irq(irq, s3c2410fb_irq, IRQF_DISABLED, pdev->name, info);
> + ret = request_irq(irq, s3c2410fb_irq, 0, pdev->name, info);
> if (ret) {
> dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
> ret = -EBUSY;
> diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
> index e8b76d6..98d55d0 100644
> --- a/drivers/video/sa1100fb.c
> +++ b/drivers/video/sa1100fb.c
> @@ -1457,8 +1457,7 @@ static int __devinit sa1100fb_probe(struct platform_device *pdev)
> if (ret)
> goto failed;
>
> - ret = request_irq(irq, sa1100fb_handle_irq, IRQF_DISABLED,
> - "LCD", fbi);
> + ret = request_irq(irq, sa1100fb_handle_irq, 0, "LCD", fbi);
> if (ret) {
> printk(KERN_ERR "sa1100fb: request_irq failed: %d\n", ret);
> goto failed;
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 4636f9d..facffc2 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -1577,7 +1577,7 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, priv);
>
> - error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED,
> + error = request_irq(i, sh_mobile_lcdc_irq, 0,
> dev_name(&pdev->dev), priv);
> if (error) {
> dev_err(&pdev->dev, "unable to request irq\n");
> diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c
> index cd1c4dc..8e4a446 100644
> --- a/drivers/video/tmiofb.c
> +++ b/drivers/video/tmiofb.c
> @@ -744,7 +744,7 @@ static int __devinit tmiofb_probe(struct platform_device *dev)
> goto err_ioremap_vram;
> }
>
> - retval = request_irq(irq, &tmiofb_irq, IRQF_DISABLED,
> + retval = request_irq(irq, &tmiofb_irq, 0,
> dev_name(&dev->dev), info);
>
> if (retval)
> diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
> index c13c246..777c21d 100644
> --- a/drivers/video/vt8500lcdfb.c
> +++ b/drivers/video/vt8500lcdfb.c
> @@ -355,7 +355,7 @@ static int __devinit vt8500lcd_probe(struct platform_device *pdev)
> goto failed_free_palette;
> }
>
> - ret = request_irq(irq, vt8500lcd_handle_irq, IRQF_DISABLED, "LCD", fbi);
> + ret = request_irq(irq, vt8500lcd_handle_irq, 0, "LCD", fbi);
> if (ret) {
> dev_err(&pdev->dev, "request_irq failed: %d\n", ret);
> ret = -EBUSY;
^ permalink raw reply
* Re: [patch] smscufx: change edid data to u8 instead of char
From: Florian Tobias Schandinat @ 2011-10-04 20:19 UTC (permalink / raw)
To: linux-fbdev
On 09/21/2011 07:16 AM, Dan Carpenter wrote:
> Having "edid" as char caused a problem in ufx_read_edid() where we
> compared "edid[i] != 0xFF". Because of the type difference, the
> condition was never true and the error checking failed.
>
> Also I added a __user notation to silence a sparse complaint.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
Thanks,
Florian Tobias Schandinat
> ---
> Compile tested only. Please test carefully.
>
> diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
> index 44c8cab..aaccffa 100644
> --- a/drivers/video/smscufx.c
> +++ b/drivers/video/smscufx.c
> @@ -103,7 +103,7 @@ struct ufx_data {
> struct delayed_work free_framebuffer_work;
> atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */
> atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */
> - char *edid; /* null until we read edid from hw or get from sysfs */
> + u8 *edid; /* null until we read edid from hw or get from sysfs */
> size_t edid_size;
> u32 pseudo_palette[256];
> };
> @@ -993,7 +993,7 @@ static int ufx_ops_ioctl(struct fb_info *info, unsigned int cmd,
>
> /* TODO: Update X server to get this from sysfs instead */
> if (cmd = UFX_IOCTL_RETURN_EDID) {
> - char *edid = (char *)arg;
> + u8 __user *edid = (u8 __user *)arg;
> if (copy_to_user(edid, dev->edid, dev->edid_size))
> return -EFAULT;
> return 0;
> @@ -1428,7 +1428,7 @@ static int ufx_i2c_wait_busy(struct ufx_data *dev)
> }
>
> /* reads a 128-byte EDID block from the currently selected port and TAR */
> -static int ufx_read_edid(struct ufx_data *dev, char *edid, int edid_len)
> +static int ufx_read_edid(struct ufx_data *dev, u8 *edid, int edid_len)
> {
> int i, j, status;
> u32 *edid_u32 = (u32 *)edid;
> @@ -1491,7 +1491,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
> char *default_edid, size_t default_edid_size)
> {
> const struct fb_videomode *default_vmode = NULL;
> - char *edid;
> + u8 *edid;
> int i, result = 0, tries = 3;
>
> if (info->dev) /* only use mutex if info has been registered */
>
^ permalink raw reply
* ping: [PATCH] GXT4000P and GXT6500P support
From: nello martuscielli @ 2011-10-04 11:56 UTC (permalink / raw)
To: linuxppc-dev, linux-fbdev-devel; +Cc: Nico Macrionitisl
ping for: http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-June/072678.html
This patch adds support for GXT4000P and GXT6500P cards found on some
IBM pSeries machines.
GXT4000P/6000P and GXT4500P/6500P couples are identical from
software's point of view and are based on the same Raster Engine
(RC1000), except for a different reference clock for the PLL.
GXT6x00P models are equipped with an additional Geometry Engine
(GT1000) but this driver doesn't use it.
I see that even after 2 years, this patch still hasn't been added to
the official Linux kernel.
You will appreciate how little code this took to save everybody with a
GXT6500P card some trouble.
cheers,
Nello
--
CRUX PPC user on IBM POWER4+
^ permalink raw reply
* [RESEND][PATCH v2 2/2] fb: add events for early fb event support.
From: Inki Dae @ 2011-10-04 10:32 UTC (permalink / raw)
To: linux-fbdev
this patch adds FB_EARLY_EVENT_BLANK and FB_R_EARLY_EVENT_BLANK
event mode supports. first, fb_notifier_call_chain() is called with
FB_EARLY_EVENT_BLANK and fb_blank() of specific fb driver is called
and then fb_notifier_call_chain() is called with FB_EVENT_BLANK again
at fb_blank(). and if fb_blank() was failed then fb_nitifier_call_chain()
would be called with FB_R_EARLY_EVENT_BLANK to revert the previous effects.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/fbmem.c | 21 +++++++++++++++------
include/linux/fb.h | 4 ++++
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index ad93629..a2bd17b 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1032,20 +1032,29 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
int
fb_blank(struct fb_info *info, int blank)
{
- int ret = -EINVAL;
+ struct fb_event event;
+ int ret = -EINVAL, early_ret;
if (blank > FB_BLANK_POWERDOWN)
blank = FB_BLANK_POWERDOWN;
+ event.info = info;
+ event.data = ␣
+
+ early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
+
if (info->fbops->fb_blank)
ret = info->fbops->fb_blank(blank, info);
- if (!ret) {
- struct fb_event event;
-
- event.info = info;
- event.data = ␣
+ if (!ret)
fb_notifier_call_chain(FB_EVENT_BLANK, &event);
+ else {
+ /*
+ * if fb_blank is failed then revert effects of
+ * the early blank event.
+ */
+ if (!early_ret)
+ fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
}
return ret;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 1d6836c..29f53d5 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -549,6 +549,10 @@ struct fb_cursor_user {
#define FB_EVENT_FB_UNBIND 0x0E
/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */
#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
+/* A hardware display blank early change occured */
+#define FB_EARLY_EVENT_BLANK 0x10
+/* A hardware display blank revert early change occured */
+#define FB_R_EARLY_EVENT_BLANK 0x11
struct fb_event {
struct fb_info *info;
--
1.7.4.1
^ permalink raw reply related
* [RESEND][PATCH v2 1/2] lcd: add callbacks for early fb event blank
From: Inki Dae @ 2011-10-04 10:32 UTC (permalink / raw)
To: linux-fbdev
this patch adds early_set_power and r_early_set_power callbacks.
early_set_power callback is called prior to fb_blank() of fbmem.c and
r_early_set_power callback is called if fb_blank() was failed to
revert the effects of the early_set_power call of lcd panel driver.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/backlight/lcd.c | 10 ++++++++++
include/linux/lcd.h | 10 ++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 71a11ca..7a03b6c 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -32,6 +32,8 @@ static int fb_notifier_callback(struct notifier_block *self,
case FB_EVENT_BLANK:
case FB_EVENT_MODE_CHANGE:
case FB_EVENT_MODE_CHANGE_ALL:
+ case FB_EARLY_EVENT_BLANK:
+ case FB_R_EARLY_EVENT_BLANK:
break;
default:
return 0;
@@ -46,6 +48,14 @@ static int fb_notifier_callback(struct notifier_block *self,
if (event = FB_EVENT_BLANK) {
if (ld->ops->set_power)
ld->ops->set_power(ld, *(int *)evdata->data);
+ } else if (event = FB_EARLY_EVENT_BLANK) {
+ if (ld->ops->early_set_power)
+ ld->ops->early_set_power(ld,
+ *(int *)evdata->data);
+ } else if (event = FB_R_EARLY_EVENT_BLANK) {
+ if (ld->ops->r_early_set_power)
+ ld->ops->r_early_set_power(ld,
+ *(int *)evdata->data);
} else {
if (ld->ops->set_mode)
ld->ops->set_mode(ld, evdata->data);
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 8877123..e00c3b0 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -40,6 +40,16 @@ struct lcd_ops {
/* Get the LCD panel power status (0: full on, 1..3: controller
power on, flat panel power off, 4: full off), see FB_BLANK_XXX */
int (*get_power)(struct lcd_device *);
+ /*
+ * Enable or disable power to the LCD(0: on; 4: off, see FB_BLANK_XXX)
+ * and this callback would be called proir to fb driver's callback.
+ *
+ * P.S. note that if early_set_power is not NULL then early fb notifier
+ * would be registered.
+ */
+ int (*early_set_power)(struct lcd_device *, int power);
+ /* revert the effects of the early blank event. */
+ int (*r_early_set_power)(struct lcd_device *, int power);
/* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */
int (*set_power)(struct lcd_device *, int power);
/* Get the current contrast setting (0-max_contrast) */
--
1.7.4.1
^ permalink raw reply related
* [RESENT][PATCH v2 0/2] fb: add early fb blank feature
From: Inki Dae @ 2011-10-04 10:29 UTC (permalink / raw)
To: linux-fbdev
this patch adds early fb blank feature that a callback of lcd panel driver
is called prior to specific fb driver's one. in case of MIPI-DSI based video
mode LCD Panel, for lcd power off, the power off commands should be
transferred to lcd panel with display and mipi-dsi controller enabled
because the commands is set to lcd panel at vsync porch period. and in
opposite case, the callback of fb driver should be called prior to lcd panel
driver's one because of same issue. and also if fb_blank mode is changed to
FB_BLANK_POWERDOWN then display controller would be off(clock disable) but
lcd panel would be still on. at this time, you could see some issue like
sparkling on lcd panel because video clock to be delivered to ldi module of
lcd panel was disabled. this issue could occurs for all lcd panels.
the callback order is as the following:
at fb_blank function of fbmem.c
-> fb_notifier_call_chain(FB_EARLY_EVENT_BLANK)
-> lcd panel driver's early_set_power()
-> info->fbops->fb_blank()
-> spcefic fb driver's fb_blank()
-> fb_notifier_call_chain(FB_EVENT_BLANK)
-> lcd panel driver's set_power()
-> fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK) if
info->fops->fb_blank() was failed.
fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK) would be called to revert the
effects of previous FB_EARLY_EVENT_BLANK call. and note that if
early_set_power() of lcd_ops is NULL then early fb blank callback would be
ignored.
this patch is based on git repository below:
git://github.com/schandinat/linux-2.6.git
branch: fbdev-next
commit-id: 2b7a905dd0d24d14a1099653ba63b7113a82fc54
Links to previous versions of the patchset:
v1: < http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/00413.html >
Changelog v2:
fb: add fb early blank event instead of early_blank_mode variable.
fb notifier can know whether early blank mode is support or not
checking if early_set_power callback is NULL or not.
fb: add exception codes at fb_blank().
the effects of previous FB_EARLY_EVENT_BLANK call should be reverted
if info->fbops->fb_blank() was failed.
fb: add code clean.
Changelog RESEND:
fb: fixed condition.
this patch changes 'if (early_ret < 0)' to 'if (!early_ret)' of
fb_blank function.
these patch series are as the following:
[RESEND][PATCH v2 0/2] fb: add early fb blank feature.
introduce new early fb blank feature.
[RESEND][PATCH v2 1/2] lcd: add callbacks for early fb event blank support.
[RESEND][PATCH v2 2/2] fb: add events for early fb event support.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
^ permalink raw reply
* RE: [PATCH v3] video: da8xx-fb: Increased resolution configuration
From: Manjunathappa, Prakash @ 2011-10-04 7:12 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1310963333-29806-1-git-send-email-prakash.pm@ti.com>
Hi Florian Tobias Schandinat,
Can you please accept below patch? It depends on my earlier patch "video: da8xx-fb: Interrupt configuration of revised LCDC IP" accepted by Paul, but I don't see it main line yet. Please let me know if I have submit both patches again?
Thanks,
Prakash
On Tue, Jul 26, 2011 at 09:50:12, Manjunathappa, Prakash wrote:
> Hi Paul,
>
> Could you please accept this patch as there are no comments?
>
> Thanks,
> Prakash
> On Mon, Jul 18, 2011 at 09:58:53, Manjunathappa, Prakash wrote:
> > Revised LCD controller in upcoming TI SoC which is an updated version of
> > LCDC IP that was found on TI's DA850 SoC supports 2048*2048 resolution.
> > Below are the encoding details:
> > Width:
> > Pixels Per Line = {pplmsb, ppllsb, 4'b1111} + 1
> > Where pplmsb:1bit=>Raster Timing0[3], ppllsb:6bits=>Raster Timing0[9:4].
> > And encoded value can range from 16 to 2048 in multiples of 16.
> >
> > Height:
> > Lines Per Panel = {lpp_b10, lpp}
> > Where lpp:10bits=>Raster Timing1[9:0], lpp_b10:1bit=>Raster Timing2[26].
> > And encoded value can range from 1 to 2048, programmable range is 0 to
> > 2047.
> >
> > Patch is verified on emulation platform of upcoming SoC for updated
> > feature and on DA850 platform to make sure nothing existing breaks.
> >
> > Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
> > ---
> > Since v2:
> > Corrected comment describing horizontal resolution bits and removed unnecessary
> > outer parenthesis.
> > Since v1:
> > 1)Fixed the bug in configuration of lpp_b10 in Raster Timing2[26] register.
> > 2)Reframed commit message.
> >
> > drivers/video/da8xx-fb.c | 31 ++++++++++++++++++++++++++++---
> > 1 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
> > index 620f1c3..94b611a 100644
> > --- a/drivers/video/da8xx-fb.c
> > +++ b/drivers/video/da8xx-fb.c
> > @@ -460,18 +460,43 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
> >
> > /* Set the Panel Width */
> > /* Pixels per line = (PPL + 1)*16 */
> > - /*0x3F in bits 4..9 gives max horisontal resolution = 1024 pixels*/
> > - width &= 0x3f0;
> > + if (lcd_revision = LCD_VERSION_1) {
> > + /*
> > + * 0x3F in bits 4..9 gives max horizontal resolution = 1024
> > + * pixels.
> > + */
> > + width &= 0x3f0;
> > + } else {
> > + /*
> > + * 0x7F in bits 4..10 gives max horizontal resolution = 2048
> > + * pixels.
> > + */
> > + width &= 0x7f0;
> > + }
> > +
> > reg = lcdc_read(LCD_RASTER_TIMING_0_REG);
> > reg &= 0xfffffc00;
> > - reg |= ((width >> 4) - 1) << 4;
> > + if (lcd_revision = LCD_VERSION_1) {
> > + reg |= ((width >> 4) - 1) << 4;
> > + } else {
> > + width = (width >> 4) - 1;
> > + reg |= ((width & 0x3f) << 4) | ((width & 0x40) >> 3);
> > + }
> > lcdc_write(reg, LCD_RASTER_TIMING_0_REG);
> >
> > /* Set the Panel Height */
> > + /* Set bits 9:0 of Lines Per Pixel */
> > reg = lcdc_read(LCD_RASTER_TIMING_1_REG);
> > reg = ((height - 1) & 0x3ff) | (reg & 0xfffffc00);
> > lcdc_write(reg, LCD_RASTER_TIMING_1_REG);
> >
> > + /* Set bit 10 of Lines Per Pixel */
> > + if (lcd_revision = LCD_VERSION_2) {
> > + reg = lcdc_read(LCD_RASTER_TIMING_2_REG);
> > + reg |= ((height - 1) & 0x400) << 16;
> > + lcdc_write(reg, LCD_RASTER_TIMING_2_REG);
> > + }
> > +
> > /* Set the Raster Order of the Frame Buffer */
> > reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8);
> > if (raster_order)
> > --
> > 1.7.1
> >
> >
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
>
^ permalink raw reply
* RE: [PATCH v2 2/2] fb: add events for early fb event support.
From: Inki Dae @ 2011-10-04 0:16 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317047842-12220-1-git-send-email-inki.dae@samsung.com>
> -----Original Message-----
> From: Florian Tobias Schandinat [mailto:FlorianSchandinat@gmx.de]
> Sent: Sunday, October 02, 2011 9:18 AM
> To: Inki Dae
> Cc: linux-fbdev@vger.kernel.org; kyungmin.park@samsung.com;
> lars@metafoo.de
> Subject: Re: [PATCH v2 2/2] fb: add events for early fb event support.
>
> On 09/27/2011 04:48 AM, Inki Dae wrote:
> >
> >> -----Original Message-----
> >> From: Inki Dae [mailto:inki.dae@samsung.com]
> >> Sent: Monday, September 26, 2011 11:37 PM
> >> To: FlorianSchandinat@gmx.de; linux-fbdev@vger.kernel.org
> >> Cc: kyungmin.park@samsung.com; lars@metafoo.de; Inki Dae
> >> Subject: [PATCH v2 2/2] fb: add events for early fb event support.
> >>
> >> this patch adds FB_EARLY_EVENT_BLANK and FB_R_EARLY_EVENT_BLANK
> >> event mode supports. first, fb_notifier_call_chain() is called with
> >> FB_EARLY_EVENT_BLANK and fb_blank() of specific fb driver is called
> >> and then fb_notifier_call_chain() is called with FB_EVENT_BLANK again
> >> at fb_blank(). and if fb_blank() was failed then
> fb_nitifier_call_chain()
> >> would be called with FB_R_EARLY_EVENT_BLANK to revert the previous
> > effects.
>
> Is my assumption correct that the framebuffer driver is independent of the
> specific LCD driver and therefore they can be used independently (at least
> in
> theory)?
Yes, right. they can be used independently.
If the answer is yes and there is no direct dependance this looks
> like
> the right solution. I could take this patch (or rather the fixed up
> version when
> you send it) but I'm unsure how to progress with the LCD part, would be
> nice to
> get Richard's Ack on it.
>
>
Ok, get it. and I will re-send fixed patch soon. thank you.
> Best regards,
>
> Florian Tobias Schandinat
>
> >>
> >> Signed-off-by: Inki Dae <inki.dae@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> ---
> >> drivers/video/fbmem.c | 21 +++++++++++++++------
> >> include/linux/fb.h | 4 ++++
> >> 2 files changed, 19 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> >> index ad93629..a2bd17b 100644
> >> --- a/drivers/video/fbmem.c
> >> +++ b/drivers/video/fbmem.c
> >> @@ -1032,20 +1032,29 @@ fb_set_var(struct fb_info *info, struct
> >> fb_var_screeninfo *var)
> >> int
> >> fb_blank(struct fb_info *info, int blank)
> >> {
> >> - int ret = -EINVAL;
> >> + struct fb_event event;
> >> + int ret = -EINVAL, early_ret;
> >>
> >> if (blank > FB_BLANK_POWERDOWN)
> >> blank = FB_BLANK_POWERDOWN;
> >>
> >> + event.info = info;
> >> + event.data = ␣
> >> +
> >> + early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
> >> +
> >> if (info->fbops->fb_blank)
> >> ret = info->fbops->fb_blank(blank, info);
> >>
> >> - if (!ret) {
> >> - struct fb_event event;
> >> -
> >> - event.info = info;
> >> - event.data = ␣
> >> + if (!ret)
> >> fb_notifier_call_chain(FB_EVENT_BLANK, &event);
> >> + else {
> >> + /*
> >> + * if fb_blank is failed then revert effects of
> >> + * the early blank event.
> >> + */
> >> + if (early_ret < 0)
> >
> > Ah, this is condition wrong so I will fix it to "if (!early_ret)".
> >
> >> + fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK,
> > &event);
> >> }
> >>
> >> return ret;
> >> diff --git a/include/linux/fb.h b/include/linux/fb.h
> >> index 1d6836c..29f53d5 100644
> >> --- a/include/linux/fb.h
> >> +++ b/include/linux/fb.h
> >> @@ -549,6 +549,10 @@ struct fb_cursor_user {
> >> #define FB_EVENT_FB_UNBIND 0x0E
> >> /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga
> >> switcheroo */
> >> #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
> >> +/* A hardware display blank early change occured */
> >> +#define FB_EARLY_EVENT_BLANK 0x10
> >> +/* A hardware display blank revert early change occured */
> >> +#define FB_R_EARLY_EVENT_BLANK 0x11
> >>
> >> struct fb_event {
> >> struct fb_info *info;
> >> --
> >> 1.7.4.1
> >
^ permalink raw reply
* Re: [PATCH 1/9] drivers/video: fsl-diu-fb: fix some ioctls
From: Timur Tabi @ 2011-10-03 17:24 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-1-git-send-email-timur@freescale.com>
Florian Tobias Schandinat wrote:
> On 09/28/2011 09:19 PM, Timur Tabi wrote:
>> Use the _IOx macros to define the ioctl commands, instead of hard-coded
>> numbers. Unfortunately, the original definitions of MFB_SET_PIXFMT and
>> MFB_GET_PIXFMT used the wrong value for the size, so this will break
>> binary compatibility with older applications.
>
> Don't break compatibility without the need to do so. Ask yourself whether using
> those macros is really worth it. If the answer is yes, at least give userspace a
> grace period, some kernel versions where both values work. For example you could
> rename the old numerical ones to MFB_SET_PIXFMT_OLD and then add a compatibility
> IOCTL, for example like this
>
> case MFB_SET_PIXFMT_OLD:
> /* you could add a warning message here */
> case MFB_SET_PIXFMT:
> ...
Ok, I can do that.
> Not much work and you could delete the compatibility stuff in a year or two but
> it would it make much easier for users to upgrade.
>
> I don't know your driver, can int be only 32 bit on all plattforms where it can
> be used or is this another thing where compatibility can break?
We have 64-bit processors, but currently none of them have any multimedia
support. That might change one day, and I'd rather the drivers be 64-bit clean
before we announce any such parts. There are other places in the driver that
break on 64-bit, and I will fix those as well (just not today).
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH 1/9] drivers/video: fsl-diu-fb: fix some ioctls
From: Florian Tobias Schandinat @ 2011-10-03 16:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-1-git-send-email-timur@freescale.com>
On 09/28/2011 09:19 PM, Timur Tabi wrote:
> Use the _IOx macros to define the ioctl commands, instead of hard-coded
> numbers. Unfortunately, the original definitions of MFB_SET_PIXFMT and
> MFB_GET_PIXFMT used the wrong value for the size, so this will break
> binary compatibility with older applications.
Don't break compatibility without the need to do so. Ask yourself whether using
those macros is really worth it. If the answer is yes, at least give userspace a
grace period, some kernel versions where both values work. For example you could
rename the old numerical ones to MFB_SET_PIXFMT_OLD and then add a compatibility
IOCTL, for example like this
case MFB_SET_PIXFMT_OLD:
/* you could add a warning message here */
case MFB_SET_PIXFMT:
...
Not much work and you could delete the compatibility stuff in a year or two but
it would it make much easier for users to upgrade.
I don't know your driver, can int be only 32 bit on all plattforms where it can
be used or is this another thing where compatibility can break?
Best regards,
Florian Tobias Schandinat
>
> Also remove the FBIOGET_GWINFO and FBIOPUT_GWINFO ioctls. FBIOPUT_GWINFO
> was never implemented, and FBIOGET_GWINFO was never used by any
> application.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/video/fsl-diu-fb.c | 8 --------
> include/linux/fsl-diu-fb.h | 20 ++++++++------------
> 2 files changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> index 5137fbb..e5905b7 100644
> --- a/drivers/video/fsl-diu-fb.c
> +++ b/drivers/video/fsl-diu-fb.c
> @@ -1030,14 +1030,6 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
> ad->ckmin_b = ck.blue_min;
> }
> break;
> - case FBIOGET_GWINFO:
> - if (mfbi->type = MFB_TYPE_OFF)
> - return -ENODEV;
> - /* get graphic window information */
> - if (copy_to_user(buf, ad, sizeof(*ad)))
> - return -EFAULT;
> - break;
> -
> default:
> dev_err(info->dev, "unknown ioctl command (0x%08X)\n", cmd);
> return -ENOIOCTLCMD;
> diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
> index df23f59..5efb407 100644
> --- a/include/linux/fsl-diu-fb.h
> +++ b/include/linux/fsl-diu-fb.h
> @@ -33,22 +33,18 @@ struct mfb_chroma_key {
> };
>
> struct aoi_display_offset {
> - int x_aoi_d;
> - int y_aoi_d;
> + __s32 x_aoi_d;
> + __s32 y_aoi_d;
> };
>
> #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
> #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
> -
> -#define MFB_SET_ALPHA 0x80014d00
> -#define MFB_GET_ALPHA 0x40014d00
> -#define MFB_SET_AOID 0x80084d04
> -#define MFB_GET_AOID 0x40084d04
> -#define MFB_SET_PIXFMT 0x80014d08
> -#define MFB_GET_PIXFMT 0x40014d08
> -
> -#define FBIOGET_GWINFO 0x46E0
> -#define FBIOPUT_GWINFO 0x46E1
> +#define MFB_SET_ALPHA _IOW('M', 0, __u8)
> +#define MFB_GET_ALPHA _IOR('M', 0, __u8)
> +#define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
> +#define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
> +#define MFB_SET_PIXFMT _IOW('M', 8, __u32)
> +#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
>
> #ifdef __KERNEL__
> #include <linux/spinlock.h>
^ permalink raw reply
* Re: [PATCH 8/9] drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
From: Timur Tabi @ 2011-10-03 15:58 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-8-git-send-email-timur@freescale.com>
Florian Tobias Schandinat wrote:
>> > + struct diu __iomem *diu_reg;
>> > + spinlock_t reg_lock;
>> > + unsigned int mode; /* DIU operation mode */
> Any reason that you added here a new "mode" var that appears to be useless when
> you just deleted the mode variable in patch 7/9?
Thanks for catching that. That variable should not be there. I will post a new
patch later today.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH 8/9] drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
From: Florian Tobias Schandinat @ 2011-10-03 15:48 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-8-git-send-email-timur@freescale.com>
On 09/28/2011 09:19 PM, Timur Tabi wrote:
> The diu_hw structure contains two fields used to access the DIU registers,
> but the only instance of this structure is a global variable, 'dr'.
> Eliminate 'dr' by merging its fields into the fsl_diu_data structure,
> which is instantiated on the heap for each DIU controller found.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> drivers/video/fsl-diu-fb.c | 71 ++++++++++++++++++++-----------------------
> 1 files changed, 33 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
> index 41f767b..728cd9f 100644
> --- a/drivers/video/fsl-diu-fb.c
> +++ b/drivers/video/fsl-diu-fb.c
> @@ -49,11 +49,6 @@
> #define INT_PARERR 0x08 /* Display parameters error interrupt */
> #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
>
> -struct diu_hw {
> - struct diu __iomem *diu_reg;
> - spinlock_t reg_lock;
> -};
> -
> struct diu_addr {
> void *vaddr; /* Virtual address */
> dma_addr_t paddr; /* Physical address */
> @@ -351,6 +346,9 @@ struct fsl_diu_data {
> unsigned int irq;
> int fb_enabled;
> enum fsl_diu_monitor_port monitor_port;
> + struct diu __iomem *diu_reg;
> + spinlock_t reg_lock;
> + unsigned int mode; /* DIU operation mode */
Any reason that you added here a new "mode" var that appears to be useless when
you just deleted the mode variable in patch 7/9?
Regards,
Florian Tobias Schandinat
> };
>
> enum mfb_index {
> @@ -424,10 +422,6 @@ static struct mfb_info mfb_template[] = {
> },
> };
>
> -static struct diu_hw dr = {
> - .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
> -};
> -
> static struct diu_pool pool;
>
> /**
> @@ -506,9 +500,9 @@ void wr_reg_wa(u32 *reg, u32 val)
> static void fsl_diu_enable_panel(struct fb_info *info)
> {
> struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
> - struct diu *hw = dr.diu_reg;
> struct diu_ad *ad = mfbi->ad;
> struct fsl_diu_data *machine_data = mfbi->parent;
> + struct diu __iomem *hw = machine_data->diu_reg;
>
> switch (mfbi->index) {
> case PLANE0:
> @@ -559,9 +553,9 @@ static void fsl_diu_enable_panel(struct fb_info *info)
> static void fsl_diu_disable_panel(struct fb_info *info)
> {
> struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
> - struct diu *hw = dr.diu_reg;
> struct diu_ad *ad = mfbi->ad;
> struct fsl_diu_data *machine_data = mfbi->parent;
> + struct diu __iomem *hw = machine_data->diu_reg;
>
> switch (mfbi->index) {
> case PLANE0:
> @@ -613,9 +607,9 @@ static void fsl_diu_disable_panel(struct fb_info *info)
>
> static void enable_lcdc(struct fb_info *info)
> {
> - struct diu *hw = dr.diu_reg;
> struct mfb_info *mfbi = info->par;
> struct fsl_diu_data *machine_data = mfbi->parent;
> + struct diu __iomem *hw = machine_data->diu_reg;
>
> if (!machine_data->fb_enabled) {
> out_be32(&hw->diu_mode, MFB_MODE1);
> @@ -625,9 +619,9 @@ static void enable_lcdc(struct fb_info *info)
>
> static void disable_lcdc(struct fb_info *info)
> {
> - struct diu *hw = dr.diu_reg;
> struct mfb_info *mfbi = info->par;
> struct fsl_diu_data *machine_data = mfbi->parent;
> + struct diu __iomem *hw = machine_data->diu_reg;
>
> if (machine_data->fb_enabled) {
> out_be32(&hw->diu_mode, 0);
> @@ -822,13 +816,13 @@ static void update_lcdc(struct fb_info *info)
> struct fb_var_screeninfo *var = &info->var;
> struct mfb_info *mfbi = info->par;
> struct fsl_diu_data *machine_data = mfbi->parent;
> - struct diu *hw;
> + struct diu __iomem *hw;
> int i, j;
> char __iomem *cursor_base, *gamma_table_base;
>
> u32 temp;
>
> - hw = dr.diu_reg;
> + hw = machine_data->diu_reg;
>
> diu_ops.set_monitor_port(machine_data->monitor_port);
> gamma_table_base = pool.gamma.vaddr;
> @@ -939,9 +933,9 @@ static int fsl_diu_set_par(struct fb_info *info)
> struct mfb_info *mfbi = info->par;
> struct fsl_diu_data *machine_data = mfbi->parent;
> struct diu_ad *ad = mfbi->ad;
> - struct diu *hw;
> + struct diu __iomem *hw;
>
> - hw = dr.diu_reg;
> + hw = machine_data->diu_reg;
>
> set_fix(info);
> mfbi->cursor_reset = 1;
> @@ -1336,7 +1330,7 @@ static void uninstall_fb(struct fb_info *info)
>
> static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
> {
> - struct diu *hw = dr.diu_reg;
> + struct diu __iomem *hw = dev_id;
> unsigned int status = in_be32(&hw->int_status);
>
> if (status) {
> @@ -1362,18 +1356,16 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
> return IRQ_NONE;
> }
>
> -static int request_irq_local(int irq)
> +static int request_irq_local(struct fsl_diu_data *machine_data)
> {
> + struct diu __iomem *hw = machine_data->diu_reg;
> u32 ints;
> - struct diu *hw;
> int ret;
>
> - hw = dr.diu_reg;
> -
> /* Read to clear the status */
> in_be32(&hw->int_status);
>
> - ret = request_irq(irq, fsl_diu_isr, 0, "fsl-diu-fb", NULL);
> + ret = request_irq(machine_data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw);
> if (!ret) {
> ints = INT_PARERR | INT_LS_BF_VS;
> #if !defined(CONFIG_NOT_COHERENT_CACHE)
> @@ -1388,14 +1380,14 @@ static int request_irq_local(int irq)
> return ret;
> }
>
> -static void free_irq_local(int irq)
> +static void free_irq_local(struct fsl_diu_data *machine_data)
> {
> - struct diu *hw = dr.diu_reg;
> + struct diu __iomem *hw = machine_data->diu_reg;
>
> /* Disable all LCDC interrupt */
> out_be32(&hw->int_mask, 0x1f);
>
> - free_irq(irq, NULL);
> + free_irq(machine_data->irq, NULL);
> }
>
> #ifdef CONFIG_PM
> @@ -1513,6 +1505,9 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> if (!machine_data)
> return -ENOMEM;
>
> + machine_data->mode = MFB_MODE1;
> + spin_lock_init(&machine_data->reg_lock);
> +
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
> machine_data->fsl_diu_info[i] > framebuffer_alloc(sizeof(struct mfb_info), &pdev->dev);
> @@ -1537,16 +1532,16 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> }
> }
>
> - dr.diu_reg = of_iomap(np, 0);
> - if (!dr.diu_reg) {
> + machine_data->diu_reg = of_iomap(np, 0);
> + if (!machine_data->diu_reg) {
> dev_err(&pdev->dev, "cannot map DIU registers\n");
> ret = -EFAULT;
> goto error2;
> }
>
> - diu_mode = in_be32(&dr.diu_reg->diu_mode);
> + diu_mode = in_be32(&machine_data->diu_reg->diu_mode);
> if (diu_mode = MFB_MODE0)
> - out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */
> + out_be32(&machine_data->diu_reg->diu_mode, 0); /* disable DIU */
>
> /* Get the IRQ of the DIU */
> machine_data->irq = irq_of_parse_and_map(np, 0);
> @@ -1599,10 +1594,11 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> * by the bootloader, set dummy area descriptor otherwise.
> */
> if (diu_mode = MFB_MODE0)
> - out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr);
> + out_be32(&machine_data->diu_reg->desc[0],
> + machine_data->dummy_ad->paddr);
>
> - out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
> - out_be32(&dr.diu_reg->desc[2], machine_data->dummy_ad->paddr);
> + out_be32(&machine_data->diu_reg->desc[1], machine_data->dummy_ad->paddr);
> + out_be32(&machine_data->diu_reg->desc[2], machine_data->dummy_ad->paddr);
>
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
> machine_data->fsl_diu_info[i]->fix.smem_start = 0;
> @@ -1617,7 +1613,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
> }
> }
>
> - if (request_irq_local(machine_data->irq)) {
> + if (request_irq_local(machine_data)) {
> dev_err(&pdev->dev, "could not claim irq\n");
> goto error;
> }
> @@ -1651,7 +1647,7 @@ error:
> 32);
> if (machine_data->dummy_aoi_virt)
> fsl_diu_free(machine_data->dummy_aoi_virt, 64);
> - iounmap(dr.diu_reg);
> + iounmap(machine_data->diu_reg);
>
> error2:
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
> @@ -1669,7 +1665,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
>
> machine_data = dev_get_drvdata(&pdev->dev);
> disable_lcdc(machine_data->fsl_diu_info[0]);
> - free_irq_local(machine_data->irq);
> + free_irq_local(machine_data);
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
> uninstall_fb(machine_data->fsl_diu_info[i]);
> if (pool.ad.vaddr)
> @@ -1681,7 +1677,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
> free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
> if (machine_data->dummy_aoi_virt)
> fsl_diu_free(machine_data->dummy_aoi_virt, 64);
> - iounmap(dr.diu_reg);
> + iounmap(machine_data->diu_reg);
> for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
> if (machine_data->fsl_diu_info[i])
> framebuffer_release(machine_data->fsl_diu_info[i]);
> @@ -1804,7 +1800,6 @@ static int __init fsl_diu_init(void)
> #if defined(CONFIG_NOT_COHERENT_CACHE)
> vfree(coherence_data);
> #endif
> - iounmap(dr.diu_reg);
> }
> return ret;
> }
^ permalink raw reply
* Re: [PATCH v2 2/2] fb: add events for early fb event support.
From: Florian Tobias Schandinat @ 2011-10-02 0:18 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317047842-12220-1-git-send-email-inki.dae@samsung.com>
On 09/27/2011 04:48 AM, Inki Dae wrote:
>
>> -----Original Message-----
>> From: Inki Dae [mailto:inki.dae@samsung.com]
>> Sent: Monday, September 26, 2011 11:37 PM
>> To: FlorianSchandinat@gmx.de; linux-fbdev@vger.kernel.org
>> Cc: kyungmin.park@samsung.com; lars@metafoo.de; Inki Dae
>> Subject: [PATCH v2 2/2] fb: add events for early fb event support.
>>
>> this patch adds FB_EARLY_EVENT_BLANK and FB_R_EARLY_EVENT_BLANK
>> event mode supports. first, fb_notifier_call_chain() is called with
>> FB_EARLY_EVENT_BLANK and fb_blank() of specific fb driver is called
>> and then fb_notifier_call_chain() is called with FB_EVENT_BLANK again
>> at fb_blank(). and if fb_blank() was failed then fb_nitifier_call_chain()
>> would be called with FB_R_EARLY_EVENT_BLANK to revert the previous
> effects.
Is my assumption correct that the framebuffer driver is independent of the
specific LCD driver and therefore they can be used independently (at least in
theory)? If the answer is yes and there is no direct dependance this looks like
the right solution. I could take this patch (or rather the fixed up version when
you send it) but I'm unsure how to progress with the LCD part, would be nice to
get Richard's Ack on it.
Best regards,
Florian Tobias Schandinat
>>
>> Signed-off-by: Inki Dae <inki.dae@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> drivers/video/fbmem.c | 21 +++++++++++++++------
>> include/linux/fb.h | 4 ++++
>> 2 files changed, 19 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
>> index ad93629..a2bd17b 100644
>> --- a/drivers/video/fbmem.c
>> +++ b/drivers/video/fbmem.c
>> @@ -1032,20 +1032,29 @@ fb_set_var(struct fb_info *info, struct
>> fb_var_screeninfo *var)
>> int
>> fb_blank(struct fb_info *info, int blank)
>> {
>> - int ret = -EINVAL;
>> + struct fb_event event;
>> + int ret = -EINVAL, early_ret;
>>
>> if (blank > FB_BLANK_POWERDOWN)
>> blank = FB_BLANK_POWERDOWN;
>>
>> + event.info = info;
>> + event.data = ␣
>> +
>> + early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
>> +
>> if (info->fbops->fb_blank)
>> ret = info->fbops->fb_blank(blank, info);
>>
>> - if (!ret) {
>> - struct fb_event event;
>> -
>> - event.info = info;
>> - event.data = ␣
>> + if (!ret)
>> fb_notifier_call_chain(FB_EVENT_BLANK, &event);
>> + else {
>> + /*
>> + * if fb_blank is failed then revert effects of
>> + * the early blank event.
>> + */
>> + if (early_ret < 0)
>
> Ah, this is condition wrong so I will fix it to "if (!early_ret)".
>
>> + fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK,
> &event);
>> }
>>
>> return ret;
>> diff --git a/include/linux/fb.h b/include/linux/fb.h
>> index 1d6836c..29f53d5 100644
>> --- a/include/linux/fb.h
>> +++ b/include/linux/fb.h
>> @@ -549,6 +549,10 @@ struct fb_cursor_user {
>> #define FB_EVENT_FB_UNBIND 0x0E
>> /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga
>> switcheroo */
>> #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
>> +/* A hardware display blank early change occured */
>> +#define FB_EARLY_EVENT_BLANK 0x10
>> +/* A hardware display blank revert early change occured */
>> +#define FB_R_EARLY_EVENT_BLANK 0x11
>>
>> struct fb_event {
>> struct fb_info *info;
>> --
>> 1.7.4.1
>
^ permalink raw reply
* [PATCH] fb: fix au1100fb bitrot.
From: Manuel Lauss @ 2011-09-30 18:49 UTC (permalink / raw)
To: linux-fbdev
Removes some bitrot from the au1100fb driver and fix it up so it works again.
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
Tested on a DB1100 board.
drivers/video/au1100fb.c | 181 +++++++++++++++-------------------------------
drivers/video/au1100fb.h | 6 +--
2 files changed, 61 insertions(+), 126 deletions(-)
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c
index 93b98bb..de9da67 100644
--- a/drivers/video/au1100fb.c
+++ b/drivers/video/au1100fb.c
@@ -98,12 +98,6 @@ static struct fb_var_screeninfo au1100fb_var __devinitdata = {
.vmode = FB_VMODE_NONINTERLACED,
};
-static struct au1100fb_drv_info drv_info;
-
-static int nocursor = 0;
-module_param(nocursor, int, 0644);
-MODULE_PARM_DESC(nocursor, "cursor enable/disable");
-
/* fb_blank
* Blank the screen. Depending on the mode, the screen will be
* activated with the backlight color, or desactivated
@@ -120,7 +114,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
/* Turn on panel */
fbdev->regs->lcd_control |= LCD_CONTROL_GO;
#ifdef CONFIG_MIPS_PB1100
- if (drv_info.panel_idx = 1) {
+ if (fbdev->panel_idx = 1) {
au_writew(au_readw(PB1100_G_CONTROL)
| (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
PB1100_G_CONTROL);
@@ -135,7 +129,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
/* Turn off panel */
fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
#ifdef CONFIG_MIPS_PB1100
- if (drv_info.panel_idx = 1) {
+ if (fbdev->panel_idx = 1) {
au_writew(au_readw(PB1100_G_CONTROL)
& ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
PB1100_G_CONTROL);
@@ -416,17 +410,6 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
return 0;
}
-/* fb_cursor
- * Used to disable cursor drawing...
- */
-int au1100fb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
-{
- if (nocursor)
- return 0;
- else
- return -EINVAL; /* just to force soft_cursor() call */
-}
-
static struct fb_ops au1100fb_ops {
.owner = THIS_MODULE,
@@ -438,13 +421,53 @@ static struct fb_ops au1100fb_ops .fb_imageblit = cfb_imageblit,
.fb_rotate = au1100fb_fb_rotate,
.fb_mmap = au1100fb_fb_mmap,
- .fb_cursor = au1100fb_fb_cursor,
};
/*-------------------------------------------------------------------------*/
-/* AU1100 LCD controller device driver */
+static int au1100fb_setup(struct au1100fb_device *fbdev)
+{
+ char *this_opt, *options;
+ int num_panels = ARRAY_SIZE(known_lcd_panels);
+
+ if (num_panels <= 0) {
+ print_err("No LCD panels supported by driver!");
+ return -ENODEV;
+ }
+
+ if (fb_get_options(DRIVER_NAME, &options))
+ return -ENODEV;
+ if (!options)
+ return -ENODEV;
+
+ while ((this_opt = strsep(&options, ",")) != NULL) {
+ /* Panel option */
+ if (!strncmp(this_opt, "panel:", 6)) {
+ int i;
+ this_opt += 6;
+ for (i = 0; i < num_panels; i++) {
+ if (!strncmp(this_opt, known_lcd_panels[i].name,
+ strlen(this_opt))) {
+ fbdev->panel = &known_lcd_panels[i];
+ fbdev->panel_idx = i;
+ break;
+ }
+ }
+ if (i >= num_panels) {
+ print_warn("Panel '%s' not supported!", this_opt);
+ return -ENODEV;
+ }
+ }
+ /* Unsupported option */
+ else
+ print_warn("Unsupported option \"%s\"", this_opt);
+ }
+
+ print_info("Panel=%s", fbdev->panel->name);
+
+ return 0;
+}
static int __devinit au1100fb_drv_probe(struct platform_device *dev)
{
@@ -453,22 +476,21 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
unsigned long page;
u32 sys_clksrc;
- if (!dev)
- return -EINVAL;
-
/* Allocate new device private */
- if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) {
+ fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL);
+ if (!fbdev) {
print_err("fail to allocate device private record");
return -ENOMEM;
}
- fbdev->panel = &known_lcd_panels[drv_info.panel_idx];
+ if (au1100fb_setup(fbdev))
+ goto failed;
platform_set_drvdata(dev, (void *)fbdev);
/* Allocate region for our registers and map them */
- if (!(regs_res = platform_get_resource(to_platform_device(dev),
- IORESOURCE_MEM, 0))) {
+ regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ if (!regs_res) {
print_err("fail to retrieve registers resource");
return -EFAULT;
}
@@ -488,13 +510,11 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
print_dbg("Register memory map at %p", fbdev->regs);
print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
-
-
/* Allocate the framebuffer to the maximum screen size * nbr of video buffers */
fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
(fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
- fbdev->fb_mem = dma_alloc_coherent(dev, PAGE_ALIGN(fbdev->fb_len),
+ fbdev->fb_mem = dma_alloc_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len),
&fbdev->fb_phys, GFP_KERNEL);
if (!fbdev->fb_mem) {
print_err("fail to allocate frambuffer (size: %dK))",
@@ -513,7 +533,7 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len);
page += PAGE_SIZE) {
#if CONFIG_DMA_NONCOHERENT
- SetPageReserved(virt_to_page(CAC_ADDR(page)));
+ SetPageReserved(virt_to_page(CAC_ADDR((void *)page)));
#else
SetPageReserved(virt_to_page(page));
#endif
@@ -566,7 +586,8 @@ failed:
release_mem_region(fbdev->regs_phys, fbdev->regs_len);
}
if (fbdev->fb_mem) {
- dma_free_noncoherent(dev, fbdev->fb_len, fbdev->fb_mem, fbdev->fb_phys);
+ dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem,
+ fbdev->fb_phys);
}
if (fbdev->info.cmap.len != 0) {
fb_dealloc_cmap(&fbdev->info.cmap);
@@ -596,7 +617,8 @@ int au1100fb_drv_remove(struct platform_device *dev)
release_mem_region(fbdev->regs_phys, fbdev->regs_len);
- dma_free_coherent(dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem, fbdev->fb_phys);
+ dma_free_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem,
+ fbdev->fb_phys);
fb_dealloc_cmap(&fbdev->info.cmap);
kfree(fbdev->info.pseudo_palette);
@@ -663,101 +685,18 @@ static struct platform_driver au1100fb_driver = {
.resume = au1100fb_drv_resume,
};
-/*-------------------------------------------------------------------------*/
-
-/* Kernel driver */
-
-int au1100fb_setup(char *options)
-{
- char* this_opt;
- int num_panels = ARRAY_SIZE(known_lcd_panels);
- char* mode = NULL;
- int panel_idx = 0;
-
- if (num_panels <= 0) {
- print_err("No LCD panels supported by driver!");
- return -EFAULT;
- }
-
- if (options) {
- while ((this_opt = strsep(&options,",")) != NULL) {
- /* Panel option */
- if (!strncmp(this_opt, "panel:", 6)) {
- int i;
- this_opt += 6;
- for (i = 0; i < num_panels; i++) {
- if (!strncmp(this_opt,
- known_lcd_panels[i].name,
- strlen(this_opt))) {
- panel_idx = i;
- break;
- }
- }
- if (i >= num_panels) {
- print_warn("Panel %s not supported!", this_opt);
- }
- }
- if (!strncmp(this_opt, "nocursor", 8)) {
- this_opt += 8;
- nocursor = 1;
- print_info("Cursor disabled");
- }
- /* Mode option (only option that start with digit) */
- else if (isdigit(this_opt[0])) {
- mode = kstrdup(this_opt, GFP_KERNEL);
- if (!mode) {
- print_err("memory allocation failed");
- return -ENOMEM;
- }
- }
- /* Unsupported option */
- else {
- print_warn("Unsupported option \"%s\"", this_opt);
- }
- }
- }
-
- drv_info.panel_idx = panel_idx;
- drv_info.opt_mode = mode;
-
- print_info("Panel=%s Mode=%s",
- known_lcd_panels[drv_info.panel_idx].name,
- drv_info.opt_mode ? drv_info.opt_mode : "default");
-
- return 0;
-}
-
-int __init au1100fb_init(void)
+static int __init au1100fb_load(void)
{
- char* options;
- int ret;
-
- print_info("" DRIVER_DESC "");
-
- memset(&drv_info, 0, sizeof(drv_info));
-
- if (fb_get_options(DRIVER_NAME, &options))
- return -ENODEV;
-
- /* Setup driver with options */
- ret = au1100fb_setup(options);
- if (ret < 0) {
- print_err("Fail to setup driver");
- return ret;
- }
-
return platform_driver_register(&au1100fb_driver);
}
-void __exit au1100fb_cleanup(void)
+static void __exit au1100fb_unload(void)
{
platform_driver_unregister(&au1100fb_driver);
-
- kfree(drv_info.opt_mode);
}
-module_init(au1100fb_init);
-module_exit(au1100fb_cleanup);
+module_init(au1100fb_load);
+module_exit(au1100fb_unload);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
diff --git a/drivers/video/au1100fb.h b/drivers/video/au1100fb.h
index 164fe2f..12d9642 100644
--- a/drivers/video/au1100fb.h
+++ b/drivers/video/au1100fb.h
@@ -108,6 +108,7 @@ struct au1100fb_device {
unsigned char* fb_mem; /* FrameBuffer memory map */
size_t fb_len;
dma_addr_t fb_phys;
+ int panel_idx;
};
/********************************************************************/
@@ -364,11 +365,6 @@ static struct au1100fb_panel known_lcd_panels[] },
};
-struct au1100fb_drv_info {
- int panel_idx;
- char *opt_mode;
-};
-
/********************************************************************/
/* Inline helpers */
--
1.7.6.1
^ permalink raw reply related
* Re: [PATCH 4/9] drivers/video: fsl-diu-fb: add several new video
From: Timur Tabi @ 2011-09-28 21:23 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1317244795-24671-4-git-send-email-timur@freescale.com>
Timur Tabi wrote:
> Also add margin data to the 320x240 video mode. This mode was originally
> intended only for the AOIs (overlays) used on planes two and three, but with
> real margin data, it can now be used as an actual video mode.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
Ugh, I forgot something in this commit message. Florian, if you apply this
patch, would you mind adding this:
Video mode data is from earlier work done by Jerry Huang
<Chang-Ming.Huang@freescale.com>.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* [PATCH 9/9] drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
The diu_pool structure contains diu_addr objects for various objects
allocated in DMA space that are used by the DIU, but the only instance
of this structure is a global variable, 'pool'. Eliminate 'pool' by
merging its fields into the fsl_diu_data structure, which is instantiated
on the heap for each DIU controller found.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 72 +++++++++++++++++++++----------------------
1 files changed, 35 insertions(+), 37 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 728cd9f..83bc825 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -55,13 +55,6 @@ struct diu_addr {
__u32 offset;
};
-struct diu_pool {
- struct diu_addr ad;
- struct diu_addr gamma;
- struct diu_addr pallete;
- struct diu_addr cursor;
-};
-
/*
* List of supported video modes
*
@@ -349,6 +342,10 @@ struct fsl_diu_data {
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
unsigned int mode; /* DIU operation mode */
+ struct diu_addr ad;
+ struct diu_addr gamma;
+ struct diu_addr pallete;
+ struct diu_addr cursor;
};
enum mfb_index {
@@ -422,8 +419,6 @@ static struct mfb_info mfb_template[] = {
},
};
-static struct diu_pool pool;
-
/**
* fsl_diu_name_to_port - convert a port name to a monitor port enum
*
@@ -825,22 +820,23 @@ static void update_lcdc(struct fb_info *info)
hw = machine_data->diu_reg;
diu_ops.set_monitor_port(machine_data->monitor_port);
- gamma_table_base = pool.gamma.vaddr;
- cursor_base = pool.cursor.vaddr;
+ gamma_table_base = machine_data->gamma.vaddr;
+ cursor_base = machine_data->cursor.vaddr;
/* Prep for DIU init - gamma table, cursor table */
for (i = 0; i <= 2; i++)
for (j = 0; j <= 255; j++)
*gamma_table_base++ = j;
- diu_ops.set_gamma_table(machine_data->monitor_port, pool.gamma.vaddr);
+ diu_ops.set_gamma_table(machine_data->monitor_port,
+ machine_data->gamma.vaddr);
disable_lcdc(info);
/* Program DIU registers */
- out_be32(&hw->gamma, pool.gamma.paddr);
- out_be32(&hw->cursor, pool.cursor.paddr);
+ out_be32(&hw->gamma, machine_data->gamma.paddr);
+ out_be32(&hw->cursor, machine_data->cursor.paddr);
out_be32(&hw->bgnd, 0x007F7F7F); /* BGND */
out_be32(&hw->bgnd_wb, 0); /* BGND_WB */
@@ -1554,27 +1550,27 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
machine_data->monitor_port = monitor_port;
/* Area descriptor memory pool aligns to 64-bit boundary */
- if (allocate_buf(&pdev->dev, &pool.ad,
+ if (allocate_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8))
return -ENOMEM;
/* Get memory for Gamma Table - 32-byte aligned memory */
- if (allocate_buf(&pdev->dev, &pool.gamma, 768, 32)) {
+ if (allocate_buf(&pdev->dev, &machine_data->gamma, 768, 32)) {
ret = -ENOMEM;
goto error;
}
/* For performance, cursor bitmap buffer aligns to 32-byte boundary */
- if (allocate_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
- 32)) {
+ if (allocate_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32)) {
ret = -ENOMEM;
goto error;
}
i = ARRAY_SIZE(machine_data->fsl_diu_info);
- machine_data->dummy_ad = (struct diu_ad *)
- ((u32)pool.ad.vaddr + pool.ad.offset) + i;
- machine_data->dummy_ad->paddr = pool.ad.paddr +
+ machine_data->dummy_ad = (struct diu_ad *)((u32)machine_data->ad.vaddr +
+ machine_data->ad.offset) + i;
+ machine_data->dummy_ad->paddr = machine_data->ad.paddr +
i * sizeof(struct diu_ad);
machine_data->dummy_aoi_virt = fsl_diu_alloc(64, &dummy_ad_addr);
if (!machine_data->dummy_aoi_virt) {
@@ -1603,9 +1599,10 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i]->fix.smem_start = 0;
mfbi = machine_data->fsl_diu_info[i]->par;
- mfbi->ad = (struct diu_ad *)((u32)pool.ad.vaddr
- + pool.ad.offset) + i;
- mfbi->ad->paddr = pool.ad.paddr + i * sizeof(struct diu_ad);
+ mfbi->ad = (struct diu_ad *)((u32)machine_data->ad.vaddr
+ + machine_data->ad.offset) + i;
+ mfbi->ad->paddr + machine_data->ad.paddr + i * sizeof(struct diu_ad);
ret = install_fb(machine_data->fsl_diu_info[i]);
if (ret) {
dev_err(&pdev->dev, "could not register fb %d\n", i);
@@ -1637,14 +1634,14 @@ error:
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
- if (pool.ad.vaddr)
- free_buf(&pdev->dev, &pool.ad,
+ if (machine_data->ad.vaddr)
+ free_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
- if (pool.gamma.vaddr)
- free_buf(&pdev->dev, &pool.gamma, 768, 32);
- if (pool.cursor.vaddr)
- free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2,
- 32);
+ if (machine_data->gamma.vaddr)
+ free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
+ if (machine_data->cursor.vaddr)
+ free_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
iounmap(machine_data->diu_reg);
@@ -1668,13 +1665,14 @@ static int fsl_diu_remove(struct platform_device *pdev)
free_irq_local(machine_data);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
- if (pool.ad.vaddr)
- free_buf(&pdev->dev, &pool.ad,
+ if (machine_data->ad.vaddr)
+ free_buf(&pdev->dev, &machine_data->ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
- if (pool.gamma.vaddr)
- free_buf(&pdev->dev, &pool.gamma, 768, 32);
- if (pool.cursor.vaddr)
- free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
+ if (machine_data->gamma.vaddr)
+ free_buf(&pdev->dev, &machine_data->gamma, 768, 32);
+ if (machine_data->cursor.vaddr)
+ free_buf(&pdev->dev, &machine_data->cursor,
+ MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
iounmap(machine_data->diu_reg);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 8/9] drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
The diu_hw structure contains two fields used to access the DIU registers,
but the only instance of this structure is a global variable, 'dr'.
Eliminate 'dr' by merging its fields into the fsl_diu_data structure,
which is instantiated on the heap for each DIU controller found.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 71 ++++++++++++++++++++-----------------------
1 files changed, 33 insertions(+), 38 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 41f767b..728cd9f 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -49,11 +49,6 @@
#define INT_PARERR 0x08 /* Display parameters error interrupt */
#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-struct diu_hw {
- struct diu __iomem *diu_reg;
- spinlock_t reg_lock;
-};
-
struct diu_addr {
void *vaddr; /* Virtual address */
dma_addr_t paddr; /* Physical address */
@@ -351,6 +346,9 @@ struct fsl_diu_data {
unsigned int irq;
int fb_enabled;
enum fsl_diu_monitor_port monitor_port;
+ struct diu __iomem *diu_reg;
+ spinlock_t reg_lock;
+ unsigned int mode; /* DIU operation mode */
};
enum mfb_index {
@@ -424,10 +422,6 @@ static struct mfb_info mfb_template[] = {
},
};
-static struct diu_hw dr = {
- .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
-};
-
static struct diu_pool pool;
/**
@@ -506,9 +500,9 @@ void wr_reg_wa(u32 *reg, u32 val)
static void fsl_diu_enable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
- struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
switch (mfbi->index) {
case PLANE0:
@@ -559,9 +553,9 @@ static void fsl_diu_enable_panel(struct fb_info *info)
static void fsl_diu_disable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
- struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
switch (mfbi->index) {
case PLANE0:
@@ -613,9 +607,9 @@ static void fsl_diu_disable_panel(struct fb_info *info)
static void enable_lcdc(struct fb_info *info)
{
- struct diu *hw = dr.diu_reg;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
if (!machine_data->fb_enabled) {
out_be32(&hw->diu_mode, MFB_MODE1);
@@ -625,9 +619,9 @@ static void enable_lcdc(struct fb_info *info)
static void disable_lcdc(struct fb_info *info)
{
- struct diu *hw = dr.diu_reg;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
+ struct diu __iomem *hw = machine_data->diu_reg;
if (machine_data->fb_enabled) {
out_be32(&hw->diu_mode, 0);
@@ -822,13 +816,13 @@ static void update_lcdc(struct fb_info *info)
struct fb_var_screeninfo *var = &info->var;
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
- struct diu *hw;
+ struct diu __iomem *hw;
int i, j;
char __iomem *cursor_base, *gamma_table_base;
u32 temp;
- hw = dr.diu_reg;
+ hw = machine_data->diu_reg;
diu_ops.set_monitor_port(machine_data->monitor_port);
gamma_table_base = pool.gamma.vaddr;
@@ -939,9 +933,9 @@ static int fsl_diu_set_par(struct fb_info *info)
struct mfb_info *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
struct diu_ad *ad = mfbi->ad;
- struct diu *hw;
+ struct diu __iomem *hw;
- hw = dr.diu_reg;
+ hw = machine_data->diu_reg;
set_fix(info);
mfbi->cursor_reset = 1;
@@ -1336,7 +1330,7 @@ static void uninstall_fb(struct fb_info *info)
static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
{
- struct diu *hw = dr.diu_reg;
+ struct diu __iomem *hw = dev_id;
unsigned int status = in_be32(&hw->int_status);
if (status) {
@@ -1362,18 +1356,16 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
return IRQ_NONE;
}
-static int request_irq_local(int irq)
+static int request_irq_local(struct fsl_diu_data *machine_data)
{
+ struct diu __iomem *hw = machine_data->diu_reg;
u32 ints;
- struct diu *hw;
int ret;
- hw = dr.diu_reg;
-
/* Read to clear the status */
in_be32(&hw->int_status);
- ret = request_irq(irq, fsl_diu_isr, 0, "fsl-diu-fb", NULL);
+ ret = request_irq(machine_data->irq, fsl_diu_isr, 0, "fsl-diu-fb", hw);
if (!ret) {
ints = INT_PARERR | INT_LS_BF_VS;
#if !defined(CONFIG_NOT_COHERENT_CACHE)
@@ -1388,14 +1380,14 @@ static int request_irq_local(int irq)
return ret;
}
-static void free_irq_local(int irq)
+static void free_irq_local(struct fsl_diu_data *machine_data)
{
- struct diu *hw = dr.diu_reg;
+ struct diu __iomem *hw = machine_data->diu_reg;
/* Disable all LCDC interrupt */
out_be32(&hw->int_mask, 0x1f);
- free_irq(irq, NULL);
+ free_irq(machine_data->irq, NULL);
}
#ifdef CONFIG_PM
@@ -1513,6 +1505,9 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
if (!machine_data)
return -ENOMEM;
+ machine_data->mode = MFB_MODE1;
+ spin_lock_init(&machine_data->reg_lock);
+
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i] framebuffer_alloc(sizeof(struct mfb_info), &pdev->dev);
@@ -1537,16 +1532,16 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
}
- dr.diu_reg = of_iomap(np, 0);
- if (!dr.diu_reg) {
+ machine_data->diu_reg = of_iomap(np, 0);
+ if (!machine_data->diu_reg) {
dev_err(&pdev->dev, "cannot map DIU registers\n");
ret = -EFAULT;
goto error2;
}
- diu_mode = in_be32(&dr.diu_reg->diu_mode);
+ diu_mode = in_be32(&machine_data->diu_reg->diu_mode);
if (diu_mode = MFB_MODE0)
- out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */
+ out_be32(&machine_data->diu_reg->diu_mode, 0); /* disable DIU */
/* Get the IRQ of the DIU */
machine_data->irq = irq_of_parse_and_map(np, 0);
@@ -1599,10 +1594,11 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
* by the bootloader, set dummy area descriptor otherwise.
*/
if (diu_mode = MFB_MODE0)
- out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[0],
+ machine_data->dummy_ad->paddr);
- out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
- out_be32(&dr.diu_reg->desc[2], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[1], machine_data->dummy_ad->paddr);
+ out_be32(&machine_data->diu_reg->desc[2], machine_data->dummy_ad->paddr);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++) {
machine_data->fsl_diu_info[i]->fix.smem_start = 0;
@@ -1617,7 +1613,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
}
- if (request_irq_local(machine_data->irq)) {
+ if (request_irq_local(machine_data)) {
dev_err(&pdev->dev, "could not claim irq\n");
goto error;
}
@@ -1651,7 +1647,7 @@ error:
32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
- iounmap(dr.diu_reg);
+ iounmap(machine_data->diu_reg);
error2:
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
@@ -1669,7 +1665,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
machine_data = dev_get_drvdata(&pdev->dev);
disable_lcdc(machine_data->fsl_diu_info[0]);
- free_irq_local(machine_data->irq);
+ free_irq_local(machine_data);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
uninstall_fb(machine_data->fsl_diu_info[i]);
if (pool.ad.vaddr)
@@ -1681,7 +1677,7 @@ static int fsl_diu_remove(struct platform_device *pdev)
free_buf(&pdev->dev, &pool.cursor, MAX_CURS * MAX_CURS * 2, 32);
if (machine_data->dummy_aoi_virt)
fsl_diu_free(machine_data->dummy_aoi_virt, 64);
- iounmap(dr.diu_reg);
+ iounmap(machine_data->diu_reg);
for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
if (machine_data->fsl_diu_info[i])
framebuffer_release(machine_data->fsl_diu_info[i]);
@@ -1804,7 +1800,6 @@ static int __init fsl_diu_init(void)
#if defined(CONFIG_NOT_COHERENT_CACHE)
vfree(coherence_data);
#endif
- iounmap(dr.diu_reg);
}
return ret;
}
--
1.7.3.4
^ permalink raw reply related
* [PATCH 7/9] drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
The Freescale DIU video controller supports five video "modes", but only
the first two are used by the driver. The other three are special modes
that don't make sense for a framebuffer driver. Therefore, there's no
point in keeping a global variable that indicates which mode we're
supposed to use.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
arch/powerpc/platforms/512x/mpc512x_shared.c | 2 +-
drivers/video/fsl-diu-fb.c | 11 +++--------
include/linux/fsl-diu-fb.h | 8 ++++----
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index 3dc62f9..cfe958e 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -253,7 +253,7 @@ void __init mpc512x_init_diu(void)
}
mode = in_be32(&diu_reg->diu_mode);
- if (mode != MFB_MODE1) {
+ if (mode = MFB_MODE0) {
pr_info("%s: DIU OFF\n", __func__);
goto out;
}
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index dd98675..41f767b 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -52,7 +52,6 @@
struct diu_hw {
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
- unsigned int mode; /* DIU operation mode */
};
struct diu_addr {
@@ -426,7 +425,6 @@ static struct mfb_info mfb_template[] = {
};
static struct diu_hw dr = {
- .mode = MFB_MODE1,
.reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
};
@@ -620,7 +618,7 @@ static void enable_lcdc(struct fb_info *info)
struct fsl_diu_data *machine_data = mfbi->parent;
if (!machine_data->fb_enabled) {
- out_be32(&hw->diu_mode, dr.mode);
+ out_be32(&hw->diu_mode, MFB_MODE1);
machine_data->fb_enabled++;
}
}
@@ -1382,9 +1380,6 @@ static int request_irq_local(int irq)
ints |= INT_VSYNC;
#endif
- if (dr.mode = MFB_MODE2 || dr.mode = MFB_MODE3)
- ints |= INT_VSYNC_WB;
-
/* Read to clear the status */
in_be32(&hw->int_status);
out_be32(&hw->int_mask, ints);
@@ -1550,7 +1545,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
}
diu_mode = in_be32(&dr.diu_reg->diu_mode);
- if (diu_mode != MFB_MODE1)
+ if (diu_mode = MFB_MODE0)
out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */
/* Get the IRQ of the DIU */
@@ -1603,7 +1598,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
* Let DIU display splash screen if it was pre-initialized
* by the bootloader, set dummy area descriptor otherwise.
*/
- if (diu_mode != MFB_MODE1)
+ if (diu_mode = MFB_MODE0)
out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr);
out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 51457ec..17a9097 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -144,12 +144,12 @@ struct diu {
__be32 plut;
} __attribute__ ((packed));
-/* Modes of operation of DIU */
+/*
+ * Modes of operation of DIU. The DIU supports five different modes, but
+ * the driver only supports modes 0 and 1.
+ */
#define MFB_MODE0 0 /* DIU off */
#define MFB_MODE1 1 /* All three planes output to display */
-#define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/
-#define MFB_MODE3 3 /* All three planes written back to memory */
-#define MFB_MODE4 4 /* Color bar generation */
#endif /* __KERNEL__ */
#endif /* __FSL_DIU_FB_H__ */
--
1.7.3.4
^ permalink raw reply related
* [PATCH 6/9] drivers/video: fsl-diu-fb: remove unused panel operating mode support
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
The MFB_TYPE_xxx macros indicate different "operating modes" of each AOI,
but this feature is not actually used in the driver. The mfb_index.type
field is always set to MFB_TYPE_OUTPUT, so just delete it and any code
that references it.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 117 +++++++++++++++++--------------------------
1 files changed, 46 insertions(+), 71 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 712b91c..dd98675 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -49,12 +49,6 @@
#define INT_PARERR 0x08 /* Display parameters error interrupt */
#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-/* Panels'operation modes */
-#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
-#define MFB_TYPE_OFF 1 /* Panel off */
-#define MFB_TYPE_WB 2 /* Panel written back to memory */
-#define MFB_TYPE_TEST 3 /* Panel generate color bar */
-
struct diu_hw {
struct diu __iomem *diu_reg;
spinlock_t reg_lock;
@@ -370,7 +364,6 @@ enum mfb_index {
struct mfb_info {
enum mfb_index index;
- int type;
char *id;
int registered;
unsigned long pseudo_palette[16];
@@ -388,7 +381,6 @@ struct mfb_info {
static struct mfb_info mfb_template[] = {
{
.index = PLANE0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel0",
.registered = 0,
.count = 0,
@@ -397,7 +389,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE1_AOI0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI0",
.registered = 0,
.g_alpha = 0xff,
@@ -407,7 +398,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE1_AOI1,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI1",
.registered = 0,
.g_alpha = 0xff,
@@ -417,7 +407,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE2_AOI0,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI0",
.registered = 0,
.g_alpha = 0xff,
@@ -427,7 +416,6 @@ static struct mfb_info mfb_template[] = {
},
{
.index = PLANE2_AOI1,
- .type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI1",
.registered = 0,
.g_alpha = 0xff,
@@ -517,62 +505,57 @@ void wr_reg_wa(u32 *reg, u32 val)
} while (in_be32(reg) != val);
}
-static int fsl_diu_enable_panel(struct fb_info *info)
+static void fsl_diu_enable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
- int res = 0;
- if (mfbi->type != MFB_TYPE_OFF) {
- switch (mfbi->index) {
- case PLANE0:
- if (hw->desc[0] != ad->paddr)
- wr_reg_wa(&hw->desc[0], ad->paddr);
- break;
- case PLANE1_AOI0:
- cmfbi = machine_data->fsl_diu_info[2]->par;
- if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
- if (cmfbi->count > 0) /* AOI1 open */
- ad->next_ad - cpu_to_le32(cmfbi->ad->paddr);
- else
- ad->next_ad = 0;
- wr_reg_wa(&hw->desc[1], ad->paddr);
- }
- break;
- case PLANE2_AOI0:
- cmfbi = machine_data->fsl_diu_info[4]->par;
- if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
- if (cmfbi->count > 0) /* AOI1 open */
- ad->next_ad - cpu_to_le32(cmfbi->ad->paddr);
- else
- ad->next_ad = 0;
- wr_reg_wa(&hw->desc[2], ad->paddr);
- }
- break;
- case PLANE1_AOI1:
- pmfbi = machine_data->fsl_diu_info[1]->par;
- ad->next_ad = 0;
- if (hw->desc[1] = machine_data->dummy_ad->paddr)
- wr_reg_wa(&hw->desc[1], ad->paddr);
- else /* AOI0 open */
- pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
- break;
- case PLANE2_AOI1:
- pmfbi = machine_data->fsl_diu_info[3]->par;
- ad->next_ad = 0;
- if (hw->desc[2] = machine_data->dummy_ad->paddr)
- wr_reg_wa(&hw->desc[2], ad->paddr);
- else /* AOI0 was open */
- pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
- break;
+ switch (mfbi->index) {
+ case PLANE0:
+ if (hw->desc[0] != ad->paddr)
+ wr_reg_wa(&hw->desc[0], ad->paddr);
+ break;
+ case PLANE1_AOI0:
+ cmfbi = machine_data->fsl_diu_info[2]->par;
+ if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
+ if (cmfbi->count > 0) /* AOI1 open */
+ ad->next_ad + cpu_to_le32(cmfbi->ad->paddr);
+ else
+ ad->next_ad = 0;
+ wr_reg_wa(&hw->desc[1], ad->paddr);
}
- } else
- res = -EINVAL;
- return res;
+ break;
+ case PLANE2_AOI0:
+ cmfbi = machine_data->fsl_diu_info[4]->par;
+ if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
+ if (cmfbi->count > 0) /* AOI1 open */
+ ad->next_ad + cpu_to_le32(cmfbi->ad->paddr);
+ else
+ ad->next_ad = 0;
+ wr_reg_wa(&hw->desc[2], ad->paddr);
+ }
+ break;
+ case PLANE1_AOI1:
+ pmfbi = machine_data->fsl_diu_info[1]->par;
+ ad->next_ad = 0;
+ if (hw->desc[1] = machine_data->dummy_ad->paddr)
+ wr_reg_wa(&hw->desc[1], ad->paddr);
+ else /* AOI0 open */
+ pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
+ break;
+ case PLANE2_AOI1:
+ pmfbi = machine_data->fsl_diu_info[3]->par;
+ ad->next_ad = 0;
+ if (hw->desc[2] = machine_data->dummy_ad->paddr)
+ wr_reg_wa(&hw->desc[2], ad->paddr);
+ else /* AOI0 was open */
+ pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
+ break;
+ }
}
static void fsl_diu_disable_panel(struct fb_info *info)
@@ -849,11 +832,6 @@ static void update_lcdc(struct fb_info *info)
hw = dr.diu_reg;
- if (mfbi->type = MFB_TYPE_OFF) {
- fsl_diu_disable_panel(info);
- return;
- }
-
diu_ops.set_monitor_port(machine_data->monitor_port);
gamma_table_base = pool.gamma.vaddr;
cursor_base = pool.cursor.vaddr;
@@ -1197,11 +1175,8 @@ static int fsl_diu_open(struct fb_info *info, int user)
res = fsl_diu_set_par(info);
if (res < 0)
mfbi->count--;
- else {
- res = fsl_diu_enable_panel(info);
- if (res < 0)
- mfbi->count--;
- }
+ else
+ fsl_diu_enable_panel(info);
}
spin_unlock(&diu_lock);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 5/9] drivers/video: fsl-diu-fb: use an enum for the AOI index
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
Each of the five AOIs created by the DIU driver has a special purpose, and
they're not treated equally. It makes sense to identify them with an enum
instead of a hard-coded number.
Since the 'index' is now an enum, it can only contain allowed values, so
there's no need to check for an invalid value. This simplifies some other
code, such as fsl_diu_disable_panel(), which no longer needs to return an
error code.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 94 +++++++++++++++++++++----------------------
1 files changed, 46 insertions(+), 48 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 00ad1f4..712b91c 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -360,8 +360,16 @@ struct fsl_diu_data {
enum fsl_diu_monitor_port monitor_port;
};
+enum mfb_index {
+ PLANE0 = 0, /* Plane 0, only one AOI that fills the screen */
+ PLANE1_AOI0, /* Plane 1, first AOI */
+ PLANE1_AOI1, /* Plane 1, second AOI */
+ PLANE2_AOI0, /* Plane 2, first AOI */
+ PLANE2_AOI1, /* Plane 2, second AOI */
+};
+
struct mfb_info {
- int index;
+ enum mfb_index index;
int type;
char *id;
int registered;
@@ -378,8 +386,8 @@ struct mfb_info {
static struct mfb_info mfb_template[] = {
- { /* AOI 0 for plane 0 */
- .index = 0,
+ {
+ .index = PLANE0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel0",
.registered = 0,
@@ -387,8 +395,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 0,
},
- { /* AOI 0 for plane 1 */
- .index = 1,
+ {
+ .index = PLANE1_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI0",
.registered = 0,
@@ -397,8 +405,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 0,
},
- { /* AOI 1 for plane 1 */
- .index = 2,
+ {
+ .index = PLANE1_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel1 AOI1",
.registered = 0,
@@ -407,8 +415,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 0,
.y_aoi_d = 480,
},
- { /* AOI 0 for plane 2 */
- .index = 3,
+ {
+ .index = PLANE2_AOI0,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI0",
.registered = 0,
@@ -417,8 +425,8 @@ static struct mfb_info mfb_template[] = {
.x_aoi_d = 640,
.y_aoi_d = 0,
},
- { /* AOI 1 for plane 2 */
- .index = 4,
+ {
+ .index = PLANE2_AOI1,
.type = MFB_TYPE_OUTPUT,
.id = "Panel2 AOI1",
.registered = 0,
@@ -519,11 +527,11 @@ static int fsl_diu_enable_panel(struct fb_info *info)
if (mfbi->type != MFB_TYPE_OFF) {
switch (mfbi->index) {
- case 0: /* plane 0 */
+ case PLANE0:
if (hw->desc[0] != ad->paddr)
wr_reg_wa(&hw->desc[0], ad->paddr);
break;
- case 1: /* plane 1 AOI 0 */
+ case PLANE1_AOI0:
cmfbi = machine_data->fsl_diu_info[2]->par;
if (hw->desc[1] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
@@ -534,7 +542,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], ad->paddr);
}
break;
- case 3: /* plane 2 AOI 0 */
+ case PLANE2_AOI0:
cmfbi = machine_data->fsl_diu_info[4]->par;
if (hw->desc[2] != ad->paddr) { /* AOI0 closed */
if (cmfbi->count > 0) /* AOI1 open */
@@ -545,7 +553,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], ad->paddr);
}
break;
- case 2: /* plane 1 AOI 1 */
+ case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
ad->next_ad = 0;
if (hw->desc[1] = machine_data->dummy_ad->paddr)
@@ -553,7 +561,7 @@ static int fsl_diu_enable_panel(struct fb_info *info)
else /* AOI0 open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
- case 4: /* plane 2 AOI 1 */
+ case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
ad->next_ad = 0;
if (hw->desc[2] = machine_data->dummy_ad->paddr)
@@ -561,29 +569,25 @@ static int fsl_diu_enable_panel(struct fb_info *info)
else /* AOI0 was open */
pmfbi->ad->next_ad = cpu_to_le32(ad->paddr);
break;
- default:
- res = -EINVAL;
- break;
}
} else
res = -EINVAL;
return res;
}
-static int fsl_diu_disable_panel(struct fb_info *info)
+static void fsl_diu_disable_panel(struct fb_info *info)
{
struct mfb_info *pmfbi, *cmfbi, *mfbi = info->par;
struct diu *hw = dr.diu_reg;
struct diu_ad *ad = mfbi->ad;
struct fsl_diu_data *machine_data = mfbi->parent;
- int res = 0;
switch (mfbi->index) {
- case 0: /* plane 0 */
+ case PLANE0:
if (hw->desc[0] != machine_data->dummy_ad->paddr)
wr_reg_wa(&hw->desc[0], machine_data->dummy_ad->paddr);
break;
- case 1: /* plane 1 AOI 0 */
+ case PLANE1_AOI0:
cmfbi = machine_data->fsl_diu_info[2]->par;
if (cmfbi->count > 0) /* AOI1 is open */
wr_reg_wa(&hw->desc[1], cmfbi->ad->paddr);
@@ -592,7 +596,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
- case 3: /* plane 2 AOI 0 */
+ case PLANE2_AOI0:
cmfbi = machine_data->fsl_diu_info[4]->par;
if (cmfbi->count > 0) /* AOI1 is open */
wr_reg_wa(&hw->desc[2], cmfbi->ad->paddr);
@@ -601,7 +605,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 0 */
break;
- case 2: /* plane 1 AOI 1 */
+ case PLANE1_AOI1:
pmfbi = machine_data->fsl_diu_info[1]->par;
if (hw->desc[1] != ad->paddr) {
/* AOI1 is not the first in the chain */
@@ -612,7 +616,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[1], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
- case 4: /* plane 2 AOI 1 */
+ case PLANE2_AOI1:
pmfbi = machine_data->fsl_diu_info[3]->par;
if (hw->desc[2] != ad->paddr) {
/* AOI1 is not the first in the chain */
@@ -623,12 +627,7 @@ static int fsl_diu_disable_panel(struct fb_info *info)
wr_reg_wa(&hw->desc[2], machine_data->dummy_ad->paddr);
/* close AOI 1 */
break;
- default:
- res = -EINVAL;
- break;
}
-
- return res;
}
static void enable_lcdc(struct fb_info *info)
@@ -660,7 +659,8 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
{
struct mfb_info *lower_aoi_mfbi, *upper_aoi_mfbi, *mfbi = info->par;
struct fsl_diu_data *machine_data = mfbi->parent;
- int available_height, upper_aoi_bottom, index = mfbi->index;
+ int available_height, upper_aoi_bottom;
+ enum mfb_index index = mfbi->index;
int lower_aoi_is_open, upper_aoi_is_open;
__u32 base_plane_width, base_plane_height, upper_aoi_height;
@@ -672,14 +672,14 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
if (mfbi->y_aoi_d < 0)
mfbi->y_aoi_d = 0;
switch (index) {
- case 0:
+ case PLANE0:
if (mfbi->x_aoi_d != 0)
mfbi->x_aoi_d = 0;
if (mfbi->y_aoi_d != 0)
mfbi->y_aoi_d = 0;
break;
- case 1: /* AOI 0 */
- case 3:
+ case PLANE1_AOI0:
+ case PLANE2_AOI0:
lower_aoi_mfbi = machine_data->fsl_diu_info[index+1]->par;
lower_aoi_is_open = lower_aoi_mfbi->count > 0 ? 1 : 0;
if (var->xres > base_plane_width)
@@ -696,8 +696,8 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
if ((mfbi->y_aoi_d + var->yres) > available_height)
mfbi->y_aoi_d = available_height - var->yres;
break;
- case 2: /* AOI 1 */
- case 4:
+ case PLANE1_AOI1:
+ case PLANE2_AOI1:
upper_aoi_mfbi = machine_data->fsl_diu_info[index-1]->par;
upper_aoi_height machine_data->fsl_diu_info[index-1]->var.yres;
@@ -1002,7 +1002,7 @@ static int fsl_diu_set_par(struct fb_info *info)
ad->ckmin_g = 255;
ad->ckmin_b = 255;
- if (mfbi->index = 0)
+ if (mfbi->index = PLANE0)
update_lcdc(info);
return 0;
}
@@ -1187,7 +1187,7 @@ static int fsl_diu_open(struct fb_info *info, int user)
int res = 0;
/* free boot splash memory on first /dev/fb0 open */
- if (!mfbi->index && diu_ops.release_bootmem)
+ if ((mfbi->index = PLANE0) && diu_ops.release_bootmem)
diu_ops.release_bootmem();
spin_lock(&diu_lock);
@@ -1217,11 +1217,9 @@ static int fsl_diu_release(struct fb_info *info, int user)
spin_lock(&diu_lock);
mfbi->count--;
- if (mfbi->count = 0) {
- res = fsl_diu_disable_panel(info);
- if (res < 0)
- mfbi->count++;
- }
+ if (mfbi->count = 0)
+ fsl_diu_disable_panel(info);
+
spin_unlock(&diu_lock);
return res;
}
@@ -1267,7 +1265,7 @@ static int __devinit install_fb(struct fb_info *info)
if (init_fbinfo(info))
return -EINVAL;
- if (mfbi->index = 0) { /* plane 0 */
+ if (mfbi->index = PLANE0) {
if (mfbi->edid_data) {
/* Now build modedb from EDID */
fb_edid_to_monspecs(mfbi->edid_data, &info->monspecs);
@@ -1288,7 +1286,7 @@ static int __devinit install_fb(struct fb_info *info)
* For plane 0 we continue and look into
* driver's internal modedb.
*/
- if (mfbi->index = 0 && mfbi->edid_data)
+ if ((mfbi->index = PLANE0) && mfbi->edid_data)
has_default_mode = 0;
else
return -EINVAL;
@@ -1352,7 +1350,7 @@ static void uninstall_fb(struct fb_info *info)
if (!mfbi->registered)
return;
- if (mfbi->index = 0)
+ if (mfbi->index = PLANE0)
kfree(mfbi->edid_data);
unregister_framebuffer(info);
@@ -1557,7 +1555,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
memcpy(mfbi, &mfb_template[i], sizeof(struct mfb_info));
mfbi->parent = machine_data;
- if (mfbi->index = 0) {
+ if (mfbi->index = PLANE0) {
const u8 *prop;
int len;
--
1.7.3.4
^ permalink raw reply related
* [PATCH 4/9] drivers/video: fsl-diu-fb: add several new video modes
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
Add the following new video modes to the Freescale DIU framebuffer driver:
640x480x60
640x480x72
640x480x75
640x480x90
640x480x100
800x480x60
800x600x60
854x480x60
1280x480x60
1280x720x60
1920x1080x60
Also add margin data to the 320x240 video mode. This mode was originally
intended only for the AOIs (overlays) used on planes two and three, but with
real margin data, it can now be used as an actual video mode.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 200 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 167 insertions(+), 33 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 555bae0..00ad1f4 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -77,11 +77,12 @@ struct diu_pool {
/*
* List of supported video modes
*
- * The first entry is the default video mode
+ * The first entry is the default video mode. The remain entries are in
+ * order if increasing resolution and frequency. The 320x240-60 mode is
+ * the initial AOI for the second and third planes.
*/
static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
{
- .name = "1024x768-60",
.refresh = 60,
.xres = 1024,
.yres = 768,
@@ -96,7 +97,132 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1024x768-70",
+ .refresh = 60,
+ .xres = 320,
+ .yres = 240,
+ .pixclock = 79440,
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 16,
+ .lower_margin = 5,
+ .hsync_len = 48,
+ .vsync_len = 1,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 39722,
+ .left_margin = 48,
+ .right_margin = 16,
+ .upper_margin = 33,
+ .lower_margin = 10,
+ .hsync_len = 96,
+ .vsync_len = 2,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 72,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 32052,
+ .left_margin = 128,
+ .right_margin = 24,
+ .upper_margin = 28,
+ .lower_margin = 9,
+ .hsync_len = 40,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 75,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 31747,
+ .left_margin = 120,
+ .right_margin = 16,
+ .upper_margin = 16,
+ .lower_margin = 1,
+ .hsync_len = 64,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 90,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 25057,
+ .left_margin = 120,
+ .right_margin = 32,
+ .upper_margin = 14,
+ .lower_margin = 25,
+ .hsync_len = 40,
+ .vsync_len = 14,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 100,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = 22272,
+ .left_margin = 48,
+ .right_margin = 32,
+ .upper_margin = 17,
+ .lower_margin = 22,
+ .hsync_len = 128,
+ .vsync_len = 12,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 800,
+ .yres = 480,
+ .pixclock = 33805,
+ .left_margin = 96,
+ .right_margin = 24,
+ .upper_margin = 10,
+ .lower_margin = 3,
+ .hsync_len = 72,
+ .vsync_len = 7,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 800,
+ .yres = 600,
+ .pixclock = 25000,
+ .left_margin = 88,
+ .right_margin = 40,
+ .upper_margin = 23,
+ .lower_margin = 1,
+ .hsync_len = 128,
+ .vsync_len = 4,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 854,
+ .yres = 480,
+ .pixclock = 31518,
+ .left_margin = 104,
+ .right_margin = 16,
+ .upper_margin = 13,
+ .lower_margin = 1,
+ .hsync_len = 88,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
.refresh = 70,
.xres = 1024,
.yres = 768,
@@ -111,7 +237,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1024x768-75",
.refresh = 75,
.xres = 1024,
.yres = 768,
@@ -126,7 +251,34 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-60",
+ .refresh = 60,
+ .xres = 1280,
+ .yres = 480,
+ .pixclock = 18939,
+ .left_margin = 353,
+ .right_margin = 47,
+ .upper_margin = 39,
+ .lower_margin = 4,
+ .hsync_len = 8,
+ .vsync_len = 2,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
+ .refresh = 60,
+ .xres = 1280,
+ .yres = 720,
+ .pixclock = 13426,
+ .left_margin = 192,
+ .right_margin = 64,
+ .upper_margin = 22,
+ .lower_margin = 1,
+ .hsync_len = 136,
+ .vsync_len = 3,
+ .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED
+ },
+ {
.refresh = 60,
.xres = 1280,
.yres = 1024,
@@ -141,7 +293,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-70",
.refresh = 70,
.xres = 1280,
.yres = 1024,
@@ -156,7 +307,6 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "1280x1024-75",
.refresh = 75,
.xres = 1280,
.yres = 1024,
@@ -171,38 +321,22 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
.vmode = FB_VMODE_NONINTERLACED
},
{
- .name = "320x240", /* for AOI only */
.refresh = 60,
- .xres = 320,
- .yres = 240,
- .pixclock = 15385,
- .left_margin = 0,
- .right_margin = 0,
- .upper_margin = 0,
- .lower_margin = 0,
- .hsync_len = 0,
- .vsync_len = 0,
- .sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- .vmode = FB_VMODE_NONINTERLACED
- },
- {
- .name = "1280x480-60",
- .refresh = 60,
- .xres = 1280,
- .yres = 480,
- .pixclock = 18939,
- .left_margin = 353,
- .right_margin = 47,
- .upper_margin = 39,
- .lower_margin = 4,
- .hsync_len = 8,
- .vsync_len = 2,
+ .xres = 1920,
+ .yres = 1080,
+ .pixclock = 5787,
+ .left_margin = 328,
+ .right_margin = 120,
+ .upper_margin = 34,
+ .lower_margin = 1,
+ .hsync_len = 208,
+ .vsync_len = 3,
.sync = FB_SYNC_COMP_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.vmode = FB_VMODE_NONINTERLACED
},
};
-static char *fb_mode = "1024x768-32@60";
+static char *fb_mode;
static unsigned long default_bpp = 32;
static enum fsl_diu_monitor_port monitor_port;
static char *monitor_string;
--
1.7.3.4
^ permalink raw reply related
* [PATCH 3/9] drivers/video: fsl-diu-fb: remove broken screen blanking support
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
The function which is supposed to provide screen blanking support doesn't
actually do anything, so the framebuffer layer thinks the screen has
been blanked when it really isn't. Remove the code completely for now.
A side-effect of this change is that the framebuffer console blanking now
works correctly. Presumably this is because the console now receives -EINVAL
instead of '0' when it asks the driver to blank the screen, so the console
does it manually now.
A signficant refactoring of the driver is planned, and proper hardware
blanking support will added afterwards.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 38 --------------------------------------
1 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 253e93f..555bae0 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -231,7 +231,6 @@ struct mfb_info {
int type;
char *id;
int registered;
- int blank;
unsigned long pseudo_palette[16];
struct diu_ad *ad;
int cursor_reset;
@@ -960,37 +959,6 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
return 0;
}
-/*
- * Blank the screen if blank_mode != 0, else unblank. Return 0 if blanking
- * succeeded, != 0 if un-/blanking failed.
- * blank_mode = 2: suspend vsync
- * blank_mode = 3: suspend hsync
- * blank_mode = 4: powerdown
- */
-static int fsl_diu_blank(int blank_mode, struct fb_info *info)
-{
- struct mfb_info *mfbi = info->par;
-
- mfbi->blank = blank_mode;
-
- switch (blank_mode) {
- case FB_BLANK_VSYNC_SUSPEND:
- case FB_BLANK_HSYNC_SUSPEND:
- /* FIXME: fixes to enable_panel and enable lcdc needed */
- case FB_BLANK_NORMAL:
- /* fsl_diu_disable_panel(info);*/
- break;
- case FB_BLANK_POWERDOWN:
- /* disable_lcdc(info); */
- break;
- case FB_BLANK_UNBLANK:
- /* fsl_diu_enable_panel(info);*/
- break;
- }
-
- return 0;
-}
-
static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{
@@ -1129,7 +1097,6 @@ static struct fb_ops fsl_diu_ops = {
.fb_check_var = fsl_diu_check_var,
.fb_set_par = fsl_diu_set_par,
.fb_setcolreg = fsl_diu_setcolreg,
- .fb_blank = fsl_diu_blank,
.fb_pan_display = fsl_diu_pan_display,
.fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea,
@@ -1224,11 +1191,6 @@ static int __devinit install_fb(struct fb_info *info)
fb_videomode_to_var(&info->var, modedb);
}
- if (mfbi->type = MFB_TYPE_OFF)
- mfbi->blank = FB_BLANK_NORMAL;
- else
- mfbi->blank = FB_BLANK_UNBLANK;
-
if (fsl_diu_check_var(&info->var, info)) {
dev_err(info->dev, "fsl_diu_check_var failed\n");
unmap_video_memory(info);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 2/9] drivers/video: fsl-diu-fb: move some definitions out of the header file
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
Move several macros and structures from the Freescale DIU driver's header
file into the source file, because they're only used by that file. Also
delete a few unused macros.
The diu and diu_ad structures cannot be moved because they're being used
by the MPC5121 platform file. A future patch eliminate the need for
the platform file to access these structs, so they'll be moved also.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 39 ++++++++++++++++++++++++++++++++++++
include/linux/fsl-diu-fb.h | 47 --------------------------------------------
2 files changed, 39 insertions(+), 47 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index e5905b7..253e93f 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -30,11 +30,50 @@
#include <linux/clk.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
+#include <linux/spinlock.h>
#include <sysdev/fsl_soc.h>
#include <linux/fsl-diu-fb.h>
#include "edid.h"
+#define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
+ /* 1 for plane 0, 2 for plane 1&2 each */
+
+/* HW cursor parameters */
+#define MAX_CURS 32
+
+/* INT_STATUS/INT_MASK field descriptions */
+#define INT_VSYNC 0x01 /* Vsync interrupt */
+#define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
+#define INT_UNDRUN 0x04 /* Under run exception interrupt */
+#define INT_PARERR 0x08 /* Display parameters error interrupt */
+#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
+
+/* Panels'operation modes */
+#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
+#define MFB_TYPE_OFF 1 /* Panel off */
+#define MFB_TYPE_WB 2 /* Panel written back to memory */
+#define MFB_TYPE_TEST 3 /* Panel generate color bar */
+
+struct diu_hw {
+ struct diu __iomem *diu_reg;
+ spinlock_t reg_lock;
+ unsigned int mode; /* DIU operation mode */
+};
+
+struct diu_addr {
+ void *vaddr; /* Virtual address */
+ dma_addr_t paddr; /* Physical address */
+ __u32 offset;
+};
+
+struct diu_pool {
+ struct diu_addr ad;
+ struct diu_addr gamma;
+ struct diu_addr pallete;
+ struct diu_addr cursor;
+};
+
/*
* List of supported video modes
*
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 5efb407..51457ec 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -47,7 +47,6 @@ struct aoi_display_offset {
#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
#ifdef __KERNEL__
-#include <linux/spinlock.h>
/*
* These are the fields of area descriptor(in DDR memory) for every plane
@@ -145,39 +144,6 @@ struct diu {
__be32 plut;
} __attribute__ ((packed));
-struct diu_hw {
- struct diu *diu_reg;
- spinlock_t reg_lock;
-
- __u32 mode; /* DIU operation mode */
-};
-
-struct diu_addr {
- void *vaddr; /* Virtual address */
- dma_addr_t paddr; /* Physical address */
- __u32 offset;
-};
-
-struct diu_pool {
- struct diu_addr ad;
- struct diu_addr gamma;
- struct diu_addr pallete;
- struct diu_addr cursor;
-};
-
-#define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */
-#define INT_LCDC 64 /* DIU interrupt number */
-
-#define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
- /* 1 for plane 0, 2 for plane 1&2 each */
-
-/* Minimum X and Y resolutions */
-#define MIN_XRES 64
-#define MIN_YRES 64
-
-/* HW cursor parameters */
-#define MAX_CURS 32
-
/* Modes of operation of DIU */
#define MFB_MODE0 0 /* DIU off */
#define MFB_MODE1 1 /* All three planes output to display */
@@ -185,18 +151,5 @@ struct diu_pool {
#define MFB_MODE3 3 /* All three planes written back to memory */
#define MFB_MODE4 4 /* Color bar generation */
-/* INT_STATUS/INT_MASK field descriptions */
-#define INT_VSYNC 0x01 /* Vsync interrupt */
-#define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
-#define INT_UNDRUN 0x04 /* Under run exception interrupt */
-#define INT_PARERR 0x08 /* Display parameters error interrupt */
-#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
-
-/* Panels'operation modes */
-#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
-#define MFB_TYPE_OFF 1 /* Panel off */
-#define MFB_TYPE_WB 2 /* Panel written back to memory */
-#define MFB_TYPE_TEST 3 /* Panel generate color bar */
-
#endif /* __KERNEL__ */
#endif /* __FSL_DIU_FB_H__ */
--
1.7.3.4
^ permalink raw reply related
* [PATCH 1/9] drivers/video: fsl-diu-fb: fix some ioctls
From: Timur Tabi @ 2011-09-28 21:19 UTC (permalink / raw)
To: linux-fbdev
Use the _IOx macros to define the ioctl commands, instead of hard-coded
numbers. Unfortunately, the original definitions of MFB_SET_PIXFMT and
MFB_GET_PIXFMT used the wrong value for the size, so this will break
binary compatibility with older applications.
Also remove the FBIOGET_GWINFO and FBIOPUT_GWINFO ioctls. FBIOPUT_GWINFO
was never implemented, and FBIOGET_GWINFO was never used by any
application.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/video/fsl-diu-fb.c | 8 --------
include/linux/fsl-diu-fb.h | 20 ++++++++------------
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index 5137fbb..e5905b7 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1030,14 +1030,6 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
ad->ckmin_b = ck.blue_min;
}
break;
- case FBIOGET_GWINFO:
- if (mfbi->type = MFB_TYPE_OFF)
- return -ENODEV;
- /* get graphic window information */
- if (copy_to_user(buf, ad, sizeof(*ad)))
- return -EFAULT;
- break;
-
default:
dev_err(info->dev, "unknown ioctl command (0x%08X)\n", cmd);
return -ENOIOCTLCMD;
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index df23f59..5efb407 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -33,22 +33,18 @@ struct mfb_chroma_key {
};
struct aoi_display_offset {
- int x_aoi_d;
- int y_aoi_d;
+ __s32 x_aoi_d;
+ __s32 y_aoi_d;
};
#define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
#define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
-
-#define MFB_SET_ALPHA 0x80014d00
-#define MFB_GET_ALPHA 0x40014d00
-#define MFB_SET_AOID 0x80084d04
-#define MFB_GET_AOID 0x40084d04
-#define MFB_SET_PIXFMT 0x80014d08
-#define MFB_GET_PIXFMT 0x40014d08
-
-#define FBIOGET_GWINFO 0x46E0
-#define FBIOPUT_GWINFO 0x46E1
+#define MFB_SET_ALPHA _IOW('M', 0, __u8)
+#define MFB_GET_ALPHA _IOR('M', 0, __u8)
+#define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
+#define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
+#define MFB_SET_PIXFMT _IOW('M', 8, __u32)
+#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
#ifdef __KERNEL__
#include <linux/spinlock.h>
--
1.7.3.4
^ permalink raw reply related
* Kvóta varovné
From: WEB ADMIN @ 2011-09-28 11:30 UTC (permalink / raw)
To: linux-fbdev
Vaše poštovní schránka storage byl překročen limit, dokud se
znovu potvrdili svou poštovní schránku, kterou nelze odesílat nebo
přijímat e-mail.To znovu potvrdili svou poštovní schránku, prosím
CLICK
ZDE <http://is.gd/IemtD7>
díky
správce systému
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox