Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [RESEND PATCH] staging: sm750fb: cleanup: fix brace placement
From: Charles Rose @ 2016-01-24 22:36 UTC (permalink / raw)
  To: linux-fbdev

Fix brace placement warnings caught by checkpatch.pl.

Signed-off-by: Charles Rose <charles.rose.linux@gmail.com>
---
This is a resend of the original patch posted on 20160119 where my
recepient list was incomplete.

 drivers/staging/sm750fb/sm750_cursor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index 3b7ce92..cab891c 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -143,8 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
 		iowrite16(data, pbuffer);
 
 		/* assume pitch is 1,2,4,8,...*/
-		if ((i+1) % pitch = 0)
-		{
+		if ((i+1) % pitch = 0) {
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
-- 
2.5.0


^ permalink raw reply related

* Re: [PATCH] staging: sm750fb: cleanup: fix brace placement
From: Greg KH @ 2016-01-24 20:50 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1453246935-5037-1-git-send-email-charles.rose.linux@gmail.com>

On Fri, Jan 22, 2016 at 01:45:18PM -0500, Charles Rose wrote:
> On 01/19/2016 06:42 PM, Charles Rose wrote:
> >Fix brace placement warnings caught by checkpatch.pl.
> >
> >Signed-off-by: Charles Rose <charles.rose.linux@gmail.com>
> >---
> >  drivers/staging/sm750fb/sm750_cursor.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> >diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
> >index 3b7ce92..cab891c 100644
> >--- a/drivers/staging/sm750fb/sm750_cursor.c
> >+++ b/drivers/staging/sm750fb/sm750_cursor.c
> >@@ -143,8 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
> >  		iowrite16(data, pbuffer);
> >
> >  		/* assume pitch is 1,2,4,8,...*/
> >-		if ((i+1) % pitch = 0)
> >-		{
> >+		if ((i+1) % pitch = 0) {
> >  			/* need a return */
> >  			pstart += offset;
> >  			pbuffer = pstart;
> >
> 
> Missed copying Greg KH on this.

I can't do anything with a forwarded patch like this :(

^ permalink raw reply

* [PATCH v5] dma: rename dma_*_writecombine() to dma_*_wc()
From: Luis R. Rodriguez @ 2016-01-23  2:34 UTC (permalink / raw)
  To: mingo, bp
  Cc: julia.lawall, akpm, dhowells, bhelgaas, tomi.valkeinen, airlied,
	linux-fbdev, luto, vinod.koul, dan.j.williams, toshi.kani, benh,
	mst, daniel.vetter, konrad.wilk, x86, linux-kernel, linux-pci,
	xen-devel, Luis R. Rodriguez
In-Reply-To: <20160119111345.GA16880@gmail.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

Rename dma_*_writecombine() to dma_*_wc(), so that the naming
is coherent across the various write-combining APIs. Keep the
old names for compatibility for a while, these can be removed
at a later time. A guard is left to enable backporting of the
rename, and later remove of the old mapping defines seemlessly.

Build tested successfully with allmodconfig.

The following Coccinelle SmPL patch was used for this simple
transformation:

@ rename_dma_alloc_writecombine @
expression dev, size, dma_addr, gfp;
@@

-dma_alloc_writecombine(dev, size, dma_addr, gfp)
+dma_alloc_wc(dev, size, dma_addr, gfp)

@ rename_dma_free_writecombine @
expression dev, size, cpu_addr, dma_addr;
@@

-dma_free_writecombine(dev, size, cpu_addr, dma_addr)
+dma_free_wc(dev, size, cpu_addr, dma_addr)

@ rename_dma_mmap_writecombine @
expression dev, vma, cpu_addr, dma_addr, size;
@@

-dma_mmap_writecombine(dev, vma, cpu_addr, dma_addr, size)
+dma_mmap_wc(dev, vma, cpu_addr, dma_addr, size)

V5 changes: keep the old names as compatibility helpers, and
guard against their definition to make backporting easier.

Generated-by: Coccinelle SmPL
Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---

Note: in the future a linux-oven tree that with more advanced
tools could help with the type of churn of respinning simple
patches as these which could be either scripted or the changes
made using Coccinelle. More advanced tools are needed to make
that easier, but such work is being considered [0].

[0] http://kernelnewbies.org/KernelProjects/linux-oven

 arch/arm/mach-lpc32xx/phy3250.c           | 13 ++++++-------
 arch/arm/mach-netx/fb.c                   | 14 ++++++--------
 arch/arm/mach-nspire/clcd.c               | 13 ++++++-------
 drivers/dma/iop-adma.c                    |  8 ++++----
 drivers/dma/mv_xor.c                      |  4 ++--
 drivers/dma/qcom_bam_dma.c                | 14 +++++++-------
 drivers/gpu/drm/drm_gem_cma_helper.c      | 13 ++++++-------
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c     |  8 ++++----
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c  | 13 ++++++-------
 drivers/gpu/drm/omapdrm/omap_gem.c        |  8 ++++----
 drivers/gpu/drm/sti/sti_cursor.c          | 20 +++++++++-----------
 drivers/gpu/drm/sti/sti_gdp.c             |  3 +--
 drivers/gpu/drm/sti/sti_hqvdp.c           |  6 +++---
 drivers/gpu/drm/tegra/gem.c               | 11 +++++------
 drivers/gpu/drm/vc4/vc4_bo.c              |  5 ++---
 drivers/gpu/host1x/cdma.c                 |  8 ++++----
 drivers/gpu/host1x/job.c                  | 10 ++++------
 drivers/media/platform/coda/coda-bit.c    | 10 +++++-----
 drivers/video/fbdev/acornfb.c             |  4 ++--
 drivers/video/fbdev/amba-clcd-versatile.c | 14 ++++++--------
 drivers/video/fbdev/amba-clcd.c           |  4 ++--
 drivers/video/fbdev/atmel_lcdfb.c         |  9 +++++----
 drivers/video/fbdev/ep93xx-fb.c           |  8 +++-----
 drivers/video/fbdev/gbefb.c               |  8 ++++----
 drivers/video/fbdev/imxfb.c               | 12 ++++++------
 drivers/video/fbdev/mx3fb.c               |  9 ++++-----
 drivers/video/fbdev/nuc900fb.c            |  8 ++++----
 drivers/video/fbdev/omap/lcdc.c           | 16 ++++++++--------
 drivers/video/fbdev/pxa168fb.c            |  8 ++++----
 drivers/video/fbdev/pxafb.c               |  4 ++--
 drivers/video/fbdev/s3c-fb.c              |  7 +++----
 drivers/video/fbdev/s3c2410fb.c           |  8 ++++----
 drivers/video/fbdev/sa1100fb.c            |  8 ++++----
 include/linux/dma-mapping.h               | 25 +++++++++++++++++--------
 sound/arm/pxa2xx-pcm-lib.c                | 12 ++++--------
 sound/soc/fsl/imx-pcm-fiq.c               | 10 ++++------
 sound/soc/nuc900/nuc900-pcm.c             |  6 ++----
 sound/soc/omap/omap-pcm.c                 | 12 ++++--------
 38 files changed, 176 insertions(+), 197 deletions(-)

diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index 77d6b1bab278..ee06fabdf60e 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -86,8 +86,8 @@ static int lpc32xx_clcd_setup(struct clcd_fb *fb)
 {
 	dma_addr_t dma;
 
-	fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev,
-		PANEL_SIZE, &dma, GFP_KERNEL);
+	fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, PANEL_SIZE, &dma,
+					  GFP_KERNEL);
 	if (!fb->fb.screen_base) {
 		printk(KERN_ERR "CLCD: unable to map framebuffer\n");
 		return -ENOMEM;
@@ -116,15 +116,14 @@ static int lpc32xx_clcd_setup(struct clcd_fb *fb)
 
 static int lpc32xx_clcd_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);
+	return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
+			   fb->fb.fix.smem_start, fb->fb.fix.smem_len);
 }
 
 static void lpc32xx_clcd_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);
+	dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
+		    fb->fb.fix.smem_start);
 }
 
 /*
diff --git a/arch/arm/mach-netx/fb.c b/arch/arm/mach-netx/fb.c
index d122ee6ab991..8814ee5e98fd 100644
--- a/arch/arm/mach-netx/fb.c
+++ b/arch/arm/mach-netx/fb.c
@@ -42,8 +42,8 @@ int netx_clcd_setup(struct clcd_fb *fb)
 
 	fb->panel = netx_panel;
 
-	fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, 1024*1024,
-						    &dma, GFP_KERNEL);
+	fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, 1024 * 1024, &dma,
+					  GFP_KERNEL);
 	if (!fb->fb.screen_base) {
 		printk(KERN_ERR "CLCD: unable to map framebuffer\n");
 		return -ENOMEM;
@@ -57,16 +57,14 @@ int netx_clcd_setup(struct clcd_fb *fb)
 
 int netx_clcd_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);
+	return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
+			   fb->fb.fix.smem_start, fb->fb.fix.smem_len);
 }
 
 void netx_clcd_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);
+	dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
+		    fb->fb.fix.smem_start);
 }
 
 static AMBA_AHB_DEVICE(fb, "fb", 0, 0x00104000, { NETX_IRQ_LCD }, NULL);
diff --git a/arch/arm/mach-nspire/clcd.c b/arch/arm/mach-nspire/clcd.c
index abea12617b17..ea0e5b2ca1cd 100644
--- a/arch/arm/mach-nspire/clcd.c
+++ b/arch/arm/mach-nspire/clcd.c
@@ -90,8 +90,8 @@ int nspire_clcd_setup(struct clcd_fb *fb)
 	panel_size = ((panel->mode.xres * panel->mode.yres) * panel->bpp) / 8;
 	panel_size = ALIGN(panel_size, PAGE_SIZE);
 
-	fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev,
-		panel_size, &dma, GFP_KERNEL);
+	fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, panel_size, &dma,
+					  GFP_KERNEL);
 
 	if (!fb->fb.screen_base) {
 		pr_err("CLCD: unable to map framebuffer\n");
@@ -107,13 +107,12 @@ int nspire_clcd_setup(struct clcd_fb *fb)
 
 int nspire_clcd_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);
+	return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
+			   fb->fb.fix.smem_start, fb->fb.fix.smem_len);
 }
 
 void nspire_clcd_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);
+	dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
+		    fb->fb.fix.smem_start);
 }
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index e4f43125e0fb..f039cfadf17b 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -1300,10 +1300,10 @@ static int iop_adma_probe(struct platform_device *pdev)
 	 * note: writecombine gives slightly better performance, but
 	 * requires that we explicitly flush the writes
 	 */
