Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-08-13 18:23:18 +0200
committerTakashi Iwai <tiwai@suse.de>2014-08-13 18:23:18 +0200
commitee3abc8148fe18e205ab92847089d4bfb2cffd2f (patch)
treed090b956dfd029ddc80f4086ab5f1e7ca893e417
parentf92487dbd7a305531e4cc54c41609b8f77a1bc30 (diff)
drm: omapdrm: fix compiler errors.
-rw-r--r--patches.fixes/drm-omapdrm-fix-compiler-errors113
-rw-r--r--series.conf1
2 files changed, 114 insertions, 0 deletions
diff --git a/patches.fixes/drm-omapdrm-fix-compiler-errors b/patches.fixes/drm-omapdrm-fix-compiler-errors
new file mode 100644
index 0000000000..a72003423f
--- /dev/null
+++ b/patches.fixes/drm-omapdrm-fix-compiler-errors
@@ -0,0 +1,113 @@
+From 2d31ca3ad7d5d44c8adc7f253c96ce33f3a2e931 Mon Sep 17 00:00:00 2001
+From: Russell King <rmk+kernel@arm.linux.org.uk>
+Date: Sat, 12 Jul 2014 10:53:41 +0100
+Subject: [PATCH] drm: omapdrm: fix compiler errors
+Git-commit: 2d31ca3ad7d5d44c8adc7f253c96ce33f3a2e931
+Patch-mainline: 3.17-rc1
+
+Regular randconfig nightly testing has detected problems with omapdrm.
+
+omapdrm fails to build when the kernel is built to support 64-bit DMA
+addresses and/or 64-bit physical addresses due to an assumption about
+the width of these types.
+
+Use %pad to print DMA addresses, rather than %x or %Zx (which is even
+more wrong than %x). Avoid passing a uint32_t pointer into a function
+which expects dma_addr_t pointer.
+
+Drivers/gpu/drm/omapdrm/omap_plane.c: In function 'omap_plane_pre_apply':
+drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Werror=format]
+drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Werror=format]
+Make[5]: *** [drivers/gpu/drm/omapdrm/omap_plane.o] Error 1
+Drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_get_paddr':
+drivers/gpu/drm/omapdrm/omap_gem.c:794:4: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t' [-Werror=format]
+Drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_describe':
+drivers/gpu/drm/omapdrm/omap_gem.c:991:4: error: format '%Zx' expects argument of type 'size_t', but argument 7 has type 'dma_addr_t' [-Werror=format]
+Drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_init':
+drivers/gpu/drm/omapdrm/omap_gem.c:1470:4: error: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Werror=format]
+Make[5]: *** [drivers/gpu/drm/omapdrm/omap_gem.o] Error 1
+Drivers/gpu/drm/omapdrm/omap_dmm_tiler.c: In function 'dmm_txn_append':
+drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:226:2: error: passing argument 3 of 'alloc_dma' from incompatible pointer type [-Werror]
+Make[5]: *** [drivers/gpu/drm/omapdrm/omap_dmm_tiler.o] Error 1
+Make[5]: Target `__build' not remade because of errors.
+Make[4]: *** [drivers/gpu/drm/omapdrm] Error 2
+
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 6 ++++--
+ drivers/gpu/drm/omapdrm/omap_gem.c | 10 +++++-----
+ drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
+ 3 files changed, 11 insertions(+), 9 deletions(-)
+
+--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
++++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+@@ -199,7 +199,7 @@ static struct dmm_txn *dmm_txn_init(stru
+ static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area,
+ struct page **pages, uint32_t npages, uint32_t roll)
+ {
+- dma_addr_t pat_pa = 0;
++ dma_addr_t pat_pa = 0, data_pa = 0;
+ uint32_t *data;
+ struct pat *pat;
+ struct refill_engine *engine = txn->engine_handle;
+@@ -223,7 +223,9 @@ static void dmm_txn_append(struct dmm_tx
+ .lut_id = engine->tcm->lut_id,
+ };
+
+- data = alloc_dma(txn, 4*i, &pat->data_pa);
++ data = alloc_dma(txn, 4*i, &data_pa);
++ /* FIXME: what if data_pa is more than 32-bit ? */
++ pat->data_pa = data_pa;
+
+ while (i--) {
+ int n = i + roll;
+--- a/drivers/gpu/drm/omapdrm/omap_gem.c
++++ b/drivers/gpu/drm/omapdrm/omap_gem.c
+@@ -791,7 +791,7 @@ int omap_gem_get_paddr(struct drm_gem_ob
+ omap_obj->paddr = tiler_ssptr(block);
+ omap_obj->block = block;
+
+- DBG("got paddr: %08x", omap_obj->paddr);
++ DBG("got paddr: %pad", &omap_obj->paddr);
+ }
+
+ omap_obj->paddr_cnt++;
+@@ -985,9 +985,9 @@ void omap_gem_describe(struct drm_gem_ob
+
+ off = drm_vma_node_start(&obj->vma_node);
+
+- seq_printf(m, "%08x: %2d (%2d) %08llx %08Zx (%2d) %p %4d",
++ seq_printf(m, "%08x: %2d (%2d) %08llx %pad (%2d) %p %4d",
+ omap_obj->flags, obj->name, obj->refcount.refcount.counter,
+- off, omap_obj->paddr, omap_obj->paddr_cnt,
++ off, &omap_obj->paddr, omap_obj->paddr_cnt,
+ omap_obj->vaddr, omap_obj->roll);
+
+ if (omap_obj->flags & OMAP_BO_TILED) {
+@@ -1467,8 +1467,8 @@ void omap_gem_init(struct drm_device *de
+ entry->paddr = tiler_ssptr(block);
+ entry->block = block;
+
+- DBG("%d:%d: %dx%d: paddr=%08x stride=%d", i, j, w, h,
+- entry->paddr,
++ DBG("%d:%d: %dx%d: paddr=%pad stride=%d", i, j, w, h,
++ &entry->paddr,
+ usergart[i].stride_pfn << PAGE_SHIFT);
+ }
+ }
+--- a/drivers/gpu/drm/omapdrm/omap_plane.c
++++ b/drivers/gpu/drm/omapdrm/omap_plane.c
+@@ -142,8 +142,8 @@ static void omap_plane_pre_apply(struct
+ DBG("%dx%d -> %dx%d (%d)", info->width, info->height,
+ info->out_width, info->out_height,
+ info->screen_width);
+- DBG("%d,%d %08x %08x", info->pos_x, info->pos_y,
+- info->paddr, info->p_uv_addr);
++ DBG("%d,%d %pad %pad", info->pos_x, info->pos_y,
++ &info->paddr, &info->p_uv_addr);
+
+ /* TODO: */
+ ilace = false;
diff --git a/series.conf b/series.conf
index a1f2b585e8..5a69983e66 100644
--- a/series.conf
+++ b/series.conf
@@ -359,6 +359,7 @@
# DRM/Video
########################################################
patches.fixes/nouveau-fix-race-with-fence-signaling
+ patches.fixes/drm-omapdrm-fix-compiler-errors
########################################################
# video4linux