Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
From: Wang YanQing @ 2014-03-05 15:54 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: plagnioj, linux-fbdev, linux-kernel, fengguang.wu

Because uvesafb_par is allocated as part of fb_info in uvesafb_probe,
so we don't need to do NULL check for both fb_info and uvesafb_par in
uvesafb_remove.

[ This patch also fix a warning report by fengguang.wu@intel.com
  "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
   warn: variable dereferenced before check 'par'" ]

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 1f38445..18352b2 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev)
 		fb_destroy_modedb(info->monspecs.modedb);
 		fb_dealloc_cmap(&info->cmap);
 
-		if (par) {
-			kfree(par->vbe_modes);
-			kfree(par->vbe_state_orig);
-			kfree(par->vbe_state_saved);
-		}
+		kfree(par->vbe_modes);
+		kfree(par->vbe_state_orig);
+		kfree(par->vbe_state_saved);
 
 		framebuffer_release(info);
 	}
-- 
1.8.3.4.8.g69490f3.dirty

^ permalink raw reply related

* [PATCH] video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info
From: Wang YanQing @ 2014-03-05 15:56 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel

Because uvesafb_vbe_init will fail when get zero avaiable modes,
and we have checked the return value of uvesafb_vbe_init_mode,
so it is impossible to pass NULL as mode into uvesafb_init_info.