-	adev->dma_desc_pool_virt = dma_alloc_writecombine(&pdev->dev,
-							  plat_data->pool_size,
-							  &adev->dma_desc_pool,
-							  GFP_KERNEL);
+	adev->dma_desc_pool_virt = dma_alloc_wc(&pdev->dev,
+						plat_data->pool_size,
+						&adev->dma_desc_pool,
+						GFP_KERNEL);
 	if (!adev->dma_desc_pool_virt) {
 		ret = -ENOMEM;
 		goto err_free_adev;
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 14091f878f80..3922a5d56806 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -964,8 +964,8 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
 	 * requires that we explicitly flush the writes
 	 */
 	mv_chan->dma_desc_pool_virt -	  dma_alloc_writecombine(&pdev->dev, MV_XOR_POOL_SIZE,
-				 &mv_chan->dma_desc_pool, GFP_KERNEL);
+	  dma_alloc_wc(&pdev->dev, MV_XOR_POOL_SIZE, &mv_chan->dma_desc_pool,
+		       GFP_KERNEL);
 	if (!mv_chan->dma_desc_pool_virt)
 		return ERR_PTR(-ENOMEM);
 
diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
index 5a250cdc8376..d34aef7a101b 100644
--- a/drivers/dma/qcom_bam_dma.c
+++ b/drivers/dma/qcom_bam_dma.c
@@ -502,8 +502,8 @@ static int bam_alloc_chan(struct dma_chan *chan)
 		return 0;
 
 	/* allocate FIFO descriptor space, but only if necessary */
-	bchan->fifo_virt = dma_alloc_writecombine(bdev->dev, BAM_DESC_FIFO_SIZE,
-				&bchan->fifo_phys, GFP_KERNEL);
+	bchan->fifo_virt = dma_alloc_wc(bdev->dev, BAM_DESC_FIFO_SIZE,
+					&bchan->fifo_phys, GFP_KERNEL);
 
 	if (!bchan->fifo_virt) {
 		dev_err(bdev->dev, "Failed to allocate desc fifo\n");
@@ -538,8 +538,8 @@ static void bam_free_chan(struct dma_chan *chan)
 	bam_reset_channel(bchan);
 	spin_unlock_irqrestore(&bchan->vc.lock, flags);
 
-	dma_free_writecombine(bdev->dev, BAM_DESC_FIFO_SIZE, bchan->fifo_virt,
-				bchan->fifo_phys);
+	dma_free_wc(bdev->dev, BAM_DESC_FIFO_SIZE, bchan->fifo_virt,
+		    bchan->fifo_phys);
 	bchan->fifo_virt = NULL;
 
 	/* mask irq for pipe/channel */
@@ -1231,9 +1231,9 @@ static int bam_dma_remove(struct platform_device *pdev)
 		bam_dma_terminate_all(&bdev->channels[i].vc.chan);
 		tasklet_kill(&bdev->channels[i].vc.task);
 
-		dma_free_writecombine(bdev->dev, BAM_DESC_FIFO_SIZE,
-			bdev->channels[i].fifo_virt,
-			bdev->channels[i].fifo_phys);
+		dma_free_wc(bdev->dev, BAM_DESC_FIFO_SIZE,
+			    bdev->channels[i].fifo_virt,
+			    bdev->channels[i].fifo_phys);
 	}
 
 	tasklet_kill(&bdev->task);
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
index e5df53b6e229..1f500a1b9969 100644
--- a/drivers/gpu/drm/drm_gem_cma_helper.c
+++ b/drivers/gpu/drm/drm_gem_cma_helper.c
@@ -109,8 +109,8 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
 	if (IS_ERR(cma_obj))
 		return cma_obj;
 
-	cma_obj->vaddr = dma_alloc_writecombine(drm->dev, size,
-			&cma_obj->paddr, GFP_KERNEL | __GFP_NOWARN);
+	cma_obj->vaddr = dma_alloc_wc(drm->dev, size, &cma_obj->paddr,
+				      GFP_KERNEL | __GFP_NOWARN);
 	if (!cma_obj->vaddr) {
 		dev_err(drm->dev, "failed to allocate buffer with size %zu\n",
 			size);
@@ -192,8 +192,8 @@ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj)
 	cma_obj = to_drm_gem_cma_obj(gem_obj);
 
 	if (cma_obj->vaddr) {
-		dma_free_writecombine(gem_obj->dev->dev, cma_obj->base.size,
-				      cma_obj->vaddr, cma_obj->paddr);
+		dma_free_wc(gem_obj->dev->dev, cma_obj->base.size,
+			    cma_obj->vaddr, cma_obj->paddr);
 	} else if (gem_obj->import_attach) {
 		drm_prime_gem_destroy(gem_obj, cma_obj->sgt);
 	}
@@ -324,9 +324,8 @@ static int drm_gem_cma_mmap_obj(struct drm_gem_cma_object *cma_obj,
 	vma->vm_flags &= ~VM_PFNMAP;
 	vma->vm_pgoff = 0;
 
-	ret = dma_mmap_writecombine(cma_obj->base.dev->dev, vma,
-				    cma_obj->vaddr, cma_obj->paddr,
-				    vma->vm_end - vma->vm_start);
+	ret = dma_mmap_wc(cma_obj->base.dev->dev, vma, cma_obj->vaddr,
+			  cma_obj->paddr, vma->vm_end - vma->vm_start);
 	if (ret)
 		drm_gem_vm_close(vma);
 
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 056a72e6ed26..82a3c1098cb7 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1048,8 +1048,8 @@ struct etnaviv_cmdbuf *etnaviv_gpu_cmdbuf_new(struct etnaviv_gpu *gpu, u32 size,
 	if (!cmdbuf)
 		return NULL;
 
-	cmdbuf->vaddr = dma_alloc_writecombine(gpu->dev, size, &cmdbuf->paddr,
-					       GFP_KERNEL);
+	cmdbuf->vaddr = dma_alloc_wc(gpu->dev, size, &cmdbuf->paddr,
+				     GFP_KERNEL);
 	if (!cmdbuf->vaddr) {
 		kfree(cmdbuf);
 		return NULL;
@@ -1063,8 +1063,8 @@ struct etnaviv_cmdbuf *etnaviv_gpu_cmdbuf_new(struct etnaviv_gpu *gpu, u32 size,
 
 void etnaviv_gpu_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf)
 {
-	dma_free_writecombine(cmdbuf->gpu->dev, cmdbuf->size,
-			      cmdbuf->vaddr, cmdbuf->paddr);
+	dma_free_wc(cmdbuf->gpu->dev, cmdbuf->size, cmdbuf->vaddr,
+		    cmdbuf->paddr);
 	kfree(cmdbuf);
 }
 
diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index dfebdc4aa0f2..85dfe3674b41 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -573,10 +573,9 @@ static int omap_dmm_remove(struct platform_device *dev)
 
 		kfree(omap_dmm->engines);
 		if (omap_dmm->refill_va)
-			dma_free_writecombine(omap_dmm->dev,
-				REFILL_BUFFER_SIZE * omap_dmm->num_engines,
-				omap_dmm->refill_va,
-				omap_dmm->refill_pa);
+			dma_free_wc(omap_dmm->dev,
+				    REFILL_BUFFER_SIZE * omap_dmm->num_engines,
+				    omap_dmm->refill_va, omap_dmm->refill_pa);
 		if (omap_dmm->dummy_page)
 			__free_page(omap_dmm->dummy_page);
 
@@ -701,9 +700,9 @@ static int omap_dmm_probe(struct platform_device *dev)
 	omap_dmm->dummy_pa = page_to_phys(omap_dmm->dummy_page);
 
 	/* alloc refill memory */
-	omap_dmm->refill_va = dma_alloc_writecombine(&dev->dev,
-				REFILL_BUFFER_SIZE * omap_dmm->num_engines,
-				&omap_dmm->refill_pa, GFP_KERNEL);
+	omap_dmm->refill_va = dma_alloc_wc(&dev->dev,
+					   REFILL_BUFFER_SIZE * omap_dmm->num_engines,
+					   &omap_dmm->refill_pa, GFP_KERNEL);
 	if (!omap_dmm->refill_va) {
 		dev_err(&dev->dev, "could not allocate refill memory\n");
 		goto fail;
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 8495a1a4b617..359b0d7e8ef7 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1330,8 +1330,8 @@ void omap_gem_free_object(struct drm_gem_object *obj)
 			omap_gem_detach_pages(obj);
 
 		if (!is_shmem(obj)) {
-			dma_free_writecombine(dev->dev, obj->size,
-					omap_obj->vaddr, omap_obj->paddr);
+			dma_free_wc(dev->dev, obj->size, omap_obj->vaddr,
+				    omap_obj->paddr);
 		} else if (omap_obj->vaddr) {
 			vunmap(omap_obj->vaddr);
 		}
@@ -1395,8 +1395,8 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
 		/* attempt to allocate contiguous memory if we don't
 		 * have DMM for remappign discontiguous buffers
 		 */
-		omap_obj->vaddr =  dma_alloc_writecombine(dev->dev, size,
-				&omap_obj->paddr, GFP_KERNEL);
+		omap_obj->vaddr =  dma_alloc_wc(dev->dev, size,
+						&omap_obj->paddr, GFP_KERNEL);
 		if (!omap_obj->vaddr) {
 			kfree(omap_obj);
 
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index 807863106b8d..bd736ace3f81 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -157,17 +157,15 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
 		cursor->height = src_h;
 
 		if (cursor->pixmap.base)
-			dma_free_writecombine(cursor->dev,
-					      cursor->pixmap.size,
-					      cursor->pixmap.base,
-					      cursor->pixmap.paddr);
+			dma_free_wc(cursor->dev, cursor->pixmap.size,
+				    cursor->pixmap.base, cursor->pixmap.paddr);
 
 		cursor->pixmap.size = cursor->width * cursor->height;
 
-		cursor->pixmap.base = dma_alloc_writecombine(cursor->dev,
-							cursor->pixmap.size,
-							&cursor->pixmap.paddr,
-							GFP_KERNEL | GFP_DMA);
+		cursor->pixmap.base = dma_alloc_wc(cursor->dev,
+						   cursor->pixmap.size,
+						   &cursor->pixmap.paddr,
+						   GFP_KERNEL | GFP_DMA);
 		if (!cursor->pixmap.base) {
 			DRM_ERROR("Failed to allocate memory for pixmap\n");
 			return;
@@ -252,8 +250,8 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev,
 
 	/* Allocate clut buffer */
 	size = 0x100 * sizeof(unsigned short);
-	cursor->clut = dma_alloc_writecombine(dev, size, &cursor->clut_paddr,
-					      GFP_KERNEL | GFP_DMA);
+	cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr,
+				    GFP_KERNEL | GFP_DMA);
 
 	if (!cursor->clut) {
 		DRM_ERROR("Failed to allocate memory for cursor clut\n");
@@ -286,7 +284,7 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev,
 	return &cursor->plane.drm_plane;
 
 err_plane:
-	dma_free_writecombine(dev, size, cursor->clut, cursor->clut_paddr);
+	dma_free_wc(dev, size, cursor->clut, cursor->clut_paddr);
 err_clut:
 	devm_kfree(dev, cursor);
 	return NULL;
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index f9a1d92c9d95..514551c857bb 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -312,8 +312,7 @@ static void sti_gdp_init(struct sti_gdp *gdp)
 	/* Allocate all the nodes within a single memory page */
 	size = sizeof(struct sti_gdp_node) *
 	    GDP_NODE_PER_FIELD * GDP_NODE_NB_BANK;
-	base = dma_alloc_writecombine(gdp->dev,
-				      size, &dma_addr, GFP_KERNEL | GFP_DMA);
+	base = dma_alloc_wc(gdp->dev, size, &dma_addr, GFP_KERNEL | GFP_DMA);
 
 	if (!base) {
 		DRM_ERROR("Failed to allocate memory for GDP node\n");
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 43861b52261d..1d3c3d029603 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -617,9 +617,9 @@ static void sti_hqvdp_init(struct sti_hqvdp *hqvdp)
 
 	/* Allocate memory for the VDP commands */
 	size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd);
-	hqvdp->hqvdp_cmd = dma_alloc_writecombine(hqvdp->dev, size,
-					 &hqvdp->hqvdp_cmd_paddr,
-					 GFP_KERNEL | GFP_DMA);
+	hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size,
+					&hqvdp->hqvdp_cmd_paddr,
+					GFP_KERNEL | GFP_DMA);
 	if (!hqvdp->hqvdp_cmd) {
 		DRM_ERROR("Failed to allocate memory for VDP cmd\n");
 		return;
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 33add93b4ed9..3b0d8c392b70 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -175,8 +175,7 @@ static void tegra_bo_free(struct drm_device *drm, struct tegra_bo *bo)
 		sg_free_table(bo->sgt);
 		kfree(bo->sgt);
 	} else if (bo->vaddr) {
-		dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr,
-				      bo->paddr);
+		dma_free_wc(drm->dev, bo->gem.size, bo->vaddr, bo->paddr);
 	}
 }
 
@@ -233,8 +232,8 @@ static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo)
 	} else {
 		size_t size = bo->gem.size;
 
-		bo->vaddr = dma_alloc_writecombine(drm->dev, size, &bo->paddr,
-						   GFP_KERNEL | __GFP_NOWARN);
+		bo->vaddr = dma_alloc_wc(drm->dev, size, &bo->paddr,
+					 GFP_KERNEL | __GFP_NOWARN);
 		if (!bo->vaddr) {
 			dev_err(drm->dev,
 				"failed to allocate buffer of size %zu\n",
@@ -472,8 +471,8 @@ int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma)
 		vma->vm_flags &= ~VM_PFNMAP;
 		vma->vm_pgoff = 0;
 
-		ret = dma_mmap_writecombine(gem->dev->dev, vma, bo->vaddr,
-					    bo->paddr, gem->size);
+		ret = dma_mmap_wc(gem->dev->dev, vma, bo->vaddr, bo->paddr,
+				  gem->size);
 		if (ret) {
 			drm_gem_vm_close(vma);
 			return ret;
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 18dfe3ec9a62..85639ab53e94 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -398,9 +398,8 @@ int vc4_mmap(struct file *filp, struct vm_area_struct *vma)
 	vma->vm_flags &= ~VM_PFNMAP;
 	vma->vm_pgoff = 0;
 
-	ret = dma_mmap_writecombine(bo->base.base.dev->dev, vma,
-				    bo->base.vaddr, bo->base.paddr,
-				    vma->vm_end - vma->vm_start);
+	ret = dma_mmap_wc(bo->base.base.dev->dev, vma, bo->base.vaddr,
+			  bo->base.paddr, vma->vm_end - vma->vm_start);
 	if (ret)
 		drm_gem_vm_close(vma);
 
diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c
index 5a8c8d55317a..a18db4d5347c 100644
--- a/drivers/gpu/host1x/cdma.c
+++ b/drivers/gpu/host1x/cdma.c
@@ -52,8 +52,8 @@ static void host1x_pushbuffer_destroy(struct push_buffer *pb)
 	struct host1x *host1x = cdma_to_host1x(cdma);
 
 	if (pb->phys != 0)
-		dma_free_writecombine(host1x->dev, pb->size_bytes + 4,
-				      pb->mapped, pb->phys);
+		dma_free_wc(host1x->dev, pb->size_bytes + 4, pb->mapped,
+			    pb->phys);
 
 	pb->mapped = NULL;
 	pb->phys = 0;
@@ -76,8 +76,8 @@ static int host1x_pushbuffer_init(struct push_buffer *pb)
 	pb->pos = 0;
 
 	/* allocate and map pushbuffer memory */
-	pb->mapped = dma_alloc_writecombine(host1x->dev, pb->size_bytes + 4,
-					    &pb->phys, GFP_KERNEL);
+	pb->mapped = dma_alloc_wc(host1x->dev, pb->size_bytes + 4, &pb->phys,
+				  GFP_KERNEL);
 	if (!pb->mapped)
 		goto fail;
 
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index 63bd63f3c7df..defa7995f213 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -467,9 +467,8 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
 		size += g->words * sizeof(u32);
 	}
 
-	job->gather_copy_mapped = dma_alloc_writecombine(dev, size,
-							 &job->gather_copy,
-							 GFP_KERNEL);
+	job->gather_copy_mapped = dma_alloc_wc(dev, size, &job->gather_copy,
+					       GFP_KERNEL);
 	if (!job->gather_copy_mapped) {
 		job->gather_copy_mapped = NULL;
 		return -ENOMEM;
@@ -578,9 +577,8 @@ void host1x_job_unpin(struct host1x_job *job)
 	job->num_unpins = 0;
 
 	if (job->gather_copy_size)
-		dma_free_writecombine(job->channel->dev, job->gather_copy_size,
-				      job->gather_copy_mapped,
-				      job->gather_copy);
+		dma_free_wc(job->channel->dev, job->gather_copy_size,
+		            job->gather_copy_mapped, job->gather_copy);
 }
 EXPORT_SYMBOL(host1x_job_unpin);
 
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 7d28899f89ce..38aacc7fc692 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1455,9 +1455,9 @@ static int coda_alloc_bitstream_buffer(struct coda_ctx *ctx,
 		return 0;
 
 	ctx->bitstream.size = roundup_pow_of_two(q_data->sizeimage * 2);
-	ctx->bitstream.vaddr = dma_alloc_writecombine(
-			&ctx->dev->plat_dev->dev, ctx->bitstream.size,
-			&ctx->bitstream.paddr, GFP_KERNEL);
+	ctx->bitstream.vaddr = dma_alloc_wc(&ctx->dev->plat_dev->dev,
+					    ctx->bitstream.size,
+					    &ctx->bitstream.paddr, GFP_KERNEL);
 	if (!ctx->bitstream.vaddr) {
 		v4l2_err(&ctx->dev->v4l2_dev,
 			 "failed to allocate bitstream ringbuffer");
@@ -1474,8 +1474,8 @@ static void coda_free_bitstream_buffer(struct coda_ctx *ctx)
 	if (ctx->bitstream.vaddr = NULL)
 		return;
 
-	dma_free_writecombine(&ctx->dev->plat_dev->dev, ctx->bitstream.size,
-			      ctx->bitstream.vaddr, ctx->bitstream.paddr);
+	dma_free_wc(&ctx->dev->plat_dev->dev, ctx->bitstream.size,
+		    ctx->bitstream.vaddr, ctx->bitstream.paddr);
 	ctx->bitstream.vaddr = NULL;
 	kfifo_init(&ctx->bitstream_fifo, NULL, 0);
 }
diff --git a/drivers/video/fbdev/acornfb.c b/drivers/video/fbdev/acornfb.c
index a305caea58ee..fb75b7e5a19a 100644
--- a/drivers/video/fbdev/acornfb.c
+++ b/drivers/video/fbdev/acornfb.c
@@ -1040,8 +1040,8 @@ static int acornfb_probe(struct platform_device *dev)
 		 * for the framebuffer if we are not using
 		 * VRAM.
 		 */
-		base = dma_alloc_writecombine(current_par.dev, size, &handle,
-					      GFP_KERNEL);
+		base = dma_alloc_wc(current_par.dev, size, &handle,
+				    GFP_KERNEL);
 		if (base = NULL) {
 			printk(KERN_ERR "acornfb: unable to allocate screen "
 			       "memory\n");
diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c
index 7a8afcd4573e..a8a22daa3f9d 100644
--- a/drivers/video/fbdev/amba-clcd-versatile.c
+++ b/drivers/video/fbdev/amba-clcd-versatile.c
@@ -154,8 +154,8 @@ int versatile_clcd_setup_dma(struct clcd_fb *fb, unsigned long framesize)
 {
 	dma_addr_t dma;
 
-	fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
-						    &dma, GFP_KERNEL);
+	fb->fb.screen_base = dma_alloc_wc(&fb->dev->dev, framesize, &dma,
+					  GFP_KERNEL);
 	if (!fb->fb.screen_base) {
 		pr_err("CLCD: unable to map framebuffer\n");
 		return -ENOMEM;
@@ -169,14 +169,12 @@ int versatile_clcd_setup_dma(struct clcd_fb *fb, unsigned long framesize)
 
 int versatile_clcd_mmap_dma(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);
+	return dma_mmap_wc(&fb->dev->dev, vma, fb->fb.screen_base,
+			   fb->fb.fix.smem_start, fb->fb.fix.smem_len);
 }
 
 void versatile_clcd_remove_dma(struct clcd_fb *fb)
 {
-	dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
-			      fb->fb.screen_base, fb->fb.fix.smem_start);
+	dma_free_wc(&fb->dev->dev, fb->fb.fix.smem_len, fb->fb.screen_base,
+		    fb->fb.fix.smem_start);
 }
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 9362424c2340..fe274b5851c7 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -774,8 +774,8 @@ static int clcdfb_of_dma_setup(struct clcd_fb *fb)
 
 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);
+	return dma_mmap_wc(&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)
diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index 19eb42b57d87..56c60e67316a 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -414,8 +414,8 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
 {
 	struct fb_info *info = sinfo->info;
 
-	dma_free_writecombine(info->device, info->fix.smem_len,
-				info->screen_base, info->fix.smem_start);
+	dma_free_wc(info->device, info->fix.smem_len, info->screen_base,
+		    info->fix.smem_start);
 }
 
 /**
@@ -435,8 +435,9 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
 		    * ((var->bits_per_pixel + 7) / 8));
 	info->fix.smem_len = max(smem_len, sinfo->smem_len);
 
-	info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len,
-					(dma_addr_t *)&info->fix.smem_start, GFP_KERNEL);
+	info->screen_base = dma_alloc_wc(info->device, info->fix.smem_len,
+					 (dma_addr_t *)&info->fix.smem_start,
+					 GFP_KERNEL);
 
 	if (!info->screen_base) {
 		return -ENOMEM;
diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c
index 5b1081030cbb..75f0db25d19f 100644
--- a/drivers/video/fbdev/ep93xx-fb.c
+++ b/drivers/video/fbdev/ep93xx-fb.c
@@ -316,9 +316,8 @@ static int ep93xxfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 	unsigned int offset = vma->vm_pgoff << PAGE_SHIFT;
 
 	if (offset < info->fix.smem_len) {
-		return dma_mmap_writecombine(info->dev, vma, info->screen_base,
-					     info->fix.smem_start,
-					     info->fix.smem_len);
+		return dma_mmap_wc(info->dev, vma, info->screen_base,
+				   info->fix.smem_start, info->fix.smem_len);
 	}
 
 	return -EINVAL;
@@ -428,8 +427,7 @@ static int ep93xxfb_alloc_videomem(struct fb_info *info)
 	/* Maximum 16bpp -> used memory is maximum x*y*2 bytes */
 	fb_size = EP93XXFB_MAX_XRES * EP93XXFB_MAX_YRES * 2;
 
-	virt_addr = dma_alloc_writecombine(info->dev, fb_size,
-					   &phys_addr, GFP_KERNEL);
+	virt_addr = dma_alloc_wc(info->dev, fb_size, &phys_addr, GFP_KERNEL);
 	if (!virt_addr)
 		return -ENOMEM;
 
diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
index b63d55f481fa..1a242b1338e9 100644
--- a/drivers/video/fbdev/gbefb.c
+++ b/drivers/video/fbdev/gbefb.c
@@ -1185,8 +1185,8 @@ static int gbefb_probe(struct platform_device *p_dev)
 	} else {
 		/* try to allocate memory with the classical allocator
 		 * this has high chance to fail on low memory machines */
-		gbe_mem = dma_alloc_writecombine(NULL, gbe_mem_size,
-						 &gbe_dma_addr, GFP_KERNEL);
+		gbe_mem = dma_alloc_wc(NULL, gbe_mem_size, &gbe_dma_addr,
+				       GFP_KERNEL);
 		if (!gbe_mem) {
 			printk(KERN_ERR "gbefb: couldn't allocate framebuffer memory\n");
 			ret = -ENOMEM;
@@ -1238,7 +1238,7 @@ static int gbefb_probe(struct platform_device *p_dev)
 out_gbe_unmap:
 	arch_phys_wc_del(par->wc_cookie);
 	if (gbe_dma_addr)
-		dma_free_writecombine(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
+		dma_free_wc(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
 out_tiles_free:
 	dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
 			  (void *)gbe_tiles.cpu, gbe_tiles.dma);
@@ -1259,7 +1259,7 @@ static int gbefb_remove(struct platform_device* p_dev)
 	gbe_turn_off();
 	arch_phys_wc_del(par->wc_cookie);
 	if (gbe_dma_addr)
-		dma_free_writecombine(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
+		dma_free_wc(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys);
 	dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),
 			  (void *)gbe_tiles.cpu, gbe_tiles.dma);
 	release_mem_region(GBE_BASE, sizeof(struct sgi_gbe));
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index cee88603efc9..465b3387c549 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -922,8 +922,8 @@ static int imxfb_probe(struct platform_device *pdev)
 	}
 
 	fbi->map_size = PAGE_ALIGN(info->fix.smem_len);
-	info->screen_base = dma_alloc_writecombine(&pdev->dev, fbi->map_size,
-						   &fbi->map_dma, GFP_KERNEL);
+	info->screen_base = dma_alloc_wc(&pdev->dev, fbi->map_size,
+					 &fbi->map_dma, GFP_KERNEL);
 
 	if (!info->screen_base) {
 		dev_err(&pdev->dev, "Failed to allocate video RAM: %d\n", ret);
@@ -990,8 +990,8 @@ failed_cmap:
 	if (pdata && pdata->exit)
 		pdata->exit(fbi->pdev);
 failed_platform_init:
-	dma_free_writecombine(&pdev->dev, fbi->map_size, info->screen_base,
-			      fbi->map_dma);
+	dma_free_wc(&pdev->dev, fbi->map_size, info->screen_base,
+		    fbi->map_dma);
 failed_map:
 	iounmap(fbi->regs);
 failed_ioremap:
@@ -1026,8 +1026,8 @@ static int imxfb_remove(struct platform_device *pdev)
 	kfree(info->pseudo_palette);
 	framebuffer_release(info);
 
-	dma_free_writecombine(&pdev->dev, fbi->map_size, info->screen_base,
-			      fbi->map_dma);
+	dma_free_wc(&pdev->dev, fbi->map_size, info->screen_base,
+		    fbi->map_dma);
 
 	iounmap(fbi->regs);
 	release_mem_region(res->start, resource_size(res));
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 7947634ee6b0..f91b1db262b0 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -1336,9 +1336,8 @@ static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
 	int retval = 0;
 	dma_addr_t addr;
 
-	fbi->screen_base = dma_alloc_writecombine(fbi->device,
-						  mem_len,
-						  &addr, GFP_DMA | GFP_KERNEL);
+	fbi->screen_base = dma_alloc_wc(fbi->device, mem_len, &addr,
+					GFP_DMA | GFP_KERNEL);
 
 	if (!fbi->screen_base) {
 		dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n",
@@ -1378,8 +1377,8 @@ err0:
  */
 static int mx3fb_unmap_video_memory(struct fb_info *fbi)
 {
-	dma_free_writecombine(fbi->device, fbi->fix.smem_len,
-			      fbi->screen_base, fbi->fix.smem_start);
+	dma_free_wc(fbi->device, fbi->fix.smem_len, fbi->screen_base,
+		    fbi->fix.smem_start);
 
 	fbi->screen_base = NULL;
 	mutex_lock(&fbi->mm_lock);
diff --git a/drivers/video/fbdev/nuc900fb.c b/drivers/video/fbdev/nuc900fb.c
index 389fa2cbb713..6680edae4696 100644
--- a/drivers/video/fbdev/nuc900fb.c
+++ b/drivers/video/fbdev/nuc900fb.c
@@ -396,8 +396,8 @@ static int nuc900fb_map_video_memory(struct fb_info *info)
 	dev_dbg(fbi->dev, "nuc900fb_map_video_memory(fbi=%p) map_size %lu\n",
 		fbi, map_size);
 
-	info->screen_base = dma_alloc_writecombine(fbi->dev, map_size,
-							&map_dma, GFP_KERNEL);
+	info->screen_base = dma_alloc_wc(fbi->dev, map_size, &map_dma,
+					 GFP_KERNEL);
 
 	if (!info->screen_base)
 		return -ENOMEM;
@@ -411,8 +411,8 @@ static int nuc900fb_map_video_memory(struct fb_info *info)
 static inline void nuc900fb_unmap_video_memory(struct fb_info *info)
 {
 	struct nuc900fb_info *fbi = info->par;
-	dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
-			      info->screen_base, info->fix.smem_start);
+	dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
+		    info->screen_base, info->fix.smem_start);
 }
 
 static irqreturn_t nuc900fb_irqhandler(int irq, void *dev_id)
diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c
index 6efa2591eaa8..e3d9b9ea5498 100644
--- a/drivers/video/fbdev/omap/lcdc.c
+++ b/drivers/video/fbdev/omap/lcdc.c
@@ -612,8 +612,8 @@ static void lcdc_dma_handler(u16 status, void *data)
 
 static int alloc_palette_ram(void)
 {
-	lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev,
-		MAX_PALETTE_SIZE, &lcdc.palette_phys, GFP_KERNEL);
+	lcdc.palette_virt = dma_alloc_wc(lcdc.fbdev->dev, MAX_PALETTE_SIZE,
+					 &lcdc.palette_phys, GFP_KERNEL);
 	if (lcdc.palette_virt = NULL) {
 		dev_err(lcdc.fbdev->dev, "failed to alloc palette memory\n");
 		return -ENOMEM;
@@ -625,8 +625,8 @@ static int alloc_palette_ram(void)
 
 static void free_palette_ram(void)
 {
-	dma_free_writecombine(lcdc.fbdev->dev, MAX_PALETTE_SIZE,
-			lcdc.palette_virt, lcdc.palette_phys);
+	dma_free_wc(lcdc.fbdev->dev, MAX_PALETTE_SIZE, lcdc.palette_virt,
+		    lcdc.palette_phys);
 }
 
 static int alloc_fbmem(struct omapfb_mem_region *region)
@@ -642,8 +642,8 @@ static int alloc_fbmem(struct omapfb_mem_region *region)
 	if (region->size > frame_size)
 		frame_size = region->size;
 	lcdc.vram_size = frame_size;
-	lcdc.vram_virt = dma_alloc_writecombine(lcdc.fbdev->dev,
-			lcdc.vram_size, &lcdc.vram_phys, GFP_KERNEL);
+	lcdc.vram_virt = dma_alloc_wc(lcdc.fbdev->dev, lcdc.vram_size,
+				      &lcdc.vram_phys, GFP_KERNEL);
 	if (lcdc.vram_virt = NULL) {
 		dev_err(lcdc.fbdev->dev, "unable to allocate FB DMA memory\n");
 		return -ENOMEM;
@@ -660,8 +660,8 @@ static int alloc_fbmem(struct omapfb_mem_region *region)
 
 static void free_fbmem(void)
 {
-	dma_free_writecombine(lcdc.fbdev->dev, lcdc.vram_size,
-			      lcdc.vram_virt, lcdc.vram_phys);
+	dma_free_wc(lcdc.fbdev->dev, lcdc.vram_size, lcdc.vram_virt,
+		    lcdc.vram_phys);
 }
 
 static int setup_fbmem(struct omapfb_mem_desc *req_md)
diff --git a/drivers/video/fbdev/pxa168fb.c b/drivers/video/fbdev/pxa168fb.c
index efb57c059997..def3a501acd6 100644
--- a/drivers/video/fbdev/pxa168fb.c
+++ b/drivers/video/fbdev/pxa168fb.c
@@ -680,8 +680,8 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	 */
 	info->fix.smem_len = PAGE_ALIGN(DEFAULT_FB_SIZE);
 
-	info->screen_base = dma_alloc_writecombine(fbi->dev, info->fix.smem_len,
-						&fbi->fb_start_dma, GFP_KERNEL);
+	info->screen_base = dma_alloc_wc(fbi->dev, info->fix.smem_len,
+					 &fbi->fb_start_dma, GFP_KERNEL);
 	if (info->screen_base = NULL) {
 		ret = -ENOMEM;
 		goto failed_free_info;
@@ -804,8 +804,8 @@ static int pxa168fb_remove(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 
-	dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
-				info->screen_base, info->fix.smem_start);
+	dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
+		    info->screen_base, info->fix.smem_start);
 
 	clk_disable(fbi->clk);
 
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 33b2bb315a2a..2c0487f4f805 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2446,8 +2446,8 @@ static int pxafb_remove(struct platform_device *dev)
 
 	free_pages_exact(fbi->video_mem, fbi->video_mem_size);
 
-	dma_free_writecombine(&dev->dev, fbi->dma_buff_size,
-			fbi->dma_buff, fbi->dma_buff_phys);
+	dma_free_wc(&dev->dev, fbi->dma_buff_size, fbi->dma_buff,
+		    fbi->dma_buff_phys);
 
 	iounmap(fbi->mmio_base);
 
diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index f72dd12456f9..5f4f696c2ecf 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -1105,8 +1105,7 @@ static int s3c_fb_alloc_memory(struct s3c_fb *sfb, struct s3c_fb_win *win)
 
 	dev_dbg(sfb->dev, "want %u bytes for window\n", size);
 
-	fbi->screen_base = dma_alloc_writecombine(sfb->dev, size,
-						  &map_dma, GFP_KERNEL);
+	fbi->screen_base = dma_alloc_wc(sfb->dev, size, &map_dma, GFP_KERNEL);
 	if (!fbi->screen_base)
 		return -ENOMEM;
 
@@ -1131,8 +1130,8 @@ static void s3c_fb_free_memory(struct s3c_fb *sfb, struct s3c_fb_win *win)
 	struct fb_info *fbi = win->fbinfo;
 
 	if (fbi->screen_base)
-		dma_free_writecombine(sfb->dev, PAGE_ALIGN(fbi->fix.smem_len),
-			      fbi->screen_base, fbi->fix.smem_start);
+		dma_free_wc(sfb->dev, PAGE_ALIGN(fbi->fix.smem_len),
+		            fbi->screen_base, fbi->fix.smem_start);
 }
 
 /**
diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c
index d6704add1601..0dd86be36afb 100644
--- a/drivers/video/fbdev/s3c2410fb.c
+++ b/drivers/video/fbdev/s3c2410fb.c
@@ -645,8 +645,8 @@ static int s3c2410fb_map_video_memory(struct fb_info *info)
 
 	dprintk("map_video_memory(fbi=%p) map_size %u\n", fbi, map_size);
 
-	info->screen_base = dma_alloc_writecombine(fbi->dev, map_size,
-						   &map_dma, GFP_KERNEL);
+	info->screen_base = dma_alloc_wc(fbi->dev, map_size, &map_dma,
+					 GFP_KERNEL);
 
 	if (info->screen_base) {
 		/* prevent initial garbage on screen */
@@ -667,8 +667,8 @@ static inline void s3c2410fb_unmap_video_memory(struct fb_info *info)
 {
 	struct s3c2410fb_info *fbi = info->par;
 
-	dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
-			      info->screen_base, info->fix.smem_start);
+	dma_free_wc(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
+		    info->screen_base, info->fix.smem_start);
 }
 
 static inline void modify_gpio(void __iomem *reg,
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c
index dcf774c15889..fc2aaa5aca23 100644
--- a/drivers/video/fbdev/sa1100fb.c
+++ b/drivers/video/fbdev/sa1100fb.c
@@ -567,8 +567,8 @@ static int sa1100fb_mmap(struct fb_info *info,
 
 	if (off < info->fix.smem_len) {
 		vma->vm_pgoff += 1; /* skip over the palette */
-		return dma_mmap_writecombine(fbi->dev, vma, fbi->map_cpu,
-					     fbi->map_dma, fbi->map_size);
+		return dma_mmap_wc(fbi->dev, vma, fbi->map_cpu, fbi->map_dma,
+				   fbi->map_size);
 	}
 
 	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
@@ -1099,8 +1099,8 @@ static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
 	 * of the framebuffer.
 	 */
 	fbi->map_size = PAGE_ALIGN(fbi->fb.fix.smem_len + PAGE_SIZE);
-	fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size,
-					      &fbi->map_dma, GFP_KERNEL);
+	fbi->map_cpu = dma_alloc_wc(fbi->dev, fbi->map_size, &fbi->map_dma,
+				    GFP_KERNEL);
 
 	if (fbi->map_cpu) {
 		fbi->fb.screen_base = fbi->map_cpu + PAGE_SIZE;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index c0b27ff2c784..65900dc6cc4c 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -643,31 +643,40 @@ static inline void dmam_release_declared_memory(struct device *dev)
 }
 #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
 
-static inline void *dma_alloc_writecombine(struct device *dev, size_t size,
-					   dma_addr_t *dma_addr, gfp_t gfp)
+static inline void *dma_alloc_wc(struct device *dev, size_t size,
+				 dma_addr_t *dma_addr, gfp_t gfp)
 {
 	DEFINE_DMA_ATTRS(attrs);
 	dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
 	return dma_alloc_attrs(dev, size, dma_addr, gfp, &attrs);
 }
+#ifndef dma_alloc_writecombine
+#define dma_alloc_writecombine dma_alloc_wc
+#endif
 
-static inline void dma_free_writecombine(struct device *dev, size_t size,
-					 void *cpu_addr, dma_addr_t dma_addr)
+static inline void dma_free_wc(struct device *dev, size_t size,
+			       void *cpu_addr, dma_addr_t dma_addr)
 {
 	DEFINE_DMA_ATTRS(attrs);
 	dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
 	return dma_free_attrs(dev, size, cpu_addr, dma_addr, &attrs);
 }
+#ifndef dma_free_writecombine
+#define dma_free_writecombine dma_free_wc
+#endif
 
-static inline int dma_mmap_writecombine(struct device *dev,
-					struct vm_area_struct *vma,
-					void *cpu_addr, dma_addr_t dma_addr,
-					size_t size)
+static inline int dma_mmap_wc(struct device *dev,
+			      struct vm_area_struct *vma,
+			      void *cpu_addr, dma_addr_t dma_addr,
+			      size_t size)
 {
 	DEFINE_DMA_ATTRS(attrs);
 	dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs);
 	return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size, &attrs);
 }
+#ifndef dma_mmap_writecombine
+#define dma_mmap_writecombine dma_mmap_wc
+#endif
 
 #ifdef CONFIG_NEED_DMA_MAP_STATE
 #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c
index e9b98af6b52c..e8da3b8ee721 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/arm/pxa2xx-pcm-lib.c
@@ -141,10 +141,8 @@ int pxa2xx_pcm_mmap(struct snd_pcm_substream *substream,
 	struct vm_area_struct *vma)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
-				     runtime->dma_area,
-				     runtime->dma_addr,
-				     runtime->dma_bytes);
+	return dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
+			   runtime->dma_addr, runtime->dma_bytes);
 }
 EXPORT_SYMBOL(pxa2xx_pcm_mmap);
 
@@ -156,8 +154,7 @@ int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 	buf->dev.type = SNDRV_DMA_TYPE_DEV;
 	buf->dev.dev = pcm->card->dev;
 	buf->private_data = NULL;
-	buf->area = dma_alloc_writecombine(pcm->card->dev, size,
-					   &buf->addr, GFP_KERNEL);
+	buf->area = dma_alloc_wc(pcm->card->dev, size, &buf->addr, GFP_KERNEL);
 	if (!buf->area)
 		return -ENOMEM;
 	buf->bytes = size;
@@ -178,8 +175,7 @@ void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
 		buf = &substream->dma_buffer;
 		if (!buf->area)
 			continue;
-		dma_free_writecombine(pcm->card->dev, buf->bytes,
-				      buf->area, buf->addr);
+		dma_free_wc(pcm->card->dev, buf->bytes, buf->area, buf->addr);
 		buf->area = NULL;
 	}
 }
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 49d7513f429e..e63cd5ecfd8f 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -217,8 +217,8 @@ static int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	int ret;
 
-	ret = dma_mmap_writecombine(substream->pcm->card->dev, vma,
-		runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
+	ret = dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
+			  runtime->dma_addr, runtime->dma_bytes);
 
 	pr_debug("%s: ret: %d %p %pad 0x%08x\n", __func__, ret,
 			runtime->dma_area,
@@ -247,8 +247,7 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 	buf->dev.type = SNDRV_DMA_TYPE_DEV;
 	buf->dev.dev = pcm->card->dev;
 	buf->private_data = NULL;
-	buf->area = dma_alloc_writecombine(pcm->card->dev, size,
-					   &buf->addr, GFP_KERNEL);
+	buf->area = dma_alloc_wc(pcm->card->dev, size, &buf->addr, GFP_KERNEL);
 	if (!buf->area)
 		return -ENOMEM;
 	buf->bytes = size;
@@ -330,8 +329,7 @@ static void imx_pcm_free(struct snd_pcm *pcm)
 		if (!buf->area)
 			continue;
 
-		dma_free_writecombine(pcm->card->dev, buf->bytes,
-				      buf->area, buf->addr);
+		dma_free_wc(pcm->card->dev, buf->bytes, buf->area, buf->addr);
 		buf->area = NULL;
 	}
 }
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c
index e09326158bc2..2cca055fd806 100644
--- a/sound/soc/nuc900/nuc900-pcm.c
+++ b/sound/soc/nuc900/nuc900-pcm.c
@@ -267,10 +267,8 @@ static int nuc900_dma_mmap(struct snd_pcm_substream *substream,
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
-	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
-					runtime->dma_area,
-					runtime->dma_addr,
-					runtime->dma_bytes);
+	return dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
+			   runtime->dma_addr, runtime->dma_bytes);
 }
 
 static struct snd_pcm_ops nuc900_dma_ops = {
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 6bb623a2a4df..99381a27295b 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -156,10 +156,8 @@ static int omap_pcm_mmap(struct snd_pcm_substream *substream,
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
-	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
-				     runtime->dma_area,
-				     runtime->dma_addr,
-				     runtime->dma_bytes);
+	return dma_mmap_wc(substream->pcm->card->dev, vma, runtime->dma_area,
+			   runtime->dma_addr, runtime->dma_bytes);
 }
 
 static struct snd_pcm_ops omap_pcm_ops = {
@@ -183,8 +181,7 @@ static int omap_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
 	buf->dev.type = SNDRV_DMA_TYPE_DEV;
 	buf->dev.dev = pcm->card->dev;
 	buf->private_data = NULL;
-	buf->area = dma_alloc_writecombine(pcm->card->dev, size,
-					   &buf->addr, GFP_KERNEL);
+	buf->area = dma_alloc_wc(pcm->card->dev, size, &buf->addr, GFP_KERNEL);
 	if (!buf->area)
 		return -ENOMEM;
 
@@ -207,8 +204,7 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm)
 		if (!buf->area)
 			continue;
 
-		dma_free_writecombine(pcm->card->dev, buf->bytes,
-				      buf->area, buf->addr);
+		dma_free_wc(pcm->card->dev, buf->bytes, buf->area, buf->addr);
 		buf->area = NULL;
 	}
 }
-- 
2.7.0


^ permalink raw reply related

* Re: [PATCH] staging: sm750fb: cleanup: fix brace placement
From: Charles Rose @ 2016-01-22 18:45 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1453246935-5037-1-git-send-email-charles.rose.linux@gmail.com>

On 01/19/2016 06:42 PM, Charles Rose wrote:
> Fix brace placement warnings caught by checkpatch.pl.
>
> Signed-off-by: Charles Rose <charles.rose.linux@gmail.com>
> ---
>   drivers/staging/sm750fb/sm750_cursor.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
> index 3b7ce92..cab891c 100644
> --- a/drivers/staging/sm750fb/sm750_cursor.c
> +++ b/drivers/staging/sm750fb/sm750_cursor.c
> @@ -143,8 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
>   		iowrite16(data, pbuffer);
>
>   		/* assume pitch is 1,2,4,8,...*/
> -		if ((i+1) % pitch = 0)
> -		{
> +		if ((i+1) % pitch = 0) {
>   			/* need a return */
>   			pstart += offset;
>   			pbuffer = pstart;
>

Missed copying Greg KH on this.

Thanks,
Charles

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Daniel Stone @ 2016-01-22  8:34 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Linux Fbdev development list, Alexey Brodkin, Carlos Palminha,
	dri-devel, Tomi Valkeinen, Laurent Pinchart
In-Reply-To: <CAKMK7uFxPvZhAio59yqbQLv_JPBPeRkmF6bnknc3Gh1mA=9LiA@mail.gmail.com>

Hey,

On 22 January 2016 at 07:41, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Thu, Jan 21, 2016 at 7:09 PM, Carlos Palminha
> <CARLOS.PALMINHA@synopsys.com> wrote:
>> i made some progress in identifying the issue...
>> When my driver calls drm_fb_helper_initial_config it seems DRM blocks waiting for register_framebuffer to return.
>> The sequence is drm_fb_helper_initial_config->drm_fb_helper_single_fb_probe->register_framebuffer.
>>
>> Its strange because register_framebuffer function is just a mutex around do_register_framebuffer.
>>
>> Any clue?!
>
> Ah, the curse of console_lock. drm_fb_helper_initial_config also does
> the initial modeset if you have fbcon enabled. But because of locking
> stupidity we must do _all_ that code (which means pretty much your
> entire driver) under the console_lock, which means no log output until
> console_unlock. Not even on serial port.
>
> https://patchwork.freedesktop.org/patch/57951/ is the usual hack to
> use to get rid of console_lock while booting, so that you can see
> where your driver crashes. I guess we should explain this in the
> kerneldoc ...

Didn't spot this at the time, but that should probably quash the
WARN_ON_CONSOLE_UNLOCKED warnings as well ...

Cheers,
Dan

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver in ARC... waiting for console_lock to return
From: Daniel Stone @ 2016-01-22  8:32 UTC (permalink / raw)
  To: Carlos Palminha
  Cc: linux-fbdev, Vineet Gupta, Alexey Brodkin, dri-devel,
	Tomi Valkeinen, Laurent Pinchart,
	linux-snps-arc@lists.infradead.org
In-Reply-To: <56A123CD.1060706@synopsys.com>

Hi,

On 21 January 2016 at 18:30, Carlos Palminha
<CARLOS.PALMINHA@synopsys.com> wrote:
> i just found that its blocking waiting for console_lock...
> @vineet, alexey: i think that console_lock is architecture dependent right? Do you know any issue with console_lock for ARC?

Once console_lock is acquired, you will not see any further prints
whilst it is held. Likely your driver is hanging/crashing whilst
holding console_lock, which you don't see. See the patch just sent to
the list to document how to debug issues which happen under
console_lock.

Cheers,
Daniel

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Daniel Vetter @ 2016-01-22  7:41 UTC (permalink / raw)
  To: Carlos Palminha
  Cc: Linux Fbdev development list, Alexey Brodkin, dri-devel,
	Tomi Valkeinen, Laurent Pinchart
In-Reply-To: <56A11EF1.3070004@synopsys.com>

On Thu, Jan 21, 2016 at 7:09 PM, Carlos Palminha
<CARLOS.PALMINHA@synopsys.com> wrote:
> i made some progress in identifying the issue...
> When my driver calls drm_fb_helper_initial_config it seems DRM blocks waiting for register_framebuffer to return.
> The sequence is drm_fb_helper_initial_config->drm_fb_helper_single_fb_probe->register_framebuffer.
>
> Its strange because register_framebuffer function is just a mutex around do_register_framebuffer.
>
> Any clue?!

Ah, the curse of console_lock. drm_fb_helper_initial_config also does
the initial modeset if you have fbcon enabled. But because of locking
stupidity we must do _all_ that code (which means pretty much your
entire driver) under the console_lock, which means no log output until
console_unlock. Not even on serial port.

https://patchwork.freedesktop.org/patch/57951/ is the usual hack to
use to get rid of console_lock while booting, so that you can see
where your driver crashes. I guess we should explain this in the
kerneldoc ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply

* Whats missing in my new FB DRM driver in ARC... waiting for console_lock to return
From: Carlos Palminha @ 2016-01-21 18:30 UTC (permalink / raw)
  To: Xinliang Liu, Carlos Palminha, Alexey Brodkin, Vineet Gupta
  Cc: linux-snps-arc@lists.infradead.org, linux-fbdev, tomi.valkeinen,
	laurent.pinchart, dri-devel
In-Reply-To: <56A11EF1.3070004@synopsys.com>

hi...

i just found that its blocking waiting for console_lock...
@vineet, alexey: i think that console_lock is architecture dependent right? Do you know any issue with console_lock for ARC?

On 21-01-2016 18:09, Carlos Palminha wrote:
> i made some progress in identifying the issue...
> When my driver calls drm_fb_helper_initial_config it seems DRM blocks waiting for register_framebuffer to return.
> The sequence is drm_fb_helper_initial_config->drm_fb_helper_single_fb_probe->register_framebuffer.
> 
> Its strange because register_framebuffer function is just a mutex around do_register_framebuffer.
> 
> Any clue?!
> 
> On 20-01-2016 01:24, Xinliang Liu wrote:
>> On 20 January 2016 at 00:52, Carlos Palminha
>> <CARLOS.PALMINHA@synopsys.com> wrote:
>>> when i boot the kernel and connect the HDMI cable after booting i can retrieve 4 modes... :)
>>>
>>> if i boot linux with the HDMI cable inserted the kernel hangs.
>>
>> What's the hang kernel log. Is it a oops?
>>
>>> Possible relation with HPD?
>>
>> Yes,  I think there might be something wrong with the HPD interrupt or
>> the EDID ready interrupt.
>> I do meet the similar issue before when I using the upstream adv7511
>> driver to enable adv7533.
>> I found that the HPD and EDID interrupt is not reliable.
>> In order to get modes stably, I have to add some delay like bellow:
>> --
>> --- a/drivers/gpu/drm/i2c/adv7511.c
>> +++ b/drivers/gpu/drm/i2c/adv7511.c
>> @@ -657,6 +657,8 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
>>                 regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
>>                                    ADV7511_POWER_POWER_DOWN, 0);
>>                 adv7511->current_edid_segment = -1;
>> +               /* wait some time for edid is ready */
>> +               msleep(200);
>>         }
>>
>>         edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511);
>> --
>>
>> Best,
>> -xinliang
>>
>>>
>>> Regards,
>>> C.Palminha
>>>
>>> # modetest -M drm-arcpgu -c
>>> Connectors:
>>> id      encoder status          type    size (mm)       modes   encoders
>>> 21      0       connected       HDMI-A  0x0             4       20
>>>   modes:
>>>         name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
>>>   800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
>>>   800x600 56 800 824 896 1024 600 601 603 625 flags: phsync, pvsync; type: driver
>>>   848x480 60 848 864 976 1088 480 486 494 517 flags: phsync, pvsync; type: driver
>>>   640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
>>>   props:
>>>         1 EDID:
>>>                 flags: immutable blob
>>>                 blobs:
>>>
>>>                 value:
>>>         2 DPMS:
>>>                 flags: enum
>>>                 enums: On=0 Standby=1 Suspend=2 Off=3
>>>                 value: 0
>>>
>>> #
>>>
>>> On 19-01-2016 16:03, Carlos Palminha wrote:
>>>> Hi Xiang,
>>>>
>>>> Its returning 0 modes... :(
>>>>
>>>> Regards,
>>>> C.Palminha
>>>>
>>>> # modetest -M drm-arcpgu -c
>>>> Connectors:
>>>> id      encoder status          type    size (mm)       modes   encoders
>>>> 21      0       disconnected    HDMI-A  0x0             0       20
>>>>   props:
>>>>         1 EDID:
>>>>                 flags: immutable blob
>>>>                 blobs:
>>>>
>>>>                 value:
>>>>         2 DPMS:
>>>>                 flags: enum
>>>>                 enums: On=0 Standby=1 Suspend=2 Off=3
>>>>                 value: 0
>>>>
>>>> #
>>>>
>>>> On 19-01-2016 03:38, Xinliang Liu wrote:
>>>>> On 18 January 2016 at 22:45, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
>>>>> wrote:
>>>>>
>>>>>> I'm also getting a message from DRM saying can't find any crtc or
>>>>>> sizes...i'm really missing something here.
>>>>>> :(
>>>>>>
>>>>>> -- log --
>>>>>> [drm] Initialized drm 1.1.0 20060810
>>>>>> drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>>> [drm] Cannot find any crtc or sizes - going 1024x768
>>>>>> Console: switching to colour frame buffer device 128x48
>>>>>> drm-arcpgu e0017000.pgu: fb0: frame buffer device
>>>>>> [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>>> -- log ---
>>>>>>
>>>>>> Any help?
>>>>>>
>>>>>> Regards,
>>>>>> C.Palminha
>>>>>>
>>>>>>
>>>>>> On 18-01-2016 14:32, Carlos Palminha wrote:
>>>>>>> Hi Xinliang,
>>>>>>>
>>>>>>> My get_modes seems to be implemented as the rcar driver...
>>>>>>> Probably still missing some init step?
>>>>>>>
>>>>>>> Regards,
>>>>>>> C.Palminha
>>>>>>>
>>>>>>>
>>>>>>> static int arcpgu_drm_connector_get_modes(struct drm_connector
>>>>>> *connector)
>>>>>>> {
>>>>>>> struct drm_encoder_slave *slave;
>>>>>>> const struct drm_encoder_slave_funcs *sfuncs;
>>>>>>> struct arcpgu_drm_connector * con >>>>>>> container_of(connector, struct arcpgu_drm_connector, connector);
>>>>>>>
>>>>>>> slave = con->encoder_slave;
>>>>>>> if(slave = NULL) {
>>>>>>> dev_err(connector->dev->dev,
>>>>>>> "connector_get_modes: cannot find slave encoder for connector\n");
>>>>>>> return 0;
>>>>>>> }
>>>>>>>
>>>>>>> sfuncs = slave->slave_funcs;
>>>>>>> if(sfuncs->get_modes = NULL){
>>>>>>> return 0;
>>>>>>> }
>>>>>>>
>>>>>>> return sfuncs->
>>>>>>
>>>>>> get_modes(&slave->base,connector);
>>>>>>> }
>>>>>>>
>>>>>>
>>>>>
>>>>> so, this will call adv7511 driver's
>>>>>
>>>>> get_modes call back.
>>>>> I wonder if the system boot up, it can get modes or not.
>>>>> You can test it with the modetest. i.e. $ modetest -M DRM_DRIVER_NAME -c
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>> On 31-12-2015 02:19, Xinliang Liu wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> On 31 December 2015 at 02:46, Carlos Palminha
>>>>>>>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>>
>>>>>> wrote:
>>>>>>>>
>>>>>>>>     Hi guys,
>>>>>>>>
>>>>>>>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>>>>>>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>>>>>>>     by Laurent in "anatomy of an embedded KMS driver":
>>>>>>>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>>>>>>>
>>>>>>>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>>>>>>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>>>>>>>
>>>>>>>>     When booting i'm getting an error message saying "No connectors
>>>>>>>>     reported connected with modes", but the driver init is ok and i can
>>>>>>>>     find the /dev/dri/* and /dev/fb0 devices.
>>>>>>>>
>>>>>>>>     Any clue what i might be missing during the driver load?
>>>>>>>>
>>>>>>>>
>>>>>>>> I think you should check on the 'get_modes' call back of adv7511
>>>>>>>> driver. (Or, if possible show us the code.)
>>>>>>>>
>>>>>>>> Best,
>>>>>>>> -xinliang
>>>>>>>>
>>>>>>>>
>>>>>>>>     Thanks...
>>>>>>>>
>>>>>>>>     Regards,
>>>>>>>>     C.Palminha
>>>>>>>>
>>>>>>>>     --- boot log snippet ---
>>>>>>>>     [drm] Initialized drm 1.1.0 20060810
>>>>>>>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>>>>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>>>>>>>     Console: switching to colour frame buffer device 128x48
>>>>>>>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>>>>>>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>>>>>     --- boot log snippet ---
>>>>>>>>     --
>>>>>>>>     To unsubscribe from this list: send the line "unsubscribe
>>>>>>>>     linux-fbdev" in
>>>>>>>>     the body of a message to majordomo@vger.kernel.org
>>>>>>>>     <mailto:majordomo@vger.kernel.org>
>>>>>>>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Carlos Palminha @ 2016-01-21 18:09 UTC (permalink / raw)
  To: Xinliang Liu, Carlos Palminha
  Cc: linux-fbdev, tomi.valkeinen, Alexey Brodkin, laurent.pinchart,
	dri-devel
In-Reply-To: <CAGd==04VMKUvb6hZkeNw3kAQt04y0d_Ry7oCtC8=2SWcfWG25A@mail.gmail.com>

i made some progress in identifying the issue...
When my driver calls drm_fb_helper_initial_config it seems DRM blocks waiting for register_framebuffer to return.
The sequence is drm_fb_helper_initial_config->drm_fb_helper_single_fb_probe->register_framebuffer.

Its strange because register_framebuffer function is just a mutex around do_register_framebuffer.

Any clue?!

On 20-01-2016 01:24, Xinliang Liu wrote:
> On 20 January 2016 at 00:52, Carlos Palminha
> <CARLOS.PALMINHA@synopsys.com> wrote:
>> when i boot the kernel and connect the HDMI cable after booting i can retrieve 4 modes... :)
>>
>> if i boot linux with the HDMI cable inserted the kernel hangs.
> 
> What's the hang kernel log. Is it a oops?
> 
>> Possible relation with HPD?
> 
> Yes,  I think there might be something wrong with the HPD interrupt or
> the EDID ready interrupt.
> I do meet the similar issue before when I using the upstream adv7511
> driver to enable adv7533.
> I found that the HPD and EDID interrupt is not reliable.
> In order to get modes stably, I have to add some delay like bellow:
> --
> --- a/drivers/gpu/drm/i2c/adv7511.c
> +++ b/drivers/gpu/drm/i2c/adv7511.c
> @@ -657,6 +657,8 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
>                 regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
>                                    ADV7511_POWER_POWER_DOWN, 0);
>                 adv7511->current_edid_segment = -1;
> +               /* wait some time for edid is ready */
> +               msleep(200);
>         }
> 
>         edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511);
> --
> 
> Best,
> -xinliang
> 
>>
>> Regards,
>> C.Palminha
>>
>> # modetest -M drm-arcpgu -c
>> Connectors:
>> id      encoder status          type    size (mm)       modes   encoders
>> 21      0       connected       HDMI-A  0x0             4       20
>>   modes:
>>         name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
>>   800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
>>   800x600 56 800 824 896 1024 600 601 603 625 flags: phsync, pvsync; type: driver
>>   848x480 60 848 864 976 1088 480 486 494 517 flags: phsync, pvsync; type: driver
>>   640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
>>   props:
>>         1 EDID:
>>                 flags: immutable blob
>>                 blobs:
>>
>>                 value:
>>         2 DPMS:
>>                 flags: enum
>>                 enums: On=0 Standby=1 Suspend=2 Off=3
>>                 value: 0
>>
>> #
>>
>> On 19-01-2016 16:03, Carlos Palminha wrote:
>>> Hi Xiang,
>>>
>>> Its returning 0 modes... :(
>>>
>>> Regards,
>>> C.Palminha
>>>
>>> # modetest -M drm-arcpgu -c
>>> Connectors:
>>> id      encoder status          type    size (mm)       modes   encoders
>>> 21      0       disconnected    HDMI-A  0x0             0       20
>>>   props:
>>>         1 EDID:
>>>                 flags: immutable blob
>>>                 blobs:
>>>
>>>                 value:
>>>         2 DPMS:
>>>                 flags: enum
>>>                 enums: On=0 Standby=1 Suspend=2 Off=3
>>>                 value: 0
>>>
>>> #
>>>
>>> On 19-01-2016 03:38, Xinliang Liu wrote:
>>>> On 18 January 2016 at 22:45, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
>>>> wrote:
>>>>
>>>>> I'm also getting a message from DRM saying can't find any crtc or
>>>>> sizes...i'm really missing something here.
>>>>> :(
>>>>>
>>>>> -- log --
>>>>> [drm] Initialized drm 1.1.0 20060810
>>>>> drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>> [drm] Cannot find any crtc or sizes - going 1024x768
>>>>> Console: switching to colour frame buffer device 128x48
>>>>> drm-arcpgu e0017000.pgu: fb0: frame buffer device
>>>>> [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>> -- log ---
>>>>>
>>>>> Any help?
>>>>>
>>>>> Regards,
>>>>> C.Palminha
>>>>>
>>>>>
>>>>> On 18-01-2016 14:32, Carlos Palminha wrote:
>>>>>> Hi Xinliang,
>>>>>>
>>>>>> My get_modes seems to be implemented as the rcar driver...
>>>>>> Probably still missing some init step?
>>>>>>
>>>>>> Regards,
>>>>>> C.Palminha
>>>>>>
>>>>>>
>>>>>> static int arcpgu_drm_connector_get_modes(struct drm_connector
>>>>> *connector)
>>>>>> {
>>>>>> struct drm_encoder_slave *slave;
>>>>>> const struct drm_encoder_slave_funcs *sfuncs;
>>>>>> struct arcpgu_drm_connector * con >>>>>> container_of(connector, struct arcpgu_drm_connector, connector);
>>>>>>
>>>>>> slave = con->encoder_slave;
>>>>>> if(slave = NULL) {
>>>>>> dev_err(connector->dev->dev,
>>>>>> "connector_get_modes: cannot find slave encoder for connector\n");
>>>>>> return 0;
>>>>>> }
>>>>>>
>>>>>> sfuncs = slave->slave_funcs;
>>>>>> if(sfuncs->get_modes = NULL){
>>>>>> return 0;
>>>>>> }
>>>>>>
>>>>>> return sfuncs->
>>>>>
>>>>> get_modes(&slave->base,connector);
>>>>>> }
>>>>>>
>>>>>
>>>>
>>>> so, this will call adv7511 driver's
>>>>
>>>> get_modes call back.
>>>> I wonder if the system boot up, it can get modes or not.
>>>> You can test it with the modetest. i.e. $ modetest -M DRM_DRIVER_NAME -c
>>>>
>>>>
>>>>
>>>>
>>>>>> On 31-12-2015 02:19, Xinliang Liu wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 31 December 2015 at 02:46, Carlos Palminha
>>>>>>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>>
>>>>> wrote:
>>>>>>>
>>>>>>>     Hi guys,
>>>>>>>
>>>>>>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>>>>>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>>>>>>     by Laurent in "anatomy of an embedded KMS driver":
>>>>>>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>>>>>>
>>>>>>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>>>>>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>>>>>>
>>>>>>>     When booting i'm getting an error message saying "No connectors
>>>>>>>     reported connected with modes", but the driver init is ok and i can
>>>>>>>     find the /dev/dri/* and /dev/fb0 devices.
>>>>>>>
>>>>>>>     Any clue what i might be missing during the driver load?
>>>>>>>
>>>>>>>
>>>>>>> I think you should check on the 'get_modes' call back of adv7511
>>>>>>> driver. (Or, if possible show us the code.)
>>>>>>>
>>>>>>> Best,
>>>>>>> -xinliang
>>>>>>>
>>>>>>>
>>>>>>>     Thanks...
>>>>>>>
>>>>>>>     Regards,
>>>>>>>     C.Palminha
>>>>>>>
>>>>>>>     --- boot log snippet ---
>>>>>>>     [drm] Initialized drm 1.1.0 20060810
>>>>>>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>>>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>>>>>>     Console: switching to colour frame buffer device 128x48
>>>>>>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>>>>>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>>>>     --- boot log snippet ---
>>>>>>>     --
>>>>>>>     To unsubscribe from this list: send the line "unsubscribe
>>>>>>>     linux-fbdev" in
>>>>>>>     the body of a message to majordomo@vger.kernel.org
>>>>>>>     <mailto:majordomo@vger.kernel.org>
>>>>>>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>>>>
>>>>>>>
>>>>>
>>>>

^ permalink raw reply

* Kill ->fb_rotate?
From: Rasmus Villemoes @ 2016-01-20 21:16 UTC (permalink / raw)
  To: linux-fbdev

Hi,

it seems that the fb_rotate method in struct fb_ops is never actually
invoked, and it's been that way in the entire history of git (in fact,
the last occurrence of the string '->fb_rotate' vanished over 10 years
ago, with b4d8aea6d6). Is there any reason not to nuke the few dozen
lines of dead code in the few drivers that actually implement it and
reduce sizeof(struct fb_ops) by sizeof(void*)?

Rasmus

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Xinliang Liu @ 2016-01-20  1:24 UTC (permalink / raw)
  To: Carlos Palminha
  Cc: linux-fbdev, tomi.valkeinen, Alexey Brodkin, laurent.pinchart,
	dri-devel
In-Reply-To: <569E69EB.3010003@synopsys.com>

On 20 January 2016 at 00:52, Carlos Palminha
<CARLOS.PALMINHA@synopsys.com> wrote:
> when i boot the kernel and connect the HDMI cable after booting i can retrieve 4 modes... :)
>
> if i boot linux with the HDMI cable inserted the kernel hangs.

What's the hang kernel log. Is it a oops?

> Possible relation with HPD?

Yes,  I think there might be something wrong with the HPD interrupt or
the EDID ready interrupt.
I do meet the similar issue before when I using the upstream adv7511
driver to enable adv7533.
I found that the HPD and EDID interrupt is not reliable.
In order to get modes stably, I have to add some delay like bellow:
--
--- a/drivers/gpu/drm/i2c/adv7511.c
+++ b/drivers/gpu/drm/i2c/adv7511.c
@@ -657,6 +657,8 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
                regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
                                   ADV7511_POWER_POWER_DOWN, 0);
                adv7511->current_edid_segment = -1;
+               /* wait some time for edid is ready */
+               msleep(200);
        }

        edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511);
--

Best,
-xinliang

>
> Regards,
> C.Palminha
>
> # modetest -M drm-arcpgu -c
> Connectors:
> id      encoder status          type    size (mm)       modes   encoders
> 21      0       connected       HDMI-A  0x0             4       20
>   modes:
>         name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
>   800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
>   800x600 56 800 824 896 1024 600 601 603 625 flags: phsync, pvsync; type: driver
>   848x480 60 848 864 976 1088 480 486 494 517 flags: phsync, pvsync; type: driver
>   640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
>   props:
>         1 EDID:
>                 flags: immutable blob
>                 blobs:
>
>                 value:
>         2 DPMS:
>                 flags: enum
>                 enums: On=0 Standby=1 Suspend=2 Off=3
>                 value: 0
>
> #
>
> On 19-01-2016 16:03, Carlos Palminha wrote:
>> Hi Xiang,
>>
>> Its returning 0 modes... :(
>>
>> Regards,
>> C.Palminha
>>
>> # modetest -M drm-arcpgu -c
>> Connectors:
>> id      encoder status          type    size (mm)       modes   encoders
>> 21      0       disconnected    HDMI-A  0x0             0       20
>>   props:
>>         1 EDID:
>>                 flags: immutable blob
>>                 blobs:
>>
>>                 value:
>>         2 DPMS:
>>                 flags: enum
>>                 enums: On=0 Standby=1 Suspend=2 Off=3
>>                 value: 0
>>
>> #
>>
>> On 19-01-2016 03:38, Xinliang Liu wrote:
>>> On 18 January 2016 at 22:45, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
>>> wrote:
>>>
>>>> I'm also getting a message from DRM saying can't find any crtc or
>>>> sizes...i'm really missing something here.
>>>> :(
>>>>
>>>> -- log --
>>>> [drm] Initialized drm 1.1.0 20060810
>>>> drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>> [drm] Cannot find any crtc or sizes - going 1024x768
>>>> Console: switching to colour frame buffer device 128x48
>>>> drm-arcpgu e0017000.pgu: fb0: frame buffer device
>>>> [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>> -- log ---
>>>>
>>>> Any help?
>>>>
>>>> Regards,
>>>> C.Palminha
>>>>
>>>>
>>>> On 18-01-2016 14:32, Carlos Palminha wrote:
>>>>> Hi Xinliang,
>>>>>
>>>>> My get_modes seems to be implemented as the rcar driver...
>>>>> Probably still missing some init step?
>>>>>
>>>>> Regards,
>>>>> C.Palminha
>>>>>
>>>>>
>>>>> static int arcpgu_drm_connector_get_modes(struct drm_connector
>>>> *connector)
>>>>> {
>>>>> struct drm_encoder_slave *slave;
>>>>> const struct drm_encoder_slave_funcs *sfuncs;
>>>>> struct arcpgu_drm_connector * con >>>>> container_of(connector, struct arcpgu_drm_connector, connector);
>>>>>
>>>>> slave = con->encoder_slave;
>>>>> if(slave = NULL) {
>>>>> dev_err(connector->dev->dev,
>>>>> "connector_get_modes: cannot find slave encoder for connector\n");
>>>>> return 0;
>>>>> }
>>>>>
>>>>> sfuncs = slave->slave_funcs;
>>>>> if(sfuncs->get_modes = NULL){
>>>>> return 0;
>>>>> }
>>>>>
>>>>> return sfuncs->
>>>>
>>>> get_modes(&slave->base,connector);
>>>>> }
>>>>>
>>>>
>>>
>>> so, this will call adv7511 driver's
>>>
>>> get_modes call back.
>>> I wonder if the system boot up, it can get modes or not.
>>> You can test it with the modetest. i.e. $ modetest -M DRM_DRIVER_NAME -c
>>>
>>>
>>>
>>>
>>>>> On 31-12-2015 02:19, Xinliang Liu wrote:
>>>>>>
>>>>>>
>>>>>> On 31 December 2015 at 02:46, Carlos Palminha
>>>>>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>>
>>>> wrote:
>>>>>>
>>>>>>     Hi guys,
>>>>>>
>>>>>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>>>>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>>>>>     by Laurent in "anatomy of an embedded KMS driver":
>>>>>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>>>>>
>>>>>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>>>>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>>>>>
>>>>>>     When booting i'm getting an error message saying "No connectors
>>>>>>     reported connected with modes", but the driver init is ok and i can
>>>>>>     find the /dev/dri/* and /dev/fb0 devices.
>>>>>>
>>>>>>     Any clue what i might be missing during the driver load?
>>>>>>
>>>>>>
>>>>>> I think you should check on the 'get_modes' call back of adv7511
>>>>>> driver. (Or, if possible show us the code.)
>>>>>>
>>>>>> Best,
>>>>>> -xinliang
>>>>>>
>>>>>>
>>>>>>     Thanks...
>>>>>>
>>>>>>     Regards,
>>>>>>     C.Palminha
>>>>>>
>>>>>>     --- boot log snippet ---
>>>>>>     [drm] Initialized drm 1.1.0 20060810
>>>>>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>>>>>     Console: switching to colour frame buffer device 128x48
>>>>>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>>>>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>>>     --- boot log snippet ---
>>>>>>     --
>>>>>>     To unsubscribe from this list: send the line "unsubscribe
>>>>>>     linux-fbdev" in
>>>>>>     the body of a message to majordomo@vger.kernel.org
>>>>>>     <mailto:majordomo@vger.kernel.org>
>>>>>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>>>
>>>>>>
>>>>
>>>

^ permalink raw reply

* [PATCH] staging: sm750fb: cleanup: fix brace placement
From: Charles Rose @ 2016-01-19 23:42 UTC (permalink / raw)
  To: linux-fbdev

Fix brace placement warnings caught by checkpatch.pl.

Signed-off-by: Charles Rose <charles.rose.linux@gmail.com>
---
 drivers/staging/sm750fb/sm750_cursor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c
index 3b7ce92..cab891c 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -143,8 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
 		iowrite16(data, pbuffer);
 
 		/* assume pitch is 1,2,4,8,...*/
-		if ((i+1) % pitch = 0)
-		{
+		if ((i+1) % pitch = 0) {
 			/* need a return */
 			pstart += offset;
 			pbuffer = pstart;
-- 
2.5.0


^ permalink raw reply related

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Carlos Palminha @ 2016-01-19 16:52 UTC (permalink / raw)
  To: Xinliang Liu, Carlos Palminha
  Cc: linux-fbdev, tomi.valkeinen, Alexey Brodkin, laurent.pinchart,
	dri-devel
In-Reply-To: <569E5E51.8000303@synopsys.com>

when i boot the kernel and connect the HDMI cable after booting i can retrieve 4 modes... :)

if i boot linux with the HDMI cable inserted the kernel hangs.
Possible relation with HPD?

Regards,
C.Palminha

# modetest -M drm-arcpgu -c
Connectors:
id      encoder status          type    size (mm)       modes   encoders
21      0       connected       HDMI-A  0x0             4       20
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
  800x600 56 800 824 896 1024 600 601 603 625 flags: phsync, pvsync; type: driver
  848x480 60 848 864 976 1088 480 486 494 517 flags: phsync, pvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0

#

On 19-01-2016 16:03, Carlos Palminha wrote:
> Hi Xiang,
> 
> Its returning 0 modes... :(
> 
> Regards,
> C.Palminha
> 
> # modetest -M drm-arcpgu -c
> Connectors:
> id      encoder status          type    size (mm)       modes   encoders
> 21      0       disconnected    HDMI-A  0x0             0       20
>   props:
>         1 EDID:
>                 flags: immutable blob
>                 blobs:
> 
>                 value:
>         2 DPMS:
>                 flags: enum
>                 enums: On=0 Standby=1 Suspend=2 Off=3
>                 value: 0
> 
> #
> 
> On 19-01-2016 03:38, Xinliang Liu wrote:
>> On 18 January 2016 at 22:45, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
>> wrote:
>>
>>> I'm also getting a message from DRM saying can't find any crtc or
>>> sizes...i'm really missing something here.
>>> :(
>>>
>>> -- log --
>>> [drm] Initialized drm 1.1.0 20060810
>>> drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>> [drm] Cannot find any crtc or sizes - going 1024x768
>>> Console: switching to colour frame buffer device 128x48
>>> drm-arcpgu e0017000.pgu: fb0: frame buffer device
>>> [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>> -- log ---
>>>
>>> Any help?
>>>
>>> Regards,
>>> C.Palminha
>>>
>>>
>>> On 18-01-2016 14:32, Carlos Palminha wrote:
>>>> Hi Xinliang,
>>>>
>>>> My get_modes seems to be implemented as the rcar driver...
>>>> Probably still missing some init step?
>>>>
>>>> Regards,
>>>> C.Palminha
>>>>
>>>>
>>>> static int arcpgu_drm_connector_get_modes(struct drm_connector
>>> *connector)
>>>> {
>>>> struct drm_encoder_slave *slave;
>>>> const struct drm_encoder_slave_funcs *sfuncs;
>>>> struct arcpgu_drm_connector * con >>>> container_of(connector, struct arcpgu_drm_connector, connector);
>>>>
>>>> slave = con->encoder_slave;
>>>> if(slave = NULL) {
>>>> dev_err(connector->dev->dev,
>>>> "connector_get_modes: cannot find slave encoder for connector\n");
>>>> return 0;
>>>> }
>>>>
>>>> sfuncs = slave->slave_funcs;
>>>> if(sfuncs->get_modes = NULL){
>>>> return 0;
>>>> }
>>>>
>>>> return sfuncs->
>>> ​​
>>> get_modes(&slave->base,connector);
>>>> }
>>>>
>>>
>>
>> ​so, this will call adv7511 driver's ​
>> ​
>> get_modes call back.
>> I wonder if the system boot up, it can get modes or not.
>> You can test it with the modetest. i.e. $ modetest -M DRM_DRIVER_NAME -c
>>
>>
>>
>>
>>>> On 31-12-2015 02:19, Xinliang Liu wrote:
>>>>>
>>>>>
>>>>> On 31 December 2015 at 02:46, Carlos Palminha
>>>>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>>
>>> wrote:
>>>>>
>>>>>     Hi guys,
>>>>>
>>>>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>>>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>>>>     by Laurent in "anatomy of an embedded KMS driver":
>>>>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>>>>
>>>>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>>>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>>>>
>>>>>     When booting i'm getting an error message saying "No connectors
>>>>>     reported connected with modes", but the driver init is ok and i can
>>>>>     find the /dev/dri/* and /dev/fb0 devices.
>>>>>
>>>>>     Any clue what i might be missing during the driver load?
>>>>>
>>>>>
>>>>> ​I think you should check on the 'get_modes'​ call back of adv7511
>>>>> driver. (Or, if possible show us the code.)
>>>>>
>>>>> Best,
>>>>> -xinliang
>>>>>
>>>>>
>>>>>     Thanks...
>>>>>
>>>>>     Regards,
>>>>>     C.Palminha
>>>>>
>>>>>     --- boot log snippet ---
>>>>>     [drm] Initialized drm 1.1.0 20060810
>>>>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>>>>     Console: switching to colour frame buffer device 128x48
>>>>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>>>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>>     --- boot log snippet ---
>>>>>     --
>>>>>     To unsubscribe from this list: send the line "unsubscribe
>>>>>     linux-fbdev" in
>>>>>     the body of a message to majordomo@vger.kernel.org
>>>>>     <mailto:majordomo@vger.kernel.org>
>>>>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>>
>>>>>
>>>
>>

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Carlos Palminha @ 2016-01-19 16:03 UTC (permalink / raw)
  To: Xinliang Liu, Carlos Palminha
  Cc: linux-fbdev, tomi.valkeinen, Alexey Brodkin, laurent.pinchart,
	dri-devel
In-Reply-To: <CAGd==07ffJAfAtzirALR3OF7f4UDVu_fJbbZ0ZiEa3F5-hLfyw@mail.gmail.com>

Hi Xiang,

Its returning 0 modes... :(

Regards,
C.Palminha

# modetest -M drm-arcpgu -c
Connectors:
id      encoder status          type    size (mm)       modes   encoders
21      0       disconnected    HDMI-A  0x0             0       20
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0

#

On 19-01-2016 03:38, Xinliang Liu wrote:
> On 18 January 2016 at 22:45, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>
> wrote:
> 
>> I'm also getting a message from DRM saying can't find any crtc or
>> sizes...i'm really missing something here.
>> :(
>>
>> -- log --
>> [drm] Initialized drm 1.1.0 20060810
>> drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>> [drm] Cannot find any crtc or sizes - going 1024x768
>> Console: switching to colour frame buffer device 128x48
>> drm-arcpgu e0017000.pgu: fb0: frame buffer device
>> [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>> -- log ---
>>
>> Any help?
>>
>> Regards,
>> C.Palminha
>>
>>
>> On 18-01-2016 14:32, Carlos Palminha wrote:
>>> Hi Xinliang,
>>>
>>> My get_modes seems to be implemented as the rcar driver...
>>> Probably still missing some init step?
>>>
>>> Regards,
>>> C.Palminha
>>>
>>>
>>> static int arcpgu_drm_connector_get_modes(struct drm_connector
>> *connector)
>>> {
>>> struct drm_encoder_slave *slave;
>>> const struct drm_encoder_slave_funcs *sfuncs;
>>> struct arcpgu_drm_connector * con >>> container_of(connector, struct arcpgu_drm_connector, connector);
>>>
>>> slave = con->encoder_slave;
>>> if(slave = NULL) {
>>> dev_err(connector->dev->dev,
>>> "connector_get_modes: cannot find slave encoder for connector\n");
>>> return 0;
>>> }
>>>
>>> sfuncs = slave->slave_funcs;
>>> if(sfuncs->get_modes = NULL){
>>> return 0;
>>> }
>>>
>>> return sfuncs->
>> ​​
>> get_modes(&slave->base,connector);
>>> }
>>>
>>
> 
> ​so, this will call adv7511 driver's ​
> ​
> get_modes call back.
> I wonder if the system boot up, it can get modes or not.
> You can test it with the modetest. i.e. $ modetest -M DRM_DRIVER_NAME -c
> 
> 
> 
> 
>>> On 31-12-2015 02:19, Xinliang Liu wrote:
>>>>
>>>>
>>>> On 31 December 2015 at 02:46, Carlos Palminha
>>>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>>
>> wrote:
>>>>
>>>>     Hi guys,
>>>>
>>>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>>>     by Laurent in "anatomy of an embedded KMS driver":
>>>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>>>
>>>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>>>
>>>>     When booting i'm getting an error message saying "No connectors
>>>>     reported connected with modes", but the driver init is ok and i can
>>>>     find the /dev/dri/* and /dev/fb0 devices.
>>>>
>>>>     Any clue what i might be missing during the driver load?
>>>>
>>>>
>>>> ​I think you should check on the 'get_modes'​ call back of adv7511
>>>> driver. (Or, if possible show us the code.)
>>>>
>>>> Best,
>>>> -xinliang
>>>>
>>>>
>>>>     Thanks...
>>>>
>>>>     Regards,
>>>>     C.Palminha
>>>>
>>>>     --- boot log snippet ---
>>>>     [drm] Initialized drm 1.1.0 20060810
>>>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>>>     Console: switching to colour frame buffer device 128x48
>>>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>>>     --- boot log snippet ---
>>>>     --
>>>>     To unsubscribe from this list: send the line "unsubscribe
>>>>     linux-fbdev" in
>>>>     the body of a message to majordomo@vger.kernel.org
>>>>     <mailto:majordomo@vger.kernel.org>
>>>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>
>>>>
>>
> 

^ permalink raw reply

* [PATCH] video: fbdev: imxfb: Provide a reset mechanism
From: Fabio Estevam @ 2016-01-19 13:10 UTC (permalink / raw)
  To: linux-fbdev

From: Fabio Estevam <fabio.estevam@nxp.com>

Currently when we boot the kernel on a mx25pdk the LCDC controller
does not show the Linux logo on boot.

This problem is well explained by Sascha Hauer:

"Unfortunately this LCD controller does not have an enable bit. The
controller starts directly when the clocks are enabled. If the clocks
are enabled when the controller is not yet programmed with proper
register values then it just goes into some undefined state. What I
suspect is that the clocks already were enabled before driver probe,
presumably by the bootloader, so the controller is already in undefined
state when entering Linux. Now by dis/enabling the ipg clock you
effectively reset the controller. Since you have programmed it with
valid register values in the mean time it starts working after this
reset."

So do as suggested and force a reset of the LCDC hardware by 
enabling and disabling the IPG clock.

With this change the Linux logo can be seen on boot on a mx25pdk.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/video/fbdev/imxfb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index cee8860..bb2f1e8 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -902,6 +902,21 @@ static int imxfb_probe(struct platform_device *pdev)
 		goto failed_getclock;
 	}
 
+	/*
+	 * The LCDC controller does not have an enable bit. The
+	 * controller starts directly when the clocks are enabled.
+	 * If the clocks are enabled when the controller is not yet
+	 * programmed with proper register values (enabled at the
+	 * bootloader, for example) then it just goes into some undefined
+	 * state.
+	 * To avoid this issue, let's enable and disable LCDC IPG clock
+	 * so that we force some kind of 'reset' to the LCDC block.
+	 */
+	ret = clk_prepare_enable(fbi->clk_ipg);
+	if (ret)
+		goto failed_getclock;
+	clk_disable_unprepare(fbi->clk_ipg);
+
 	fbi->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
 	if (IS_ERR(fbi->clk_ahb)) {
 		ret = PTR_ERR(fbi->clk_ahb);
-- 
1.9.1


^ permalink raw reply related

* Re: [PATCH v4 10/11] dma: rename dma_*_writecombine() to dma_*_wc()
From: Ingo Molnar @ 2016-01-19 11:13 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Julia Lawall, Andrew Morton, David Howells, Borislav Petkov,
	Bjorn Helgaas, Tomi Valkeinen, Dave Airlie, linux-fbdev,
	Andy Lutomirski, vinod.koul, Dan Williams, Toshi Kani,
	Benjamin Herrenschmidt, Michael S. Tsirkin, Daniel Vetter,
	Konrad Rzeszutek Wilk, X86 ML, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, xen-devel@lists.xensource.com
In-Reply-To: <CAB=NE6UucJOwy3O58Oydoy_yR_05k0ebbBXpFVcNWM_g6ez-aA@mail.gmail.com>


* Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:

> On Tue, Aug 25, 2015 at 9:21 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> >> > There's a catch-22 issue here either way, for instance this rename patch has
> >> > been being baked for probably 2 releases already but the difficulty has been
> >> > trying to find the appropriate time to merge it without conflict.
> >> >
> >> > If you do it in the beginning of the merge window, you have to ask yourself in
> >> > what tree it will be done. Since subsystems are topic specific that means that
> >> > subsystem will end up having a conflict at the end of the merge window.
> >>
> >> Yes it's a special case.  I think the best way of handling such things is to get
> >> them in to Linus either right at the end of the merge window or the day after he
> >> releases -rc1.  This is when most people's trees are mostly empty.
> >
> > Yes, that was the plan last time around as well - but the end of the merge window
> > is when we have the least maintainer bandwidth as well ...
> >
> > Anyway, I applied most of the patches (sans the rename), so the rename patch
> > should be a lot simpler to execute at the right moment this time around.
> 
> Ingo, should we try this again some time? I have some ideas on how to
> make these sorts of changes easier to manage in the future, it
> involves having an automatic git rebase option to use Coccinelle for
> you if a patch is annotated to have been completely done with
> Coccinelle, but future tooling is needed for that [0]. In the meantime
> I (or you) can simply run the script at any point in time to catch all
> the names as-is in the kernel / point in time we decide to merge this
> simple rename.
> 
> [0] http://kernelnewbies.org/KernelProjects/linux-oven

So beyond the rename, can we also keep the old names as compatibility helpers, 
with a #define mapping them to the new names?

If so then please (re-)send the changes.

Thanks,

	Ingo

^ permalink raw reply

* Re: [PATCH] fbdev: ssd1307fb: Fix chargepump setting
From: Julian Scheel @ 2016-01-18 20:20 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1447337257-31232-1-git-send-email-julian@jusst.de>

On 15.11.15 14:36, Julian Scheel wrote:
> The charge pump setting must have bit D4 set all time according to the SSD1306
> App Note. Instead of doing an logical and off shifted setting bit with 0x14 it
> must be an logical or with 0x10 to ensure D4 is set.
>
> Signed-off-by: Julian Scheel <julian@jusst.de>
> ---
>   drivers/video/fbdev/ssd1307fb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
> index 1611215..5965a9b 100644
> --- a/drivers/video/fbdev/ssd1307fb.c
> +++ b/drivers/video/fbdev/ssd1307fb.c
> @@ -389,7 +389,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
>   		return ret;
>
>   	ret = ssd1307fb_write_cmd(par->client,
> -		(par->device_info->need_chargepump & 0x1 << 2) & 0x14);
> +		0x10 | ((par->device_info->need_chargepump & 0x01) << 2));
>   	if (ret < 0)
>   		return ret;
>
>

+ Adding Jean-Christophe and Tomi in CC as maintainers and Thomas as the 
one who did last major changes to the driver.

Any objections on this patch?

Regards,
Julian

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Carlos Palminha @ 2016-01-18 14:45 UTC (permalink / raw)
  To: Xinliang Liu, dri-devel; +Cc: linux-fbdev, tomi.valkeinen, laurent.pinchart
In-Reply-To: <569CF78F.7050303@synopsys.com>

I'm also getting a message from DRM saying can't find any crtc or sizes...i'm really missing something here.
:(

-- log --
[drm] Initialized drm 1.1.0 20060810
drm-arcpgu e0017000.pgu: No connectors reported connected with modes
[drm] Cannot find any crtc or sizes - going 1024x768
Console: switching to colour frame buffer device 128x48
drm-arcpgu e0017000.pgu: fb0: frame buffer device
[drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
-- log ---

Any help?

Regards,
C.Palminha


On 18-01-2016 14:32, Carlos Palminha wrote:
> Hi Xinliang,
> 
> My get_modes seems to be implemented as the rcar driver...
> Probably still missing some init step?
> 
> Regards,
> C.Palminha
> 
> 
> static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
> {
> struct drm_encoder_slave *slave;
> const struct drm_encoder_slave_funcs *sfuncs;
> struct arcpgu_drm_connector * con > container_of(connector, struct arcpgu_drm_connector, connector);
> 
> slave = con->encoder_slave;
> if(slave = NULL) {
> dev_err(connector->dev->dev,
> "connector_get_modes: cannot find slave encoder for connector\n");
> return 0;
> }
> 
> sfuncs = slave->slave_funcs;
> if(sfuncs->get_modes = NULL){
> return 0;
> }
> 
> return sfuncs->get_modes(&slave->base,connector);
> }
> 
> On 31-12-2015 02:19, Xinliang Liu wrote:
>>
>>
>> On 31 December 2015 at 02:46, Carlos Palminha
>> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>> wrote:
>>
>>     Hi guys,
>>
>>     I'm writing a DRM driver for a framebuffer embedded hardware that
>>     uses an i2c encoder (adv7511), following the basic steps suggested
>>     by Laurent in "anatomy of an embedded KMS driver":
>>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>>
>>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>>
>>     When booting i'm getting an error message saying "No connectors
>>     reported connected with modes", but the driver init is ok and i can
>>     find the /dev/dri/* and /dev/fb0 devices.
>>
>>     Any clue what i might be missing during the driver load?
>>
>>
>> ​I think you should check on the 'get_modes'​ call back of adv7511
>> driver. (Or, if possible show us the code.)
>>
>> Best,
>> -xinliang
>>
>>
>>     Thanks...
>>
>>     Regards,
>>     C.Palminha
>>
>>     --- boot log snippet ---
>>     [drm] Initialized drm 1.1.0 20060810
>>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>>     [drm] Cannot find any crtc or sizes - going 1024x768
>>     Console: switching to colour frame buffer device 128x48
>>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>>     --- boot log snippet ---
>>     --
>>     To unsubscribe from this list: send the line "unsubscribe
>>     linux-fbdev" in
>>     the body of a message to majordomo@vger.kernel.org
>>     <mailto:majordomo@vger.kernel.org>
>>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>>

^ permalink raw reply

* Re: Whats missing in my new FB DRM driver... "No connectors reported connected with modes"?
From: Carlos Palminha @ 2016-01-18 14:32 UTC (permalink / raw)
  To: Xinliang Liu; +Cc: linux-fbdev, tomi.valkeinen, laurent.pinchart, dri-devel
In-Reply-To: <CAGd==071hzpQKjLU715tc004NN0d8Z01XdLAhg-DBx1FxtWb2w@mail.gmail.com>

Hi Xinliang,

My get_modes seems to be implemented as the rcar driver...
Probably still missing some init step?

Regards,
C.Palminha


static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
{
struct drm_encoder_slave *slave;
const struct drm_encoder_slave_funcs *sfuncs;
struct arcpgu_drm_connector * con container_of(connector, struct arcpgu_drm_connector, connector);

slave = con->encoder_slave;
if(slave = NULL) {
dev_err(connector->dev->dev,
"connector_get_modes: cannot find slave encoder for connector\n");
return 0;
}

sfuncs = slave->slave_funcs;
if(sfuncs->get_modes = NULL){
return 0;
}

return sfuncs->get_modes(&slave->base,connector);
}

On 31-12-2015 02:19, Xinliang Liu wrote:
>
>
> On 31 December 2015 at 02:46, Carlos Palminha
> <CARLOS.PALMINHA@synopsys.com <mailto:CARLOS.PALMINHA@synopsys.com>> wrote:
>
>     Hi guys,
>
>     I'm writing a DRM driver for a framebuffer embedded hardware that
>     uses an i2c encoder (adv7511), following the basic steps suggested
>     by Laurent in "anatomy of an embedded KMS driver":
>     https://www.youtube.com/watch?v=Ja8fM7rTae4
>
>     After initiliazing all kms, crtc, encoder, i2c, connector functions
>     and structures i'm calling drm_fbdev_cma_init to create a fbdev.
>
>     When booting i'm getting an error message saying "No connectors
>     reported connected with modes", but the driver init is ok and i can
>     find the /dev/dri/* and /dev/fb0 devices.
>
>     Any clue what i might be missing during the driver load?
>
>
> ​I think you should check on the 'get_modes'​ call back of adv7511
> driver. (Or, if possible show us the code.)
>
> Best,
> -xinliang
>
>
>     Thanks...
>
>     Regards,
>     C.Palminha
>
>     --- boot log snippet ---
>     [drm] Initialized drm 1.1.0 20060810
>     drm-arcpgu e0017000.pgu: No connectors reported connected with modes
>     [drm] Cannot find any crtc or sizes - going 1024x768
>     Console: switching to colour frame buffer device 128x48
>     drm-arcpgu e0017000.pgu: fb0:  frame buffer device
>     [drm] Initialized drm-arcpgu 1.0.0 20151127 on minor 0
>     --- boot log snippet ---
>     --
>     To unsubscribe from this list: send the line "unsubscribe
>     linux-fbdev" in
>     the body of a message to majordomo@vger.kernel.org
>     <mailto:majordomo@vger.kernel.org>
>     More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>

^ permalink raw reply

* [GIT PULL] fbdev changes for 4.5
From: Tomi Valkeinen @ 2016-01-18  8:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-fbdev, linux-kernel@vger.kernel.org, DRI Development

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

Hi Linus,

The following changes since commit 9f9499ae8e6415cefc4fe0a96ad0e27864353c89:

  Linux 4.4-rc5 (2015-12-13 17:42:58 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git tags/fbdev-4.5

for you to fetch changes up to 6f6abd360603aff043352db90c28748c8c46560e:

  video: fbdev: pxafb: fix out of memory error path (2016-01-18 10:26:17 +0200)

----------------------------------------------------------------
fbdev changes for 4.5

* pxafb: device-tree support
* An unsafe kernel parameter 'lockless_register_fb' for debugging problems
  happening while inside the console lock
* Small miscellaneous fixes & cleanups
* omapdss: add writeback support functions
* Separation of omapfb and omapdrm (see below)

About the separation of omapfb and omapdrm, see
http://permalink.gmane.org/gmane.comp.video.dri.devel/143151 for longer story.

The short version:

omapfb and omapdrm have shared low level drivers (omapdss and panel drivers),
making further development of omapdrm difficult. After these patches omapfb and
omapdrm have their own versions of the drivers, which are more or less
direct copies for now but will diverge soon.

This also means that omapfb (everything under drivers/video/fbdev/omap2/) is
now in maintenance mode, and all new development will be done for omapdrm
(drivers/gpu/drm/omapdrm/).

----------------------------------------------------------------
Arnd Bergmann (3):
      fbdev: sis: enforce selection of at least one backend
      fbdev: auo_k190x: avoid unused function warnings
      fbdev: sm712fb: avoid unused function warnings

Chen-Yu Tsai (2):
      dt-bindings: simplefb: Support regulator supply properties
      simplefb: Claim and enable regulators

Dan Carpenter (2):
      OMAPDSS: DSI: cleanup DSI_IRQ_ERROR_MASK define
      OMAPDSS: DSS: fix a warning message

Daniel Vetter (1):
      fbdev: Debug knob to register without holding console_lock

Dave Gerlach (1):
      OMAPDSS: adopt pinctrl support

Dmitry Eremin-Solenikov (1):
      video: fbdev: rivafb: unlock chip before probiding EDID

Ezequiel Garcia (1):
      fbdev: Make fb-notify a no-op if CONFIG_FB=n

Geert Uytterhoeven (1):
      fbdev: Remove unused SH-Mobile HDMI driver

Julia Lawall (2):
      video: constify geode ops structures
      video: omapdss: delete unneeded of_node_put

Luis de Bethencourt (1):
      OMAPDSS: DISPC: Remove boolean comparisons

Robert Jarzmik (3):
      video: fbdev: pxafb: loosen the platform data bond
      video: fbdev: pxafb: initial devicetree conversion
      video: fbdev: pxafb: fix out of memory error path

Sudip Mukherjee (1):
      drivers/video/fbdev/i740fb: remove unused variable

Tomi Valkeinen (29):
      OMAPDSS: DISPC: always set ALIGN when available
      OMAPDSS: fix DISPC_MFLAG_THRESHOLD_OFFSET for WB
      OMAPDSS: add WB to register dump
      OMAPDSS: add num_wbs=1 to omap5 dss features
      OMAPDSS: add 'has_writeback' flag
      OMAPDSS: add OMAP_DSS_CHANNEL_WB to 'enum omap_channel'
      OMAPDSS: refactor dispc_ovl_get_channel_out
      OMAPDSS: handle WB channel in dispc_set/get_channel_out
      OMAPDSS: configure burst size for WB
      OMAPDSS: configure WB fifo thresholds
      OMAPDSS: configure WB mflag threshold
      OMAPDSS: skip pclk check for WB mem2mem
      OMAPDSS: fix rgb-to-yuv color conv coefs
      OMAPDSS: set WB capturemode for m2m mode
      OMAPDSS: add setup for WB capture mode in dispc_wb_setup()
      OMAPDSS: remove extra EXPORT_SYMBOLs
      OMAPDSS: make a two dss feat funcs internal to omapdss
      OMAPDSS: change internal dispc functions to static
      OMAPDSS: remove extra out == NULL checks
      omapfb: allow compilation only if DRM_OMAP is disabled
      omapfb: copy omapdss & displays for omapfb
      omapdss: remove CONFIG_OMAP2_DSS_VENC from omapdss.h
      omapfb/dss: change CONFIG_OMAP* to CONFIG_FB_OMAP*
      omapfb/displays: change CONFIG_DISPLAY_* to CONFIG_FB_OMAP2_*
      omapfb: take omapfb's private omapdss into use
      omapfb: move vrfb into omapfb
      drm/omap: move omapdss & displays under omapdrm
      drm/omap: make omapdrm select OMAP2_DSS
      Merge omapdss split between omapdrm and omapfb

Uwe Kleine-König (2):
      fbdev: omap2: panel-dpi: in .disable first disable backlight then display
      fbdev: omap2: panel-dpi: simplify gpio setting

 .../bindings/display/simple-framebuffer.txt        |   13 +-
 drivers/gpu/drm/Makefile                           |    2 +-
 drivers/gpu/drm/omapdrm/Kconfig                    |   10 +-
 drivers/gpu/drm/omapdrm/Makefile                   |    3 +
 .../drm/omapdrm/displays}/Kconfig                  |    3 +-
 .../drm/omapdrm/displays}/Makefile                 |    0
 .../drm/omapdrm/displays}/connector-analog-tv.c    |    0
 .../drm/omapdrm/displays}/connector-dvi.c          |    0
 .../drm/omapdrm/displays}/connector-hdmi.c         |    0
 .../drm/omapdrm/displays}/encoder-opa362.c         |    0
 .../drm/omapdrm/displays}/encoder-tfp410.c         |    0
 .../drm/omapdrm/displays}/encoder-tpd12s015.c      |    0
 .../drm/omapdrm/displays}/panel-dpi.c              |    8 +-
 .../drm/omapdrm/displays}/panel-dsi-cm.c           |    0
 .../omapdrm/displays}/panel-lgphilips-lb035q02.c   |    0
 .../drm/omapdrm/displays}/panel-nec-nl8048hl11.c   |    0
 .../omapdrm/displays}/panel-sharp-ls037v7dw01.c    |    0
 .../drm/omapdrm/displays}/panel-sony-acx565akm.c   |    0
 .../drm/omapdrm/displays}/panel-tpo-td028ttec1.c   |    0
 .../drm/omapdrm/displays}/panel-tpo-td043mtea1.c   |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/Kconfig    |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/Makefile   |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/apply.c    |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/core.c     |    0
 .../omap2 => gpu/drm/omapdrm}/dss/dispc-compat.c   |    6 +-
 .../omap2 => gpu/drm/omapdrm}/dss/dispc-compat.h   |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc.c    |  163 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc.h    |    2 +
 .../omap2 => gpu/drm/omapdrm}/dss/dispc_coefs.c    |    0
 .../omap2 => gpu/drm/omapdrm}/dss/display-sysfs.c  |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/display.c  |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dpi.c      |    2 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dsi.c      |    4 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dss-of.c   |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dss.c      |    6 +
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/dss.h      |    8 +-
 .../omap2 => gpu/drm/omapdrm}/dss/dss_features.c   |   11 -
 .../omap2 => gpu/drm/omapdrm}/dss/dss_features.h   |    5 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi.h     |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi4.c    |    2 +-
 .../omap2 => gpu/drm/omapdrm}/dss/hdmi4_core.c     |    0
 .../omap2 => gpu/drm/omapdrm}/dss/hdmi4_core.h     |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi5.c    |    2 +-
 .../omap2 => gpu/drm/omapdrm}/dss/hdmi5_core.c     |    0
 .../omap2 => gpu/drm/omapdrm}/dss/hdmi5_core.h     |    0
 .../omap2 => gpu/drm/omapdrm}/dss/hdmi_common.c    |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_phy.c |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_pll.c |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_wp.c  |    0
 .../omap2 => gpu/drm/omapdrm}/dss/manager-sysfs.c  |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/manager.c  |    2 +-
 .../drm/omapdrm}/dss/omapdss-boot-init.c           |    4 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/output.c   |    0
 .../omap2 => gpu/drm/omapdrm}/dss/overlay-sysfs.c  |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/overlay.c  |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/pll.c      |    0
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/rfbi.c     |    2 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/sdi.c      |    2 +-
 .../fbdev/omap2 => gpu/drm/omapdrm}/dss/venc.c     |    2 +-
 .../omap2 => gpu/drm/omapdrm}/dss/video-pll.c      |    0
 drivers/media/platform/omap/Kconfig                |    2 +-
 drivers/video/fbdev/Kconfig                        |   17 +-
 drivers/video/fbdev/Makefile                       |    1 -
 drivers/video/fbdev/auo_k190x.c                    |   11 +-
 drivers/video/fbdev/core/Makefile                  |    2 +-
 drivers/video/fbdev/core/fbmem.c                   |   14 +-
 drivers/video/fbdev/geode/display_gx1.c            |    2 +-
 drivers/video/fbdev/geode/display_gx1.h            |    2 +-
 drivers/video/fbdev/geode/geodefb.h                |    4 +-
 drivers/video/fbdev/geode/video_cs5530.c           |    2 +-
 drivers/video/fbdev/geode/video_cs5530.h           |    2 +-
 drivers/video/fbdev/i740fb.c                       |    8 +-
 drivers/video/fbdev/omap2/Kconfig                  |    5 -
 drivers/video/fbdev/omap2/Makefile                 |    6 +-
 drivers/video/fbdev/omap2/omapfb/Kconfig           |   14 +-
 drivers/video/fbdev/omap2/omapfb/Makefile          |    3 +
 drivers/video/fbdev/omap2/omapfb/displays/Kconfig  |   86 +
 drivers/video/fbdev/omap2/omapfb/displays/Makefile |   14 +
 .../omap2/omapfb/displays/connector-analog-tv.c    |  320 ++
 .../fbdev/omap2/omapfb/displays/connector-dvi.c    |  398 ++
 .../fbdev/omap2/omapfb/displays/connector-hdmi.c   |  348 ++
 .../fbdev/omap2/omapfb/displays/encoder-opa362.c   |  278 +
 .../fbdev/omap2/omapfb/displays/encoder-tfp410.c   |  320 ++
 .../omap2/omapfb/displays/encoder-tpd12s015.c      |  328 ++
 .../video/fbdev/omap2/omapfb/displays/panel-dpi.c  |  328 ++
 .../fbdev/omap2/omapfb/displays/panel-dsi-cm.c     | 1388 +++++
 .../omapfb/displays/panel-lgphilips-lb035q02.c     |  404 ++
 .../omap2/omapfb/displays/panel-nec-nl8048hl11.c   |  437 ++
 .../omapfb/displays/panel-sharp-ls037v7dw01.c      |  415 ++
 .../omap2/omapfb/displays/panel-sony-acx565akm.c   |  917 ++++
 .../omap2/omapfb/displays/panel-tpo-td028ttec1.c   |  511 ++
 .../omap2/omapfb/displays/panel-tpo-td043mtea1.c   |  686 +++
 drivers/video/fbdev/omap2/omapfb/dss/Kconfig       |  129 +
 drivers/video/fbdev/omap2/omapfb/dss/Makefile      |   18 +
 drivers/video/fbdev/omap2/omapfb/dss/apply.c       | 1702 ++++++
 drivers/video/fbdev/omap2/omapfb/dss/core.c        |  343 ++
 .../video/fbdev/omap2/omapfb/dss/dispc-compat.c    |  667 +++
 .../video/fbdev/omap2/omapfb/dss/dispc-compat.h    |   30 +
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c       | 4234 +++++++++++++++
 drivers/video/fbdev/omap2/omapfb/dss/dispc.h       |  918 ++++
 drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c |  325 ++
 .../video/fbdev/omap2/omapfb/dss/display-sysfs.c   |  356 ++
 drivers/video/fbdev/omap2/omapfb/dss/display.c     |  338 ++
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c         |  899 ++++
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c         | 5607 ++++++++++++++++++++
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c      |  183 +
 drivers/video/fbdev/omap2/omapfb/dss/dss.c         | 1329 +++++
 drivers/video/fbdev/omap2/omapfb/dss/dss.h         |  468 ++
 .../video/fbdev/omap2/omapfb/dss/dss_features.c    |  951 ++++
 .../video/fbdev/omap2/omapfb/dss/dss_features.h    |  108 +
 drivers/video/fbdev/omap2/omapfb/dss/hdmi.h        |  370 ++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c       |  839 +++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c  |  904 ++++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h  |  273 +
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c       |  876 +++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c  |  916 ++++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h  |  304 ++
 drivers/video/fbdev/omap2/omapfb/dss/hdmi_common.c |  148 +
 drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c    |  247 +
 drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c    |  255 +
 drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c     |  282 +
 .../video/fbdev/omap2/omapfb/dss/manager-sysfs.c   |  531 ++
 drivers/video/fbdev/omap2/omapfb/dss/manager.c     |  263 +
 .../fbdev/omap2/omapfb/dss/omapdss-boot-init.c     |  225 +
 drivers/video/fbdev/omap2/omapfb/dss/output.c      |  267 +
 .../video/fbdev/omap2/omapfb/dss/overlay-sysfs.c   |  456 ++
 drivers/video/fbdev/omap2/omapfb/dss/overlay.c     |  202 +
 drivers/video/fbdev/omap2/omapfb/dss/pll.c         |  389 ++
 drivers/video/fbdev/omap2/omapfb/dss/rfbi.c        | 1078 ++++
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c         |  454 ++
 drivers/video/fbdev/omap2/omapfb/dss/venc.c        |  997 ++++
 drivers/video/fbdev/omap2/omapfb/dss/video-pll.c   |  211 +
 drivers/video/fbdev/omap2/{ => omapfb}/vrfb.c      |    0
 drivers/video/fbdev/pxafb.c                        |  210 +-
 drivers/video/fbdev/pxafb.h                        |    2 +
 drivers/video/fbdev/riva/fbdev.c                   |    1 +
 drivers/video/fbdev/sh_mobile_hdmi.c               | 1489 ------
 drivers/video/fbdev/simplefb.c                     |  120 +-
 drivers/video/fbdev/sm712fb.c                      |   16 +-
 include/linux/fb.h                                 |   18 +
 include/video/omapdss.h                            |    5 +-
 include/video/sh_mobile_hdmi.h                     |   49 -
 142 files changed, 36836 insertions(+), 1701 deletions(-)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/Kconfig (96%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/Makefile (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/connector-analog-tv.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/connector-dvi.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/connector-hdmi.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/encoder-opa362.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/encoder-tfp410.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/encoder-tpd12s015.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-dpi.c (98%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-dsi-cm.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-lgphilips-lb035q02.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-nec-nl8048hl11.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-sharp-ls037v7dw01.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-sony-acx565akm.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-tpo-td028ttec1.c (100%)
 rename drivers/{video/fbdev/omap2/displays-new => gpu/drm/omapdrm/displays}/panel-tpo-td043mtea1.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/Kconfig (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/Makefile (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/apply.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/core.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc-compat.c (98%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc-compat.h (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc.c (96%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc.h (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dispc_coefs.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/display-sysfs.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/display.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dpi.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dsi.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dss-of.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dss.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dss.h (97%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dss_features.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/dss_features.h (94%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi.h (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi4.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi4_core.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi4_core.h (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi5.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi5_core.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi5_core.h (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_common.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_phy.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_pll.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/hdmi_wp.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/manager-sysfs.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/manager.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/omapdss-boot-init.c (98%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/output.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/overlay-sysfs.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/overlay.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/pll.c (100%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/rfbi.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/sdi.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/venc.c (99%)
 rename drivers/{video/fbdev/omap2 => gpu/drm/omapdrm}/dss/video-pll.c (100%)
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/Kconfig
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/Makefile
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/encoder-opa362.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-dpi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-nec-nl8048hl11.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td028ttec1.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/Kconfig
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/Makefile
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/apply.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/core.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dispc-compat.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dispc.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dispc.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dispc_coefs.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/display.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dpi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dsi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dss.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dss.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dss_features.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/dss_features.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi4_core.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi5_core.h
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi_common.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi_pll.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/manager.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/output.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/overlay.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/pll.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/rfbi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/sdi.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/venc.c
 create mode 100644 drivers/video/fbdev/omap2/omapfb/dss/video-pll.c
 rename drivers/video/fbdev/omap2/{ => omapfb}/vrfb.c (100%)
 delete mode 100644 drivers/video/fbdev/sh_mobile_hdmi.c
 delete mode 100644 include/video/sh_mobile_hdmi.h



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

^ permalink raw reply

* Re: [PATCH v4 10/11] dma: rename dma_*_writecombine() to dma_*_wc()
From: Luis R. Rodriguez @ 2016-01-15 18:24 UTC (permalink / raw)
  To: Ingo Molnar, Julia Lawall
  Cc: Andrew Morton, David Howells, Borislav Petkov, Bjorn Helgaas,
	Tomi Valkeinen, Dave Airlie, linux-fbdev, Andy Lutomirski,
	vinod.koul, Dan Williams, Toshi Kani, Benjamin Herrenschmidt,
	Michael S. Tsirkin, Daniel Vetter, Konrad Rzeszutek Wilk, X86 ML,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	xen-devel@lists.xensource.com
In-Reply-To: <20150826042136.GA14584@gmail.com>

On Tue, Aug 25, 2015 at 9:21 PM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Andrew Morton <akpm@linux-foundation.org> wrote:
>
>> > There's a catch-22 issue here either way, for instance this rename patch has
>> > been being baked for probably 2 releases already but the difficulty has been
>> > trying to find the appropriate time to merge it without conflict.
>> >
>> > If you do it in the beginning of the merge window, you have to ask yourself in
>> > what tree it will be done. Since subsystems are topic specific that means that
>> > subsystem will end up having a conflict at the end of the merge window.
>>
>> Yes it's a special case.  I think the best way of handling such things is to get
>> them in to Linus either right at the end of the merge window or the day after he
>> releases -rc1.  This is when most people's trees are mostly empty.
>
> Yes, that was the plan last time around as well - but the end of the merge window
> is when we have the least maintainer bandwidth as well ...
>
> Anyway, I applied most of the patches (sans the rename), so the rename patch
> should be a lot simpler to execute at the right moment this time around.

Ingo, should we try this again some time? I have some ideas on how to
make these sorts of changes easier to manage in the future, it
involves having an automatic git rebase option to use Coccinelle for
you if a patch is annotated to have been completely done with
Coccinelle, but future tooling is needed for that [0]. In the meantime
I (or you) can simply run the script at any point in time to catch all
the names as-is in the kernel / point in time we decide to merge this
simple rename.

[0] http://kernelnewbies.org/KernelProjects/linux-oven

 Luis

^ permalink raw reply

* Re: [RESEND PATCH 1/2] devicetree: mxsfb: add reset-active property
From: Tomi Valkeinen @ 2016-01-12 13:39 UTC (permalink / raw)
  To: Måns Rullgård
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Jean-Christophe Plagniol-Villard,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <yw1x7fjfuenu.fsf-OEaqT8BN2ezZK2NkWkPsZwC/G2K4zDHf@public.gmane.org>

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



On 12/01/16 15:10, Måns Rullgård wrote:

>> I don't see any sleeps related to reset in the code. If reset is
>> asserted when the display is blanked, is it guaranteed that the reset
>> stays asserted long enough until the display is enabled again?
> 
> In the datasheet for the panel I'm dealing with, there's some vague
> mention of 10 us (I missed it last time I looked), and my patch indeed
> fails to ensure this is met.  Other panels will obviously have different
> requirements.  To handle all cases properly, I suppose a configurable
> delay after changing the reset pin should be added.

Right. And then you need to ensure the powers are enabled in the right
order, the pixel clock is started at the right time (some need pix clock
before reset), and so on and so on =).

> I could also take the lazy way out, pinmux this signal high and leave it
> at that.

I've seen panels that require a reset after powers have been off, or
similar, but I hope those are minority.

So yes, probably just making sure the reset is not asserted is the most
generic and easy way forward.

 Tomi


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

^ permalink raw reply

* Re: [RESEND PATCH 1/2] devicetree: mxsfb: add reset-active property
From: Måns Rullgård @ 2016-01-12 13:10 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Jean-Christophe Plagniol-Villard, devicetree, linux-kernel,
	linux-fbdev
In-Reply-To: <5694F51C.7040107@ti.com>

Tomi Valkeinen <tomi.valkeinen@ti.com> writes:

> On 12/01/16 12:22, Mans Rullgard wrote:
>> Some boards connect the LCD_RESET pin to a reset input on the
>> display panel.  On these boards, this pin must be set to the
>> proper level for the display to function.
>> 
>> This adds an optional "reset-active" property to the "display"
>> subnode such that devicetrees can specify the desired polarity
>> of the LCD_RESET pin.
>> 
>> Signed-off-by: Mans Rullgard <mans@mansr.com>
>> ---
>>  Documentation/devicetree/bindings/display/mxsfb.txt | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/display/mxsfb.txt b/Documentation/devicetree/bindings/display/mxsfb.txt
>> index 96ec5179c8a0..cb7212a6bdf2 100644
>> --- a/Documentation/devicetree/bindings/display/mxsfb.txt
>> +++ b/Documentation/devicetree/bindings/display/mxsfb.txt
>> @@ -13,6 +13,11 @@ Required properties:
>>  - bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
>>  - bus-width : number of data lines.  Could be <8>, <16>, <18> or <24>.
>>  
>> +Optional properties:
>> +- reset-active : <0>: reset pin is active low
>> +                 <1>: reset pin is active high
>> +                 omitted: reset pin not used
>> +
>>  Required sub-node:
>>  - display-timings : Refer to binding doc display-timing.txt for details.
>
> So maybe this is fine for the mxsfb if it doesn't support any kind of
> panel drivers, and there's no plan to extend it. Otherwise the LCD_RESET
> pin could perhaps be exposed as a GPIO for the panel drivers.
>
> But even so, I think the definition of "reset" is a bit vague.
>
> I know panels for which "reset" is a pulse, you assert it for a short
> period. Other panels take reset more like a on/off switch. If I'm not
> mistaken, this one is the latter kind.
>
> I don't see any sleeps related to reset in the code. If reset is
> asserted when the display is blanked, is it guaranteed that the reset
> stays asserted long enough until the display is enabled again?

In the datasheet for the panel I'm dealing with, there's some vague
mention of 10 us (I missed it last time I looked), and my patch indeed
fails to ensure this is met.  Other panels will obviously have different
requirements.  To handle all cases properly, I suppose a configurable
delay after changing the reset pin should be added.

I could also take the lazy way out, pinmux this signal high and leave it
at that.

-- 
Måns Rullgård

^ permalink raw reply

* Re: [RESEND PATCH 1/2] devicetree: mxsfb: add reset-active property
From: Tomi Valkeinen @ 2016-01-12 12:44 UTC (permalink / raw)
  To: Mans Rullgard, Rob Herring
  Cc: Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Jean-Christophe Plagniol-Villard,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1452594141-26073-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>

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


On 12/01/16 12:22, Mans Rullgard wrote:
> Some boards connect the LCD_RESET pin to a reset input on the
> display panel.  On these boards, this pin must be set to the
> proper level for the display to function.
> 
> This adds an optional "reset-active" property to the "display"
> subnode such that devicetrees can specify the desired polarity
> of the LCD_RESET pin.
> 
> Signed-off-by: Mans Rullgard <mans@mansr.com>
> ---
>  Documentation/devicetree/bindings/display/mxsfb.txt | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/mxsfb.txt b/Documentation/devicetree/bindings/display/mxsfb.txt
> index 96ec5179c8a0..cb7212a6bdf2 100644
> --- a/Documentation/devicetree/bindings/display/mxsfb.txt
> +++ b/Documentation/devicetree/bindings/display/mxsfb.txt
> @@ -13,6 +13,11 @@ Required properties:
>  - bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
>  - bus-width : number of data lines.  Could be <8>, <16>, <18> or <24>.
>  
> +Optional properties:
> +- reset-active : <0>: reset pin is active low
> +                 <1>: reset pin is active high
> +                 omitted: reset pin not used
> +
>  Required sub-node:
>  - display-timings : Refer to binding doc display-timing.txt for details.

So maybe this is fine for the mxsfb if it doesn't support any kind of
panel drivers, and there's no plan to extend it. Otherwise the LCD_RESET
pin could perhaps be exposed as a GPIO for the panel drivers.

But even so, I think the definition of "reset" is a bit vague.

I know panels for which "reset" is a pulse, you assert it for a short
period. Other panels take reset more like a on/off switch. If I'm not
mistaken, this one is the latter kind.

I don't see any sleeps related to reset in the code. If reset is
asserted when the display is blanked, is it guaranteed that the reset
stays asserted long enough until the display is enabled again?

 Tomi


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

^ permalink raw reply

* [RESEND PATCH 2/2] video: mxsfb: manage LCD_RESET signal according to reset-active property
From: Mans Rullgard @ 2016-01-12 10:22 UTC (permalink / raw)
  To: Rob Herring, Tomi Valkeinen
  Cc: Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Jean-Christophe Plagniol-Villard, devicetree, linux-kernel,
	linux-fbdev
In-Reply-To: <1452594141-26073-1-git-send-email-mans@mansr.com>

Activate/deactivate the LCD_RESET signal as specified by the
reset-active DT property when the controller is disabled/enabled.
If the property is missing, leave the signal unchanged.

Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/video/fbdev/mxsfb.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c
index 4e6608ceac09..0200a0f16675 100644
--- a/drivers/video/fbdev/mxsfb.c
+++ b/drivers/video/fbdev/mxsfb.c
@@ -99,6 +99,7 @@
 #define CTRL1_FIFO_CLEAR		(1 << 21)
 #define CTRL1_SET_BYTE_PACKAGING(x)	(((x) & 0xf) << 16)
 #define CTRL1_GET_BYTE_PACKAGING(x)	(((x) >> 16) & 0xf)
+#define CTRL1_RESET			(1 << 0)
 
 #define TRANSFER_COUNT_SET_VCOUNT(x)	(((x) & 0xffff) << 16)
 #define TRANSFER_COUNT_GET_VCOUNT(x)	(((x) >> 16) & 0xffff)
@@ -152,6 +153,9 @@
 #define MXSFB_SYNC_DATA_ENABLE_HIGH_ACT	(1 << 6)
 #define MXSFB_SYNC_DOTCLK_FALLING_ACT	(1 << 7) /* negtive edge sampling */
 
+#define MXSFB_RESET_LOW			1
+#define MXSFB_RESET_HIGH		2
+
 enum mxsfb_devtype {
 	MXSFB_V3,
 	MXSFB_V4,
@@ -181,6 +185,7 @@ struct mxsfb_info {
 	unsigned dotclk_delay;
 	const struct mxsfb_devdata *devdata;
 	u32 sync;
+	u32 reset;
 	struct regulator *reg_lcd;
 };
 
@@ -362,6 +367,11 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
 
 	writel(CTRL_RUN, host->base + LCDC_CTRL + REG_SET);
 
+	if (host->reset = MXSFB_RESET_HIGH)
+		writel(CTRL1_RESET, host->base + LCDC_CTRL1 + REG_CLR);
+	else if (host->reset = MXSFB_RESET_LOW)
+		writel(CTRL1_RESET, host->base + LCDC_CTRL1 + REG_SET);
+
 	host->enabled = 1;
 }
 
@@ -388,6 +398,11 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
 		loop--;
 	}
 
+	if (host->reset = MXSFB_RESET_HIGH)
+		writel(CTRL1_RESET, host->base + LCDC_CTRL1 + REG_SET);
+	else if (host->reset = MXSFB_RESET_LOW)
+		writel(CTRL1_RESET, host->base + LCDC_CTRL1 + REG_CLR);
+
 	reg = readl(host->base + LCDC_VDCTRL4);
 	writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
 
@@ -410,7 +425,7 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
 static int mxsfb_set_par(struct fb_info *fb_info)
 {
 	struct mxsfb_info *host = to_imxfb_host(fb_info);
-	u32 ctrl, vdctrl0, vdctrl4;
+	u32 ctrl, ctrl1, vdctrl0, vdctrl4;
 	int line_size, fb_size;
 	int reenable = 0;
 
@@ -439,12 +454,13 @@ static int mxsfb_set_par(struct fb_info *fb_info)
 
 	ctrl = CTRL_BYPASS_COUNT | CTRL_MASTER |
 		CTRL_SET_BUS_WIDTH(host->ld_intf_width);
+	ctrl1 = readl(host->base + LCDC_CTRL1) & CTRL1_RESET;
 
 	switch (fb_info->var.bits_per_pixel) {
 	case 16:
 		dev_dbg(&host->pdev->dev, "Setting up RGB565 mode\n");
 		ctrl |= CTRL_SET_WORD_LENGTH(0);
-		writel(CTRL1_SET_BYTE_PACKAGING(0xf), host->base + LCDC_CTRL1);
+		ctrl1 |= CTRL1_SET_BYTE_PACKAGING(0xf);
 		break;
 	case 32:
 		dev_dbg(&host->pdev->dev, "Setting up RGB888/666 mode\n");
@@ -462,7 +478,7 @@ static int mxsfb_set_par(struct fb_info *fb_info)
 			break;
 		}
 		/* do not use packed pixels = one pixel per word instead */
-		writel(CTRL1_SET_BYTE_PACKAGING(0x7), host->base + LCDC_CTRL1);
+		ctrl1 |= CTRL1_SET_BYTE_PACKAGING(0x7);
 		break;
 	default:
 		mxsfb_disable_axi_clk(host);
@@ -472,6 +488,7 @@ static int mxsfb_set_par(struct fb_info *fb_info)
 	}
 
 	writel(ctrl, host->base + LCDC_CTRL);
+	writel(ctrl1, host->base + LCDC_CTRL1);
 
 	writel(TRANSFER_COUNT_SET_VCOUNT(fb_info->var.yres) |
 			TRANSFER_COUNT_SET_HCOUNT(fb_info->var.xres),
@@ -736,6 +753,7 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host,
 	struct device_node *display_np;
 	struct videomode vm;
 	u32 width;
+	u32 reset;
 	int ret;
 
 	display_np = of_parse_phandle(np, "display", 0);
@@ -776,6 +794,10 @@ static int mxsfb_init_fbinfo_dt(struct mxsfb_info *host,
 		goto put_display_node;
 	}
 
+	ret = of_property_read_u32(display_np, "reset-active", &reset);
+	if (!ret)
+		host->reset = reset ? MXSFB_RESET_HIGH : MXSFB_RESET_LOW;
+
 	ret = of_get_videomode(display_np, &vm, OF_USE_NATIVE_MODE);
 	if (ret) {
 		dev_err(dev, "failed to get videomode from DT\n");
-- 
2.7.0


^ permalink raw reply related


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