[ This patch fix warning report by fengguang.wu@intel.com
  "drivers/video/fbdev/uvesafb.c:1509 uvesafb_init_info()
   error: we previously assumed 'mode' could be null" ]

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 18352b2..509d452 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1474,12 +1474,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
 	 *                 used video mode, i.e. the minimum amount of
 	 *                 memory we need.
 	 */
-	if (mode != NULL) {
-		size_vmode = info->var.yres * mode->bytes_per_scan_line;
-	} else {
-		size_vmode = info->var.yres * info->var.xres *
-			     ((info->var.bits_per_pixel + 7) >> 3);
-	}
+	size_vmode = info->var.yres * mode->bytes_per_scan_line;
 
 	/*
 	 *   size_total -- all video memory we have. Used for mtrr
-- 
1.8.3.4.8.g69490f3.dirty

^ permalink raw reply related

* [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Daniel Mack @ 2014-03-05 16:12 UTC (permalink / raw)
  To: linux-fbdev

Here are some cleanups for the pxa3xx-gcu driver. Patch 3/4 is actually
a real bugfix that is needed since the misc code doesn't set
file->private_data for us implicitly anymore.

The rest are just straight-forward cleanups.

Thanks,
Daniel


Daniel Mack (4):
  video: pxa3xx-gcu: rename some symbols
  video: pxa3xx-gcu: pass around struct device *
  video: pxa3xx-gcu: provide an empty .open call
  video: pxa3xx-gcu: switch to devres functions

 drivers/video/pxa3xx-gcu.c | 191 +++++++++++++++++++--------------------------
 1 file changed, 81 insertions(+), 110 deletions(-)

-- 
1.8.5.3


^ permalink raw reply

* [PATCH 1/4] video: pxa3xx-gcu: rename some symbols
From: Daniel Mack @ 2014-03-05 16:12 UTC (permalink / raw)
  To: linux-fbdev

Prefix some functions with more specific names. While at it, kill some
stray newlines and other coding style related minor things.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/video/pxa3xx-gcu.c | 48 ++++++++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 27 deletions(-)

diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index ad382b3..9cd48ab 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -107,7 +107,6 @@ struct pxa3xx_gcu_priv {
 	struct timeval 		  base_time;
 
 	struct pxa3xx_gcu_batch *free;
-
 	struct pxa3xx_gcu_batch *ready;
 	struct pxa3xx_gcu_batch *ready_last;
 	struct pxa3xx_gcu_batch *running;
@@ -368,27 +367,26 @@ pxa3xx_gcu_wait_free(struct pxa3xx_gcu_priv *priv)
 
 /* Misc device layer */
 
-static inline struct pxa3xx_gcu_priv *file_dev(struct file *file)
+static inline struct pxa3xx_gcu_priv *to_pxa3xx_gcu_priv(struct file *file)
 {
 	struct miscdevice *dev = file->private_data;
 	return container_of(dev, struct pxa3xx_gcu_priv, misc_dev);
 }
 
 static ssize_t
-pxa3xx_gcu_misc_write(struct file *file, const char *buff,
-		      size_t count, loff_t *offp)
+pxa3xx_gcu_write(struct file *file, const char *buff,
+		 size_t count, loff_t *offp)
 {
 	int ret;
 	unsigned long flags;
 	struct pxa3xx_gcu_batch	*buffer;
-	struct pxa3xx_gcu_priv *priv = file_dev(file);
+	struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
 
 	int words = count / 4;
 
 	/* Does not need to be atomic. There's a lock in user space,
 	 * but anyhow, this is just for statistics. */
 	priv->shared->num_writes++;
-
 	priv->shared->num_words += words;
 
 	/* Last word reserved for batch buffer end command */
@@ -406,10 +404,8 @@ pxa3xx_gcu_misc_write(struct file *file, const char *buff,
 	 * Get buffer from free list
 	 */
 	spin_lock_irqsave(&priv->spinlock, flags);
-
 	buffer = priv->free;
 	priv->free = buffer->next;
-
 	spin_unlock_irqrestore(&priv->spinlock, flags);
 
 
@@ -454,10 +450,10 @@ pxa3xx_gcu_misc_write(struct file *file, const char *buff,
 
 
 static long
-pxa3xx_gcu_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+pxa3xx_gcu_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	unsigned long flags;
-	struct pxa3xx_gcu_priv *priv = file_dev(file);
+	struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
 
 	switch (cmd) {
 	case PXA3XX_GCU_IOCTL_RESET:
@@ -474,10 +470,10 @@ pxa3xx_gcu_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 }
 
 static int
-pxa3xx_gcu_misc_mmap(struct file *file, struct vm_area_struct *vma)
+pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma)
 {
 	unsigned int size = vma->vm_end - vma->vm_start;
-	struct pxa3xx_gcu_priv *priv = file_dev(file);
+	struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
 
 	switch (vma->vm_pgoff) {
 	case 0:
@@ -532,8 +528,8 @@ static inline void pxa3xx_gcu_init_debug_timer(void) {}
 #endif
 
 static int
-add_buffer(struct platform_device *dev,
-	   struct pxa3xx_gcu_priv *priv)
+pxa3xx_gcu_add_buffer(struct platform_device *dev,
+		      struct pxa3xx_gcu_priv *priv)
 {
 	struct pxa3xx_gcu_batch *buffer;
 
@@ -549,15 +545,14 @@ add_buffer(struct platform_device *dev,
 	}
 
 	buffer->next = priv->free;
-
 	priv->free = buffer;
 
 	return 0;
 }
 
 static void
-free_buffers(struct platform_device *dev,
-	     struct pxa3xx_gcu_priv *priv)
+pxa3xx_gcu_free_buffers(struct platform_device *dev,
+			struct pxa3xx_gcu_priv *priv)
 {
 	struct pxa3xx_gcu_batch *next, *buffer = priv->free;
 
@@ -568,18 +563,17 @@ free_buffers(struct platform_device *dev,
 				  buffer->ptr, buffer->phys);
 
 		kfree(buffer);
-
 		buffer = next;
 	}
 
 	priv->free = NULL;
 }
 
-static const struct file_operations misc_fops = {
-	.owner	= THIS_MODULE,
-	.write	= pxa3xx_gcu_misc_write,
-	.unlocked_ioctl = pxa3xx_gcu_misc_ioctl,
-	.mmap	= pxa3xx_gcu_misc_mmap
+static const struct file_operations pxa3xx_gcu_miscdev_fops = {
+	.owner =		THIS_MODULE,
+	.write =		pxa3xx_gcu_write,
+	.unlocked_ioctl =	pxa3xx_gcu_ioctl,
+	.mmap =			pxa3xx_gcu_mmap,
 };
 
 static int pxa3xx_gcu_probe(struct platform_device *dev)
@@ -593,7 +587,7 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
 		return -ENOMEM;
 
 	for (i = 0; i < 8; i++) {
-		ret = add_buffer(dev, priv);
+		ret = pxa3xx_gcu_add_buffer(dev, priv);
 		if (ret) {
 			dev_err(&dev->dev, "failed to allocate DMA memory\n");
 			goto err_free_priv;
@@ -611,7 +605,7 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
 
 	priv->misc_dev.minor	= MISCDEV_MINOR,
 	priv->misc_dev.name	= DRV_NAME,
-	priv->misc_dev.fops	= &misc_fops,
+	priv->misc_dev.fops	= &pxa3xx_gcu_miscdev_fops;
 
 	/* register misc device */
 	ret = misc_register(&priv->misc_dev);
@@ -710,7 +704,7 @@ err_misc_deregister:
 	misc_deregister(&priv->misc_dev);
 
 err_free_priv:
-	free_buffers(dev, priv);
+	pxa3xx_gcu_free_buffers(dev, priv);
 	kfree(priv);
 	return ret;
 }
@@ -728,7 +722,7 @@ static int pxa3xx_gcu_remove(struct platform_device *dev)
 	iounmap(priv->mmio_base);
 	release_mem_region(r->start, resource_size(r));
 	clk_disable(priv->clk);
-	free_buffers(dev, priv);
+	pxa3xx_gcu_free_buffers(dev, priv);
 	kfree(priv);
 
 	return 0;
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH 2/4] video: pxa3xx-gcu: pass around struct device *
From: Daniel Mack @ 2014-03-05 16:12 UTC (permalink / raw)
  To: linux-fbdev

Instead of passing around struct platform_device, use struct device.
That saves one level of dereference. Also, call platform devices pdev,
and provide a shortcut for &pdev->dev.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/video/pxa3xx-gcu.c | 56 ++++++++++++++++++++++++----------------------
 1 file changed, 29 insertions(+), 27 deletions(-)

diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index 9cd48ab..f9961ba 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -528,7 +528,7 @@ static inline void pxa3xx_gcu_init_debug_timer(void) {}
 #endif
 
 static int
-pxa3xx_gcu_add_buffer(struct platform_device *dev,
+pxa3xx_gcu_add_buffer(struct device *dev,
 		      struct pxa3xx_gcu_priv *priv)
 {
 	struct pxa3xx_gcu_batch *buffer;
@@ -537,7 +537,7 @@ pxa3xx_gcu_add_buffer(struct platform_device *dev,
 	if (!buffer)
 		return -ENOMEM;
 
-	buffer->ptr = dma_alloc_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4,
+	buffer->ptr = dma_alloc_coherent(dev, PXA3XX_GCU_BATCH_WORDS * 4,
 					 &buffer->phys, GFP_KERNEL);
 	if (!buffer->ptr) {
 		kfree(buffer);
@@ -551,7 +551,7 @@ pxa3xx_gcu_add_buffer(struct platform_device *dev,
 }
 
 static void
-pxa3xx_gcu_free_buffers(struct platform_device *dev,
+pxa3xx_gcu_free_buffers(struct device *dev,
 			struct pxa3xx_gcu_priv *priv)
 {
 	struct pxa3xx_gcu_batch *next, *buffer = priv->free;
@@ -559,7 +559,7 @@ pxa3xx_gcu_free_buffers(struct platform_device *dev,
 	while (buffer) {
 		next = buffer->next;
 
-		dma_free_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4,
+		dma_free_coherent(dev, PXA3XX_GCU_BATCH_WORDS * 4,
 				  buffer->ptr, buffer->phys);
 
 		kfree(buffer);
@@ -576,11 +576,12 @@ static const struct file_operations pxa3xx_gcu_miscdev_fops = {
 	.mmap =			pxa3xx_gcu_mmap,
 };
 
-static int pxa3xx_gcu_probe(struct platform_device *dev)
+static int pxa3xx_gcu_probe(struct platform_device *pdev)
 {
 	int i, ret, irq;
 	struct resource *r;
 	struct pxa3xx_gcu_priv *priv;
+	struct device *dev = &pdev->dev;
 
 	priv = kzalloc(sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL);
 	if (!priv)
@@ -589,7 +590,7 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
 	for (i = 0; i < 8; i++) {
 		ret = pxa3xx_gcu_add_buffer(dev, priv);
 		if (ret) {
-			dev_err(&dev->dev, "failed to allocate DMA memory\n");
+			dev_err(dev, "failed to allocate DMA memory\n");
 			goto err_free_priv;
 		}
 	}
@@ -610,60 +611,60 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
 	/* register misc device */
 	ret = misc_register(&priv->misc_dev);
 	if (ret < 0) {
-		dev_err(&dev->dev, "misc_register() for minor %d failed\n",
+		dev_err(dev, "misc_register() for minor %d failed\n",
 			MISCDEV_MINOR);
 		goto err_free_priv;
 	}
 
 	/* handle IO resources */
-	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (r = NULL) {
-		dev_err(&dev->dev, "no I/O memory resource defined\n");
+		dev_err(dev, "no I/O memory resource defined\n");
 		ret = -ENODEV;
 		goto err_misc_deregister;
 	}
 
-	if (!request_mem_region(r->start, resource_size(r), dev->name)) {
-		dev_err(&dev->dev, "failed to request I/O memory\n");
+	if (!request_mem_region(r->start, resource_size(r), pdev->name)) {
+		dev_err(dev, "failed to request I/O memory\n");
 		ret = -EBUSY;
 		goto err_misc_deregister;
 	}
 
 	priv->mmio_base = ioremap_nocache(r->start, resource_size(r));
 	if (!priv->mmio_base) {
-		dev_err(&dev->dev, "failed to map I/O memory\n");
+		dev_err(dev, "failed to map I/O memory\n");
 		ret = -EBUSY;
 		goto err_free_mem_region;
 	}
 
 	/* allocate dma memory */
-	priv->shared = dma_alloc_coherent(&dev->dev, SHARED_SIZE,
+	priv->shared = dma_alloc_coherent(dev, SHARED_SIZE,
 					  &priv->shared_phys, GFP_KERNEL);
 
 	if (!priv->shared) {
-		dev_err(&dev->dev, "failed to allocate DMA memory\n");
+		dev_err(dev, "failed to allocate DMA memory\n");
 		ret = -ENOMEM;
 		goto err_free_io;
 	}
 
 	/* enable the clock */
-	priv->clk = clk_get(&dev->dev, NULL);
+	priv->clk = clk_get(dev, NULL);
 	if (IS_ERR(priv->clk)) {
-		dev_err(&dev->dev, "failed to get clock\n");
+		dev_err(dev, "failed to get clock\n");
 		ret = -ENODEV;
 		goto err_free_dma;
 	}
 
 	ret = clk_enable(priv->clk);
 	if (ret < 0) {
-		dev_err(&dev->dev, "failed to enable clock\n");
+		dev_err(dev, "failed to enable clock\n");
 		goto err_put_clk;
 	}
 
 	/* request the IRQ */
-	irq = platform_get_irq(dev, 0);
+	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
-		dev_err(&dev->dev, "no IRQ defined\n");
+		dev_err(dev, "no IRQ defined\n");
 		ret = -ENODEV;
 		goto err_put_clk;
 	}
@@ -671,17 +672,17 @@ static int pxa3xx_gcu_probe(struct platform_device *dev)
 	ret = request_irq(irq, pxa3xx_gcu_handle_irq,
 			  0, DRV_NAME, priv);
 	if (ret) {
-		dev_err(&dev->dev, "request_irq failed\n");
+		dev_err(dev, "request_irq failed\n");
 		ret = -EBUSY;
 		goto err_put_clk;
 	}
 
-	platform_set_drvdata(dev, priv);
+	platform_set_drvdata(pdev, priv);
 	priv->resource_mem = r;
 	pxa3xx_gcu_reset(priv);
 	pxa3xx_gcu_init_debug_timer();
 
-	dev_info(&dev->dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n",
+	dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n",
 			(void *) r->start, (void *) priv->shared_phys,
 			SHARED_SIZE, irq);
 	return 0;
@@ -691,7 +692,7 @@ err_put_clk:
 	clk_put(priv->clk);
 
 err_free_dma:
-	dma_free_coherent(&dev->dev, SHARED_SIZE,
+	dma_free_coherent(dev, SHARED_SIZE,
 			priv->shared, priv->shared_phys);
 
 err_free_io:
@@ -709,16 +710,17 @@ err_free_priv:
 	return ret;
 }
 
-static int pxa3xx_gcu_remove(struct platform_device *dev)
+static int pxa3xx_gcu_remove(struct platform_device *pdev)
 {
-	struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev);
+	struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev);
 	struct resource *r = priv->resource_mem;
+	struct device *dev = &pdev->dev;
 
 	pxa3xx_gcu_wait_idle(priv);
 
 	misc_deregister(&priv->misc_dev);
-	dma_free_coherent(&dev->dev, SHARED_SIZE,
-			priv->shared, priv->shared_phys);
+	dma_free_coherent(dev, SHARED_SIZE,
+			  priv->shared, priv->shared_phys);
 	iounmap(priv->mmio_base);
 	release_mem_region(r->start, resource_size(r));
 	clk_disable(priv->clk);
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH 3/4] video: pxa3xx-gcu: provide an empty .open call
From: Daniel Mack @ 2014-03-05 16:12 UTC (permalink / raw)
  To: linux-fbdev

This is necessary in order to make the core set file->private_data to
miscdev in use. We need that information later to dereference the
container of the device, so we can get access to our private struct from
other callbacks.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/video/pxa3xx-gcu.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index f9961ba..73c29ec 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -373,6 +373,15 @@ static inline struct pxa3xx_gcu_priv *to_pxa3xx_gcu_priv(struct file *file)
 	return container_of(dev, struct pxa3xx_gcu_priv, misc_dev);
 }
 
+/*
+ * provide an empty .open callback, so the core sets file->private_data
+ * for us.
+ */
+static int pxa3xx_gcu_open(struct inode *inode, struct file *file)
+{
+	return 0;
+}
+
 static ssize_t
 pxa3xx_gcu_write(struct file *file, const char *buff,
 		 size_t count, loff_t *offp)
@@ -571,6 +580,7 @@ pxa3xx_gcu_free_buffers(struct device *dev,
 
 static const struct file_operations pxa3xx_gcu_miscdev_fops = {
 	.owner =		THIS_MODULE,
+	.open =			pxa3xx_gcu_open,
 	.write =		pxa3xx_gcu_write,
 	.unlocked_ioctl =	pxa3xx_gcu_ioctl,
 	.mmap =			pxa3xx_gcu_mmap,
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH 4/4] video: pxa3xx-gcu: switch to devres functions
From: Daniel Mack @ 2014-03-05 16:12 UTC (permalink / raw)
  To: linux-fbdev

Switch to devres allocators to clean up the error unwinding paths.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/video/pxa3xx-gcu.c | 113 ++++++++++++++++-----------------------------
 1 file changed, 39 insertions(+), 74 deletions(-)

diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c
index 73c29ec..417f9a2 100644
--- a/drivers/video/pxa3xx-gcu.c
+++ b/drivers/video/pxa3xx-gcu.c
@@ -593,18 +593,10 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 	struct pxa3xx_gcu_priv *priv;
 	struct device *dev = &pdev->dev;
 
-	priv = kzalloc(sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL);
+	priv = devm_kzalloc(dev, sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	for (i = 0; i < 8; i++) {
-		ret = pxa3xx_gcu_add_buffer(dev, priv);
-		if (ret) {
-			dev_err(dev, "failed to allocate DMA memory\n");
-			goto err_free_priv;
-		}
-	}
-
 	init_waitqueue_head(&priv->wait_idle);
 	init_waitqueue_head(&priv->wait_free);
 	spin_lock_init(&priv->spinlock);
@@ -618,73 +610,63 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 	priv->misc_dev.name	= DRV_NAME,
 	priv->misc_dev.fops	= &pxa3xx_gcu_miscdev_fops;
 
-	/* register misc device */
-	ret = misc_register(&priv->misc_dev);
-	if (ret < 0) {
-		dev_err(dev, "misc_register() for minor %d failed\n",
-			MISCDEV_MINOR);
-		goto err_free_priv;
-	}
-
 	/* handle IO resources */
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (r = NULL) {
-		dev_err(dev, "no I/O memory resource defined\n");
-		ret = -ENODEV;
-		goto err_misc_deregister;
+	priv->mmio_base = devm_request_and_ioremap(dev, r);
+	if (IS_ERR(priv->mmio_base)) {
+		dev_err(dev, "failed to map I/O memory\n");
+		return PTR_ERR(priv->mmio_base);
 	}
 
-	if (!request_mem_region(r->start, resource_size(r), pdev->name)) {
-		dev_err(dev, "failed to request I/O memory\n");
-		ret = -EBUSY;
-		goto err_misc_deregister;
+	/* enable the clock */
+	priv->clk = devm_clk_get(dev, NULL);
+	if (IS_ERR(priv->clk)) {
+		dev_err(dev, "failed to get clock\n");
+		return PTR_ERR(priv->clk);
 	}
 
-	priv->mmio_base = ioremap_nocache(r->start, resource_size(r));
-	if (!priv->mmio_base) {
-		dev_err(dev, "failed to map I/O memory\n");
-		ret = -EBUSY;
-		goto err_free_mem_region;
+	/* request the IRQ */
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		dev_err(dev, "no IRQ defined\n");
+		return -ENODEV;
+	}
+
+	ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
+			       0, DRV_NAME, priv);
+	if (ret < 0) {
+		dev_err(dev, "request_irq failed\n");
+		return ret;
 	}
 
 	/* allocate dma memory */
 	priv->shared = dma_alloc_coherent(dev, SHARED_SIZE,
 					  &priv->shared_phys, GFP_KERNEL);
-
 	if (!priv->shared) {
 		dev_err(dev, "failed to allocate DMA memory\n");
-		ret = -ENOMEM;
-		goto err_free_io;
+		return -ENOMEM;
 	}
 
-	/* enable the clock */
-	priv->clk = clk_get(dev, NULL);
-	if (IS_ERR(priv->clk)) {
-		dev_err(dev, "failed to get clock\n");
-		ret = -ENODEV;
+	/* register misc device */
+	ret = misc_register(&priv->misc_dev);
+	if (ret < 0) {
+		dev_err(dev, "misc_register() for minor %d failed\n",
+			MISCDEV_MINOR);
 		goto err_free_dma;
 	}
 
 	ret = clk_enable(priv->clk);
 	if (ret < 0) {
 		dev_err(dev, "failed to enable clock\n");
-		goto err_put_clk;
-	}
-
-	/* request the IRQ */
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(dev, "no IRQ defined\n");
-		ret = -ENODEV;
-		goto err_put_clk;
+		goto err_misc_deregister;
 	}
 
-	ret = request_irq(irq, pxa3xx_gcu_handle_irq,
-			  0, DRV_NAME, priv);
-	if (ret) {
-		dev_err(dev, "request_irq failed\n");
-		ret = -EBUSY;
-		goto err_put_clk;
+	for (i = 0; i < 8; i++) {
+		ret = pxa3xx_gcu_add_buffer(dev, priv);
+		if (ret) {
+			dev_err(dev, "failed to allocate DMA memory\n");
+			goto err_disable_clk;
+		}
 	}
 
 	platform_set_drvdata(pdev, priv);
@@ -697,45 +679,28 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
 			SHARED_SIZE, irq);
 	return 0;
 
-err_put_clk:
-	clk_disable(priv->clk);
-	clk_put(priv->clk);
-
 err_free_dma:
 	dma_free_coherent(dev, SHARED_SIZE,
 			priv->shared, priv->shared_phys);
 
-err_free_io:
-	iounmap(priv->mmio_base);
-
-err_free_mem_region:
-	release_mem_region(r->start, resource_size(r));
-
 err_misc_deregister:
 	misc_deregister(&priv->misc_dev);
 
-err_free_priv:
-	pxa3xx_gcu_free_buffers(dev, priv);
-	kfree(priv);
+err_disable_clk:
+	clk_disable(priv->clk);
+
 	return ret;
 }
 
 static int pxa3xx_gcu_remove(struct platform_device *pdev)
 {
 	struct pxa3xx_gcu_priv *priv = platform_get_drvdata(pdev);
-	struct resource *r = priv->resource_mem;
 	struct device *dev = &pdev->dev;
 
 	pxa3xx_gcu_wait_idle(priv);
-
 	misc_deregister(&priv->misc_dev);
-	dma_free_coherent(dev, SHARED_SIZE,
-			  priv->shared, priv->shared_phys);
-	iounmap(priv->mmio_base);
-	release_mem_region(r->start, resource_size(r));
-	clk_disable(priv->clk);
+	dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys);
 	pxa3xx_gcu_free_buffers(dev, priv);
-	kfree(priv);
 
 	return 0;
 }
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH] video: fbdev: uvesafb: use CONFIG_X86_PAE surround _PAGE_NX check code
From: Wang YanQing @ 2014-03-05 16:16 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel

Because _PAGE_NX check will always false when we don't define
CONFIG_X86_PAE for CONFIG_X86_32, so use CONFIG_X86_PAE surround
the check code.

Although I believe "smart" compile will optimize out and generate
the same code, but use CONFIG_X86_PAE surround check code will
clear it and prohibit warning from static source code analyze tool.

[ This patch fix warning report by fengguang.wu@intel.com
  "drivers/video/fbdev/uvesafb.c:816 uvesafb_vbe_init()
   warn: bitwise AND condition is false here" ]

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..102858c 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -813,6 +813,7 @@ static int uvesafb_vbe_init(struct fb_info *info)
 	par->ypan = ypan;
 
 	if (par->pmi_setpal || par->ypan) {
+#ifdef CONFIG_X86_PAE
 		if (__supported_pte_mask & _PAGE_NX) {
 			par->pmi_setpal = par->ypan = 0;
 			printk(KERN_WARNING "uvesafb: NX protection is active, "
@@ -820,6 +821,9 @@ static int uvesafb_vbe_init(struct fb_info *info)
 		} else {
 			uvesafb_vbe_getpmi(task, par);
 		}
+#else
+		uvesafb_vbe_getpmi(task, par);
+#endif
 	}
 #else
 	/* The protected mode interface is not available on non-x86. */
-- 
1.8.3.4.8.g69490f3.dirty

^ permalink raw reply related

* [PATCH v5 1/2] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2014-03-05 16:23 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds basic DT bindings for the PL11x CLCD cells
and make their fbdev driver use them.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
Changes since v4:
- simplified the pads description property and made it optional

Changes since v3:
- changed wording and order of interrupt-names and interrupts
  properties documentation
- changed wording of arm,pl11x,framebuffer-base property
  documentation
- cleaned up binding documentation indentation

Changes since v2:
- replaced video-ram phandle with arm,pl11x,framebuffer-base
- replaced panel-* properties with arm,pl11x,panel-data-pads
- replaced max-framebuffer-size with max-memory-bandwidth
- modified clcdfb_of_init_tft_panel() to use the pads
  data and take differences between PL110 and PL110 into
  account

Changes since v1:
- minor code cleanups as suggested by Sylwester Nawrocki

 .../devicetree/bindings/video/arm,pl11x.txt        |  83 ++++++++
 drivers/video/Kconfig                              |   1 +
 drivers/video/amba-clcd.c                          | 219 +++++++++++++++++++++
 3 files changed, 303 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/arm,pl11x.txt

diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt
new file mode 100644
index 0000000..75da7b7
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt
@@ -0,0 +1,83 @@
+* ARM PrimeCell Color LCD Controller PL110/PL111
+
+See also Documentation/devicetree/bindings/arm/primecell.txt
+
+Required properties:
+
+- compatible: must be one of:
+	"arm,pl110", "arm,primecell"
+	"arm,pl111", "arm,primecell"
+
+- reg: base address and size of the control registers block
+
+- interrupt-names: either the single entry "combined" representing a
+	combined interrupt output (CLCDINTR), or the four entries
+	"mbe", "vcomp", "lnbu", "fuf" representing the individual
+	CLCDMBEINTR, CLCDVCOMPINTR, CLCDLNBUINTR, CLCDFUFINTR interrupts
+
+- interrupts: contains an interrupt specifier for each entry in
+	interrupt-names
+
+- clocks-names: should contain "clcdclk" and "apb_pclk"
+
+- clocks: contains phandle and clock specifier pairs for the entries
+	in the clock-names property. See
+	Documentation/devicetree/binding/clock/clock-bindings.txt
+
+Optional properties:
+
+- arm,pl11x,framebuffer-base: a pair of two 32-bit values, address and size,
+	defining the framebuffer that must be used; if not present, the
+	framebuffer may be located anywhere in the memory
+
+- arm,pl11x,tft-r0g0b0-pads: when connected to a TFT panel, an array of three
+	32-bit values, defining the way CLD pads are wired up; this implicitly
+	defines available color modes, for example:
+	- PL111 TFT 4:4:4 panel:
+		arm,pl11x,tft-r0g0b0-pads = <4 15 20>;
+	- PL110 TFT (1:)5:5:5 panel:
+		arm,pl11x,tft-r0g0b0-pads = <1 7 13>;
+	- PL111 TFT (1:)5:5:5 panel:
+		arm,pl11x,tft-r0g0b0-pads = <3 11 19>;
+	- PL111 TFT 5:6:5 panel:
+		arm,pl11x,tft-r0g0b0-pads = <3 10 19>;
+	- PL110 and PL111 TFT 8:8:8 panel:
+		arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
+	- PL110 and PL111 TFT 8:8:8 panel, R & B components swapped:
+		arm,pl11x,tft-r0g0b0-pads = <16 8 0>;
+
+- max-memory-bandwidth: maximum bandwidth in bytes per second that the
+	cell's memory interface can handle
+
+- display-timings: standard display timings sub-node, defining possible
+	video modes of a connected panel; for details see
+	Documentation/devicetree/bindings/video/display-timing.txt
+
+Example:
+
+	clcd@1f0000 {
+		compatible = "arm,pl111", "arm,primecell";
+		reg = <0x1f0000 0x1000>;
+		interrupt-names = "combined";
+		interrupts = <14>;
+		clock-names = "clcdclk", "apb_pclk";
+		clocks = <&v2m_oscclk1>, <&smbclk>;
+
+		arm,pl11x,framebuffer-base = <0x18000000 0x00800000>;
+		arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
+		max-memory-bandwidth = <36864000>; /* bps, 640x480@60 16bpp */
+		display-timings {
+			native-mode = <&v2m_clcd_timing0>;
+			v2m_clcd_timing0: vga {
+				clock-frequency = <25175000>;
+				hactive = <640>;
+				hback-porch = <40>;
+				hfront-porch = <24>;
+				hsync-len = <96>;
+				vactive = <480>;
+				vback-porch = <32>;
+				vfront-porch = <11>;
+				vsync-len = <2>;
+			};
+		};
+	};
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index dade5b7..c1d25c9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -317,6 +317,7 @@ config FB_ARMCLCD
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
+	select VIDEOMODE_HELPERS if OF
 	help
 	  This framebuffer device driver is for the ARM PrimeCell PL110
 	  Colour LCD controller.  ARM PrimeCells provide the building
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c
index 14d6b37..5a165dd 100644
--- a/drivers/video/amba-clcd.c
+++ b/drivers/video/amba-clcd.c
@@ -26,6 +26,11 @@
 #include <linux/amba/clcd.h>
 #include <linux/clk.h>
 #include <linux/hardirq.h>
+#include <linux/dma-mapping.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
 
 #include <asm/sizes.h>
 
@@ -543,6 +548,217 @@ static int clcdfb_register(struct clcd_fb *fb)
 	return ret;
 }
 
+#ifdef CONFIG_OF
+static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0)
+{
+	static struct {
+		unsigned int part;
+		u32 r0, g0, b0;
+		u32 caps;
+	} panels[] = {
+		{ 0x110, 1,  7, 13, CLCD_CAP_5551 },
+		{ 0x110, 0,  8, 16, CLCD_CAP_888 },
+		{ 0x111, 4, 14, 20, CLCD_CAP_444 },
+		{ 0x111, 3, 11, 19, CLCD_CAP_444 | CLCD_CAP_5551 },
+		{ 0x111, 3, 10, 19, CLCD_CAP_444 | CLCD_CAP_5551 |
+				    CLCD_CAP_565 },
+		{ 0x111, 0,  8, 16, CLCD_CAP_444 | CLCD_CAP_5551 |
+				    CLCD_CAP_565 | CLCD_CAP_888 },
+	};
+	int i;
+
+	/* Bypass pixel clock divider, data output on the falling edge */
+	fb->panel->tim2 = TIM2_BCD | TIM2_IPC;
+
+	/* TFT display, vert. comp. interrupt at the start of the back porch */
+	fb->panel->cntl |= CNTL_LCDTFT | CNTL_LCDVCOMP(1);
+
+	fb->panel->caps = 0;
+
+	/* Match the setup with known variants */
+	for (i = 0; i < ARRAY_SIZE(panels) && !fb->panel->caps; i++) {
+		if (amba_part(fb->dev) != panels[i].part)
+			continue;
+		if (g0 != panels[i].g0)
+			continue;
+		if (r0 = panels[i].r0 && b0 = panels[i].b0)
+			fb->panel->caps = panels[i].caps & CLCD_CAP_RGB;
+		if (r0 = panels[i].b0 && b0 = panels[i].r0)
+			fb->panel->caps = panels[i].caps & CLCD_CAP_BGR;
+	}
+
+	return fb->panel->caps ? 0 : -EINVAL;
+}
+
+static int clcdfb_snprintf_mode(char *buf, int size, struct fb_videomode *mode)
+{
+	return snprintf(buf, size, "%ux%u@%u", mode->xres, mode->yres,
+			mode->refresh);
+}
+
+static int clcdfb_of_init_display(struct clcd_fb *fb)
+{
+	struct device_node *node = fb->dev->dev.of_node;
+	int err, len;
+	char *mode_name;
+	u32 max_bandwidth;
+	u32 tft_r0b0g0[3];
+
+	fb->panel = devm_kzalloc(&fb->dev->dev, sizeof(*fb->panel), GFP_KERNEL);
+	if (!fb->panel)
+		return -ENOMEM;
+
+	err = of_get_fb_videomode(node, &fb->panel->mode, OF_USE_NATIVE_MODE);
+	if (err)
+		return err;
+
+	len = clcdfb_snprintf_mode(NULL, 0, &fb->panel->mode);
+	mode_name = devm_kzalloc(&fb->dev->dev, len + 1, GFP_KERNEL);
+	clcdfb_snprintf_mode(mode_name, len + 1, &fb->panel->mode);
+	fb->panel->mode.name = mode_name;
+
+	err = of_property_read_u32(node, "max-memory-bandwidth",
+			&max_bandwidth);
+	if (!err)
+		fb->panel->bpp = 8 * max_bandwidth / (fb->panel->mode.xres *
+				fb->panel->mode.yres * fb->panel->mode.refresh);
+	else
+		fb->panel->bpp = 32;
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+	fb->panel->cntl |= CNTL_BEBO;
+#endif
+	fb->panel->width = -1;
+	fb->panel->height = -1;
+
+	if (of_property_read_u32_array(node, "arm,pl11x,tft-r0g0b0-pads",
+			tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) = 0)
+		return clcdfb_of_init_tft_panel(fb, tft_r0b0g0[0],
+				 tft_r0b0g0[1],  tft_r0b0g0[2]);
+
+	return -ENOENT;
+}
+
+static int clcdfb_of_vram_setup(struct clcd_fb *fb)
+{
+	int err;
+	u32 values[2];
+	phys_addr_t phys_base;
+	size_t size;
+
+	err = clcdfb_of_init_display(fb);
+	if (err)
+		return err;
+
+	err = of_property_read_u32_array(fb->dev->dev.of_node,
+			"arm,pl11x,framebuffer-base",
+			values, ARRAY_SIZE(values));
+	if (err)
+		return err;
+
+	phys_base = values[0];
+	size = values[1];
+
+	fb->fb.screen_base = ioremap(phys_base, size);
+	if (!fb->fb.screen_base)
+		return -ENOMEM;
+
+	fb->fb.fix.smem_start = phys_base;
+	fb->fb.fix.smem_len = size;
+
+	return 0;
+}
+
+static int clcdfb_of_vram_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
+{
+	unsigned long off, user_size, kernel_size;
+
+
+	off = vma->vm_pgoff << PAGE_SHIFT;
+	user_size = vma->vm_end - vma->vm_start;
+	kernel_size = fb->fb.fix.smem_len;
+
+	if (off >= kernel_size || user_size > (kernel_size - off))
+		return -ENXIO;
+
+	return remap_pfn_range(vma, vma->vm_start,
+			__phys_to_pfn(fb->fb.fix.smem_start) + vma->vm_pgoff,
+			user_size,
+			pgprot_writecombine(vma->vm_page_prot));
+}
+
+static void clcdfb_of_vram_remove(struct clcd_fb *fb)
+{
+	iounmap(fb->fb.screen_base);
+}
+
+static int clcdfb_of_dma_setup(struct clcd_fb *fb)
+{
+	unsigned long framesize;
+	dma_addr_t dma;
+	int err;
+
+	err = clcdfb_of_init_display(fb);
+	if (err)
+		return err;
+
+	framesize = fb->panel->mode.xres * fb->panel->mode.yres *
+			fb->panel->bpp / 8;
+	fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
+			&dma, GFP_KERNEL);
+	if (!fb->fb.screen_base)
+		return -ENOMEM;
+
+	fb->fb.fix.smem_start = dma;
+	fb->fb.fix.smem_len = framesize;
+
+	return 0;
+}
+
+static int clcdfb_of_dma_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
+{
+	return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base,
+			fb->fb.fix.smem_start, fb->fb.fix.smem_len);
+}
+
+static void clcdfb_of_dma_remove(struct clcd_fb *fb)
+{
+	dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
+			fb->fb.screen_base, fb->fb.fix.smem_start);
+}
+
+static struct clcd_board *clcdfb_of_get_board(struct amba_device *dev)
+{
+	struct clcd_board *board = devm_kzalloc(&dev->dev, sizeof(*board),
+			GFP_KERNEL);
+	struct device_node *node = dev->dev.of_node;
+
+	if (!board)
+		return NULL;
+
+	board->name = of_node_full_name(node);
+	board->caps = CLCD_CAP_ALL;
+	board->check = clcdfb_check;
+	board->decode = clcdfb_decode;
+	if (of_find_property(node, "arm,pl11x,framebuffer-base", NULL)) {
+		board->setup = clcdfb_of_vram_setup;
+		board->mmap = clcdfb_of_vram_mmap;
+		board->remove = clcdfb_of_vram_remove;
+	} else {
+		board->setup = clcdfb_of_dma_setup;
+		board->mmap = clcdfb_of_dma_mmap;
+		board->remove = clcdfb_of_dma_remove;
+	}
+
+	return board;
+}
+#else
+static struct clcd_board *clcdfb_of_get_board(struct amba_dev *dev)
+{
+	return NULL;
+}
+#endif
+
 static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 {
 	struct clcd_board *board = dev_get_platdata(&dev->dev);
@@ -550,6 +766,9 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
 	int ret;
 
 	if (!board)
+		board = clcdfb_of_get_board(dev);
+
+	if (!board)
 		return -EINVAL;
 
 	ret = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH v5 2/2] ARM: vexpress: Add CLCD Device Tree properties
From: Pawel Moll @ 2014-03-05 16:23 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1394036606-17784-1-git-send-email-pawel.moll@arm.com>

... for V2M-P1 motherboard CLCD (limited to 640x480 16bpp and using
dedicated video RAM bank) and for V2P-CA9 (up to 1024x768 16bpp).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 arch/arm/boot/dts/vexpress-v2m-rs1.dtsi | 21 ++++++++++++++++++++-
 arch/arm/boot/dts/vexpress-v2m.dtsi     | 21 ++++++++++++++++++++-
 arch/arm/boot/dts/vexpress-v2p-ca9.dts  | 18 ++++++++++++++++++
 3 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
index ac870fb..c95a4cb 100644
--- a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
@@ -230,9 +230,28 @@
 			clcd@1f0000 {
 				compatible = "arm,pl111", "arm,primecell";
 				reg = <0x1f0000 0x1000>;
+				interrupt-names = "combined";
 				interrupts = <14>;
 				clocks = <&v2m_oscclk1>, <&smbclk>;
 				clock-names = "clcdclk", "apb_pclk";
+
+				arm,pl11x,framebuffer-base = <0x18000000 0x00800000>;
+				arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
+				max-memory-bandwidth = <36864000>; /* Bps, 640x480@60 16bpp */
+				display-timings {
+					native-mode = <&v2m_clcd_timing0>;
+					v2m_clcd_timing0: vga {
+						clock-frequency = <25175000>;
+						hactive = <640>;
+						hback-porch = <40>;
+						hfront-porch = <24>;
+						hsync-len = <96>;
+						vactive = <480>;
+						vback-porch = <32>;
+						vfront-porch = <11>;
+						vsync-len = <2>;
+					};
+				};
 			};
 		};
 
@@ -282,7 +301,7 @@
 				/* CLCD clock */
 				compatible = "arm,vexpress-osc";
 				arm,vexpress-sysreg,func = <1 1>;
-				freq-range = <23750000 63500000>;
+				freq-range = <23750000 65000000>;
 				#clock-cells = <0>;
 				clock-output-names = "v2m:oscclk1";
 			};
diff --git a/arch/arm/boot/dts/vexpress-v2m.dtsi b/arch/arm/boot/dts/vexpress-v2m.dtsi
index f142036..9224834 100644
--- a/arch/arm/boot/dts/vexpress-v2m.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m.dtsi
@@ -229,9 +229,28 @@
 			clcd@1f000 {
 				compatible = "arm,pl111", "arm,primecell";
 				reg = <0x1f000 0x1000>;
+				interrupt-names = "combined";
 				interrupts = <14>;
 				clocks = <&v2m_oscclk1>, <&smbclk>;
 				clock-names = "clcdclk", "apb_pclk";
+
+				arm,pl11x,framebuffer-base = <0x4c000000 0x00800000>;
+				arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
+				max-memory-bandwidth = <36864000>; /* Bps, 640x480@60 16bpp */
+				display-timings {
+					native-mode = <&v2m_clcd_timing0>;
+					v2m_clcd_timing0: vga {
+						clock-frequency = <25175000>;
+						hactive = <640>;
+						hback-porch = <40>;
+						hfront-porch = <24>;
+						hsync-len = <96>;
+						vactive = <480>;
+						vback-porch = <32>;
+						vfront-porch = <11>;
+						vsync-len = <2>;
+					};
+				};
 			};
 		};
 
@@ -281,7 +300,7 @@
 				/* CLCD clock */
 				compatible = "arm,vexpress-osc";
 				arm,vexpress-sysreg,func = <1 1>;
-				freq-range = <23750000 63500000>;
+				freq-range = <23750000 65000000>;
 				#clock-cells = <0>;
 				clock-output-names = "v2m:oscclk1";
 			};
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca9.dts b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
index 62d9b22..ed4f223 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca9.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
@@ -70,9 +70,27 @@
 	clcd@10020000 {
 		compatible = "arm,pl111", "arm,primecell";
 		reg = <0x10020000 0x1000>;
+		interrupt-names = "combined";
 		interrupts = <0 44 4>;
 		clocks = <&oscclk1>, <&oscclk2>;
 		clock-names = "clcdclk", "apb_pclk";
+
+		arm,pl11x,tft-r0g0b0-pads = <0 8 16>;
+		max-memory-bandwidth = <94371840>; /* Bps, 1024x768@60 16bpp */
+		display-timings {
+			native-mode = <&clcd_timing0>;
+			clcd_timing0: xga {
+				clock-frequency = <63500127>;
+				hactive = <1024>;
+				hback-porch = <152>;
+				hfront-porch = <48>;
+				hsync-len = <104>;
+				vactive = <768>;
+				vback-porch = <23>;
+				vfront-porch = <3>;
+				vsync-len = <4>;
+			};
+		};
 	};
 
 	memory-controller@100e0000 {
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH] video: da8xx-fb: Add support for Densitron 84-0023-001T
From: jon @ 2014-03-05 18:05 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen; +Cc: linux-fbdev, linux-kernel, Jon Ringle

From: Jon Ringle <jringle@gridpoint.com>

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
---
 drivers/video/da8xx-fb.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index e7f5937..83c43b2 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -243,6 +243,20 @@ static struct fb_videomode known_lcd_panels[] = {
 		.sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
 		.flag           = 0,
 	},
+	[3] = {
+		/* Densitron 84-0023-001T */
+		.name           = "Densitron_LCD",
+		.xres           = 320,
+		.yres           = 240,
+		.pixclock       = KHZ2PICOS(6400),
+		.left_margin    = 0,
+		.right_margin   = 0,
+		.upper_margin   = 0,
+		.lower_margin   = 0,
+		.hsync_len      = 30,
+		.vsync_len      = 3,
+		.sync           = 0,
+	},
 };
 
 static bool da8xx_fb_is_raster_enabled(void)
-- 
1.8.5.4


^ permalink raw reply related

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Haojian Zhuang @ 2014-03-06  2:09 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

On Thu, Mar 6, 2014 at 12:12 AM, Daniel Mack <zonque@gmail.com> wrote:
> Here are some cleanups for the pxa3xx-gcu driver. Patch 3/4 is actually
> a real bugfix that is needed since the misc code doesn't set
> file->private_data for us implicitly anymore.
>
> The rest are just straight-forward cleanups.
>
> Thanks,
> Daniel
>
>
> Daniel Mack (4):
>   video: pxa3xx-gcu: rename some symbols
>   video: pxa3xx-gcu: pass around struct device *
>   video: pxa3xx-gcu: provide an empty .open call
>   video: pxa3xx-gcu: switch to devres functions
>
>  drivers/video/pxa3xx-gcu.c | 191 +++++++++++++++++++--------------------------
>  1 file changed, 81 insertions(+), 110 deletions(-)
>
> --
> 1.8.5.3
>

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

^ permalink raw reply

* Re: [PATCHv3 00/41] OMAPDSS: DT support v3
From: Tomi Valkeinen @ 2014-03-06  7:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-1-git-send-email-tomi.valkeinen@ti.com>

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Hi Tony,

On 21/01/14 12:56, Tomi Valkeinen wrote:
> Hi,
> 
> Here's version 3 of the DSS DT series.

Can you have a look at the arch/arm/ parts in the series and ack if
they're ok, i.e, patches 1, 2, 32.

Then there are the .dts patches, 22-30, for which I haven't been able to
get any acks. I'm not sure who I should get acks from for those, but I
don't mind adding yours if you want to give it.

The .dts patches have had minor changes compared to the ones posted
here, according to the DT bindings review comments, but nothing much has
changed.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 3/9] Doc/DT: Add DT binding documentation for DVI Connector
From: Geert Uytterhoeven @ 2014-03-06  8:39 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: devicetree@vger.kernel.org, Linux Fbdev development list,
	Russell King - ARM Linux, DRI Development, Andrzej Hajda,
	Laurent Pinchart, linux-arm-kernel@lists.infradead.org,
	Sebastian Hesselbarth
In-Reply-To: <5316E31F.9050308@ti.com>

On Wed, Mar 5, 2014 at 9:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 28/02/14 18:23, Russell King - ARM Linux wrote:
>
>> That's rather a lot of compatible strings.  Another possibility is:
>>
>>       compatible = "dvi-connector";
>>       analog;
>>       digital;
>>       single-link;
>>       dual-link;
>
> I made the following changes compared to the posted version. I decided
> to leave the "single-link" out, as it's implied if "digital" is set.
>
>  Tomi
>
> @@ -6,11 +6,16 @@ Required properties:
>
>  Optional properties:
>  - label: a symbolic name for the connector
> -- i2c-bus: phandle to the i2c bus that is connected to DVI DDC
> +- ddc-i2c-bus: phandle to the i2c bus that is connected to DVI DDC
> +- analog: the connector has DVI analog pins
> +- digital: the connector has DVI digital pins
> +- dual-link: the connector has pins for DVI dual-link
>
>  Required nodes:
>  - Video port for DVI input
>
> +Note: One (or both) of 'analog' or 'digital' must be set.

So dual-link needs both "digital" and "dual-link"?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH 3/9] Doc/DT: Add DT binding documentation for DVI Connector
From: Tomi Valkeinen @ 2014-03-06  8:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Russell King - ARM Linux, Linux Fbdev development list,
	DRI Development,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Philipp Zabel, Laurent Pinchart, Sascha Hauer,
	Sebastian Hesselbarth, Rob Clark, Inki Dae, Andrzej Hajda,
	Tomasz Figa, Thierry Reding, Daniel Vetter
In-Reply-To: <CAMuHMdWVSfKrudBhE7FW-ZWBvMOLWjrQZvn1qZUfRt_H+P7A2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1730 bytes --]

On 06/03/14 10:39, Geert Uytterhoeven wrote:
> On Wed, Mar 5, 2014 at 9:41 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
>> On 28/02/14 18:23, Russell King - ARM Linux wrote:
>>
>>> That's rather a lot of compatible strings.  Another possibility is:
>>>
>>>       compatible = "dvi-connector";
>>>       analog;
>>>       digital;
>>>       single-link;
>>>       dual-link;
>>
>> I made the following changes compared to the posted version. I decided
>> to leave the "single-link" out, as it's implied if "digital" is set.
>>
>>  Tomi
>>
>> @@ -6,11 +6,16 @@ Required properties:
>>
>>  Optional properties:
>>  - label: a symbolic name for the connector
>> -- i2c-bus: phandle to the i2c bus that is connected to DVI DDC
>> +- ddc-i2c-bus: phandle to the i2c bus that is connected to DVI DDC
>> +- analog: the connector has DVI analog pins
>> +- digital: the connector has DVI digital pins
>> +- dual-link: the connector has pins for DVI dual-link
>>
>>  Required nodes:
>>  - Video port for DVI input
>>
>> +Note: One (or both) of 'analog' or 'digital' must be set.
> 
> So dual-link needs both "digital" and "dual-link"?

Yes. It is extra, but it felt clearer to me to have 'digital' as a
matching property for 'analog'.

Alternatively we could have three options:

analog;
digital-single-link;
digital-dual-link;

My reasoning to the format I chose was basically that when a connector
supports 'digital', it contains TMDS clock and TMDS data for link 1.
Adding dual link to that adds only TMDS data for link 2, so the second
data link is kind of an additional feature, marked with a flag.

Not a very big argument, and I'm fine with other format suggestions.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Daniel Mack @ 2014-03-06  9:09 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

On 03/06/2014 03:09 AM, Haojian Zhuang wrote:
> On Thu, Mar 6, 2014 at 12:12 AM, Daniel Mack <zonque@gmail.com> wrote:
>> Here are some cleanups for the pxa3xx-gcu driver. Patch 3/4 is actually
>> a real bugfix that is needed since the misc code doesn't set
>> file->private_data for us implicitly anymore.
>>
>> The rest are just straight-forward cleanups.
>>
>> Thanks,
>> Daniel
>>
>>
>> Daniel Mack (4):
>>   video: pxa3xx-gcu: rename some symbols
>>   video: pxa3xx-gcu: pass around struct device *
>>   video: pxa3xx-gcu: provide an empty .open call
>>   video: pxa3xx-gcu: switch to devres functions
>>
>>  drivers/video/pxa3xx-gcu.c | 191 +++++++++++++++++++--------------------------
>>  1 file changed, 81 insertions(+), 110 deletions(-)
>>

> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

Thanks Haojian!

Given that this driver doesn't actually have any connection points to
the framebuffer or video subsystem (despite its location) maybe you can
just take these patches through your pxa tree? It's a PXA3xx specific
device, after all. Jean-Christophe, Tomi - any objections?

The driver is also broken since awhile, and the fact that nobody noticed
tells me that our platform is most probably the only real user.


Thanks,
Daniel


^ permalink raw reply

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Haojian Zhuang @ 2014-03-06  9:15 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

On Thu, Mar 6, 2014 at 5:09 PM, Daniel Mack <zonque@gmail.com> wrote:
> On 03/06/2014 03:09 AM, Haojian Zhuang wrote:
>> On Thu, Mar 6, 2014 at 12:12 AM, Daniel Mack <zonque@gmail.com> wrote:
>>> Here are some cleanups for the pxa3xx-gcu driver. Patch 3/4 is actually
>>> a real bugfix that is needed since the misc code doesn't set
>>> file->private_data for us implicitly anymore.
>>>
>>> The rest are just straight-forward cleanups.
>>>
>>> Thanks,
>>> Daniel
>>>
>>>
>>> Daniel Mack (4):
>>>   video: pxa3xx-gcu: rename some symbols
>>>   video: pxa3xx-gcu: pass around struct device *
>>>   video: pxa3xx-gcu: provide an empty .open call
>>>   video: pxa3xx-gcu: switch to devres functions
>>>
>>>  drivers/video/pxa3xx-gcu.c | 191 +++++++++++++++++++--------------------------
>>>  1 file changed, 81 insertions(+), 110 deletions(-)
>>>
>
>> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>
> Thanks Haojian!
>
> Given that this driver doesn't actually have any connection points to
> the framebuffer or video subsystem (despite its location) maybe you can
> just take these patches through your pxa tree? It's a PXA3xx specific
> device, after all. Jean-Christophe, Tomi - any objections?
>

If Jean or Tomi acked on this series, I can merge them into my pxa tree.

Best Regards
Haojian

^ permalink raw reply

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Tomi Valkeinen @ 2014-03-06  9:23 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]

On 06/03/14 11:09, Daniel Mack wrote:
> On 03/06/2014 03:09 AM, Haojian Zhuang wrote:
>> On Thu, Mar 6, 2014 at 12:12 AM, Daniel Mack <zonque@gmail.com> wrote:
>>> Here are some cleanups for the pxa3xx-gcu driver. Patch 3/4 is actually
>>> a real bugfix that is needed since the misc code doesn't set
>>> file->private_data for us implicitly anymore.
>>>
>>> The rest are just straight-forward cleanups.
>>>
>>> Thanks,
>>> Daniel
>>>
>>>
>>> Daniel Mack (4):
>>>   video: pxa3xx-gcu: rename some symbols
>>>   video: pxa3xx-gcu: pass around struct device *
>>>   video: pxa3xx-gcu: provide an empty .open call
>>>   video: pxa3xx-gcu: switch to devres functions
>>>
>>>  drivers/video/pxa3xx-gcu.c | 191 +++++++++++++++++++--------------------------
>>>  1 file changed, 81 insertions(+), 110 deletions(-)
>>>
> 
>> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> 
> Thanks Haojian!
> 
> Given that this driver doesn't actually have any connection points to
> the framebuffer or video subsystem (despite its location) maybe you can
> just take these patches through your pxa tree? It's a PXA3xx specific
> device, after all. Jean-Christophe, Tomi - any objections?
> 
> The driver is also broken since awhile, and the fact that nobody noticed
> tells me that our platform is most probably the only real user.

If these do not have any dependencies to non-fbdev patches, and nothing
else has dependencies to these patches, I'd rather take them via fbdev
tree, based on the file location. There shouldn't be any conflicts, but
just in case...

As a side note, I've got a drivers/video/ reorg patch series, possibly
headed for v3.15, which moves the pxa3xx-gcu file to
drivers/video/fbdev/. That's clearly not the right place for it, but I
think it's easier to move it along the other files, and later move it
back to drivers/video/.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH] video: fbdev: uvesafb: Remove redundant NULL check in uvesafb_remove
From: Tomi Valkeinen @ 2014-03-06  9:31 UTC (permalink / raw)
  To: Wang YanQing; +Cc: plagnioj, linux-fbdev, linux-kernel, fengguang.wu
In-Reply-To: <20140305155418.GA32106@udknight>

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

On 05/03/14 17:54, Wang YanQing wrote:
> Because uvesafb_par is allocated as part of fb_info in uvesafb_probe,
> so we don't need to do NULL check for both fb_info and uvesafb_par in
> uvesafb_remove.
> 
> [ This patch also fix a warning report by fengguang.wu@intel.com
>   "drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove()
>    warn: variable dereferenced before check 'par'" ]
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/video/fbdev/uvesafb.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 1f38445..18352b2 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -1812,11 +1812,9 @@ static int uvesafb_remove(struct platform_device *dev)
>  		fb_destroy_modedb(info->monspecs.modedb);
>  		fb_dealloc_cmap(&info->cmap);
>  
> -		if (par) {
> -			kfree(par->vbe_modes);
> -			kfree(par->vbe_state_orig);
> -			kfree(par->vbe_state_saved);
> -		}
> +		kfree(par->vbe_modes);
> +		kfree(par->vbe_state_orig);
> +		kfree(par->vbe_state_saved);
>  
>  		framebuffer_release(info);
>  	}
> 

Thanks, queuing for 3.15.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH] video: fbdev: uvesafb: Remove impossible code path in uvesafb_init_info
From: Tomi Valkeinen @ 2014-03-06  9:32 UTC (permalink / raw)
  To: Wang YanQing; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel
In-Reply-To: <20140305155619.GA32166@udknight>

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

On 05/03/14 17:56, Wang YanQing wrote:
> Because uvesafb_vbe_init will fail when get zero avaiable modes,
> and we have checked the return value of uvesafb_vbe_init_mode,
> so it is impossible to pass NULL as mode into uvesafb_init_info.
> 
> [ This patch fix warning report by fengguang.wu@intel.com
>   "drivers/video/fbdev/uvesafb.c:1509 uvesafb_init_info()
>    error: we previously assumed 'mode' could be null" ]
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/video/fbdev/uvesafb.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 18352b2..509d452 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -1474,12 +1474,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
>  	 *                 used video mode, i.e. the minimum amount of
>  	 *                 memory we need.
>  	 */
> -	if (mode != NULL) {
> -		size_vmode = info->var.yres * mode->bytes_per_scan_line;
> -	} else {
> -		size_vmode = info->var.yres * info->var.xres *
> -			     ((info->var.bits_per_pixel + 7) >> 3);
> -	}
> +	size_vmode = info->var.yres * mode->bytes_per_scan_line;
>  
>  	/*
>  	 *   size_total -- all video memory we have. Used for mtrr
> 

Thanks, queuing for 3.15.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH] video: fbdev: uvesafb: use CONFIG_X86_PAE surround _PAGE_NX check code
From: Tomi Valkeinen @ 2014-03-06  9:56 UTC (permalink / raw)
  To: Wang YanQing; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel
In-Reply-To: <20140305161611.GA32461@udknight>

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

On 05/03/14 18:16, Wang YanQing wrote:
> Because _PAGE_NX check will always false when we don't define
> CONFIG_X86_PAE for CONFIG_X86_32, so use CONFIG_X86_PAE surround
> the check code.
> 
> Although I believe "smart" compile will optimize out and generate
> the same code, but use CONFIG_X86_PAE surround check code will
> clear it and prohibit warning from static source code analyze tool.
> 
> [ This patch fix warning report by fengguang.wu@intel.com
>   "drivers/video/fbdev/uvesafb.c:816 uvesafb_vbe_init()
>    warn: bitwise AND condition is false here" ]
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>
> ---
>  drivers/video/fbdev/uvesafb.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
> index 509d452..102858c 100644
> --- a/drivers/video/fbdev/uvesafb.c
> +++ b/drivers/video/fbdev/uvesafb.c
> @@ -813,6 +813,7 @@ static int uvesafb_vbe_init(struct fb_info *info)
>  	par->ypan = ypan;
>  
>  	if (par->pmi_setpal || par->ypan) {
> +#ifdef CONFIG_X86_PAE
>  		if (__supported_pte_mask & _PAGE_NX) {
>  			par->pmi_setpal = par->ypan = 0;
>  			printk(KERN_WARNING "uvesafb: NX protection is active, "
> @@ -820,6 +821,9 @@ static int uvesafb_vbe_init(struct fb_info *info)
>  		} else {
>  			uvesafb_vbe_getpmi(task, par);
>  		}
> +#else
> +		uvesafb_vbe_getpmi(task, par);
> +#endif
>  	}

I don't like this, I think this makes the code more messy, just to avoid
that warning.

And it might even be buggy. For your patch to work correctly, you need
to know the internals of _PAGE_NX, i.e. that when CONFIG_X86_PAE is not
defined, _PAGE_NX is 0. But the driver should not depend on things like
that. If _PAGE_NX is changed later, the driver will not work correctly.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Daniel Mack @ 2014-03-06 10:18 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

On 03/06/2014 10:23 AM, Tomi Valkeinen wrote:
> On 06/03/14 11:09, Daniel Mack wrote:

>> Given that this driver doesn't actually have any connection points to
>> the framebuffer or video subsystem (despite its location) maybe you can
>> just take these patches through your pxa tree? It's a PXA3xx specific
>> device, after all. Jean-Christophe, Tomi - any objections?
>>
>> The driver is also broken since awhile, and the fact that nobody noticed
>> tells me that our platform is most probably the only real user.
> 
> If these do not have any dependencies to non-fbdev patches, and nothing
> else has dependencies to these patches, I'd rather take them via fbdev
> tree, based on the file location. There shouldn't be any conflicts, but
> just in case...

Ok for me. I really don't mind :)

> As a side note, I've got a drivers/video/ reorg patch series, possibly
> headed for v3.15, which moves the pxa3xx-gcu file to
> drivers/video/fbdev/.

Ah, ok. So then they really better go via your tree then.

> That's clearly not the right place for it, but I
> think it's easier to move it along the other files, and later move it
> back to drivers/video/.

Maybe it might be worth adding a subdirectory for hardware accelerators?
Because this is what the pxa3xx-gcu thing is all about really. And it's
only a tiny transport layer that passed commands between the hardware
block and a DirectFB userspace driver.


Thanks,
Daniel


^ permalink raw reply

* Re: [PATCH v5 1/2] video: ARM CLCD: Add DT support
From: Tomi Valkeinen @ 2014-03-06 10:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1394036606-17784-1-git-send-email-pawel.moll@arm.com>

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Hi Pawel,

On 05/03/14 18:23, Pawel Moll wrote:
> This patch adds basic DT bindings for the PL11x CLCD cells
> and make their fbdev driver use them.

Is this an old HW, and presumably there won't be new users for it? If
yes, this is probably fine. If not, you might want to look at the video
ports and endpoints, which is used by at least three not-yet-merged series:

[PATCHv3 00/41] OMAPDSS: DT support v3
[PATCH v5 00/11] imx-drm dt bindings
[RFC PATCH v2 00/21] Add DSI display support for Exynos based boards

Using bindings like that would be more future proof, even if the current
driver doesn't use them.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH 0/4] Cleanups and fix for video/pxa3xx-gcu
From: Tomi Valkeinen @ 2014-03-06 10:30 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1394035969-32420-1-git-send-email-zonque@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

On 06/03/14 12:18, Daniel Mack wrote:

>> As a side note, I've got a drivers/video/ reorg patch series, possibly
>> headed for v3.15, which moves the pxa3xx-gcu file to
>> drivers/video/fbdev/.
> 
> Ah, ok. So then they really better go via your tree then.

Git should handle it fine, so it's not mandatory here. Still, I'd rather
have them via fbdev tree.

>> That's clearly not the right place for it, but I
>> think it's easier to move it along the other files, and later move it
>> back to drivers/video/.
> 
> Maybe it might be worth adding a subdirectory for hardware accelerators?
> Because this is what the pxa3xx-gcu thing is all about really. And it's
> only a tiny transport layer that passed commands between the hardware
> block and a DirectFB userspace driver.

Well, there's drivers/gpu/. It sounds like a good match, and by "sounds"
I mean the word "gpu" sounds like a good match. I'm not sure if other
people have opinions on what drivers/gpu/ should contain, though.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply

* Re: [PATCH] video: fbdev: uvesafb: use CONFIG_X86_PAE surround _PAGE_NX check code
From: Wang YanQing @ 2014-03-06 10:33 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: plagnioj, fengguang.wu, linux-fbdev, linux-kernel
In-Reply-To: <53184655.2090106@ti.com>

On Thu, Mar 06, 2014 at 11:56:37AM +0200, Tomi Valkeinen wrote:
> I don't like this, I think this makes the code more messy, just to avoid
> that warning.
> 
> And it might even be buggy. For your patch to work correctly, you need
> to know the internals of _PAGE_NX, i.e. that when CONFIG_X86_PAE is not
> defined, _PAGE_NX is 0. But the driver should not depend on things like
> that. If _PAGE_NX is changed later, the driver will not work correctly.
> 

Very right! Thanks.





^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox