diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 13:11:57 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 13:11:57 -0800 |
commit | 30c0307441e3abb1d97a6596f390ba26df430ae7 (patch) | |
tree | f28f9f3e20219472a7052468b88905c3653f4f6d | |
parent | 85eeccf5f9a389b6852c0a8e90675905c2749788 (diff) | |
download | ltsi-kernel-30c0307441e3abb1d97a6596f390ba26df430ae7.tar.gz |
add a number of fixes reported that we need here
11 files changed, 839 insertions, 1 deletions
diff --git a/patches.fixes/0001-drm-remove-FASYNC-support.patch b/patches.fixes/0001-drm-remove-FASYNC-support.patch new file mode 100644 index 0000000000000..f1122a3f1c038 --- /dev/null +++ b/patches.fixes/0001-drm-remove-FASYNC-support.patch @@ -0,0 +1,75 @@ +From 8ce19085d46b638b8f476acd0c041f4153cbc82b Mon Sep 17 00:00:00 2001 +From: Daniel Vetter <daniel.vetter@ffwll.ch> +Date: Sun, 2 Feb 2014 10:14:51 +0900 +Subject: drm: remove FASYNC support + +So I've stumbled over drm_fasync and wondered what it does. Digging +that up is quite a story. + +First I've had to read up on what this does and ended up being rather +bewildered why peopled loved signals so much back in the days that +they've created SIGIO just for that ... + +Then I wondered how this ever works, and what that strange "No-op." +comment right above it should mean. After all calling the core fasync +helper is pretty obviously not a noop. After reading through the +kernels FASYNC implementation I've noticed that signals are only sent +out to the processes attached with FASYNC by calling kill_fasync. + +No merged drm driver has ever done that. + +After more digging I've found out that the only driver that ever used +this is the so called GAMMA driver. I've frankly never heard of such a +gpu brand ever before. Now FASYNC seems to not have been the only bad +thing with that driver, since Dave Airlie removed it from the drm +driver with prejudice: + +commit 1430163b4bbf7b00367ea1066c1c5fe85dbeefed +Author: Dave Airlie <airlied@linux.ie> +Date: Sun Aug 29 12:04:35 2004 +0000 + + Drop GAMMA DRM from a great height ... + +Long story short, the drm fasync support seems to be doing absolutely +nothing. And the only user of it was never merged into the upstream +kernel. And we don't need any fops->fasync callback since the fcntl +implementation in the kernel already implements the noop case +correctly. + +So stop this particular cargo-cult and rip it all out. + +v2: Kill drm_fasync assignments in rcar (newly added) and imx drivers +(somehow I've missed that one in staging). Also drop the reference in +the drm DocBook. ARM compile-fail reported by Rob Clark. + +v3: Move the removal of dev->buf_asnyc assignment in drm_setup to this +patch here. + +v4: Actually git add ... tsk. + +Cc: Dave Airlie <airlied@linux.ie> +Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Cc: Rob Clark <robdclark@gmail.com> +Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> +Reviewed-by: David Herrmann <dh.herrmann@gmail.com> +Signed-off-by: Dave Airlie <airlied@redhat.com> +(cherry picked from commit b0e898ac555e96e7863a5ee95d70f3625f1db5e2) +Signed-off-by: Simon Horman <horms@verge.net.au> + +Conflicts: + drivers/gpu/drm/drm_fops.c +--- + drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c +@@ -148,7 +148,6 @@ static const struct file_operations rcar + #endif + .poll = drm_poll, + .read = drm_read, +- .fasync = drm_fasync, + .llseek = no_llseek, + .mmap = drm_gem_cma_mmap, + }; diff --git a/patches.fixes/0002-drm-Pass-page-flip-ioctl-flags-to-driver.patch b/patches.fixes/0002-drm-Pass-page-flip-ioctl-flags-to-driver.patch new file mode 100644 index 0000000000000..afd1eb6524e94 --- /dev/null +++ b/patches.fixes/0002-drm-Pass-page-flip-ioctl-flags-to-driver.patch @@ -0,0 +1,37 @@ +From 85a417a308fd9798dfb7929f1abddd16006bf43b Mon Sep 17 00:00:00 2001 +From: Keith Packard <keithp@keithp.com> +Date: Sun, 2 Feb 2014 10:14:52 +0900 +Subject: drm: Pass page flip ioctl flags to driver + +This lets drivers see the flags requested by the application + +[airlied: fixup for rcar/imx/msm] + +Signed-off-by: Keith Packard <keithp@keithp.com> +Signed-off-by: Dave Airlie <airlied@gmail.com> +(cherry picked from commit ed8d19756e80ec63003a93aa4d70406e6ba61522) +Signed-off-by: Simon Horman <horms@verge.net.au> + +Conflicts: + drivers/gpu/drm/msm/mdp4/mdp4_crtc.c +--- + drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +index 33df7a583143..a9d24e4bf792 100644 +--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +@@ -497,7 +497,8 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg) + + static int rcar_du_crtc_page_flip(struct drm_crtc *crtc, + struct drm_framebuffer *fb, +- struct drm_pending_vblank_event *event) ++ struct drm_pending_vblank_event *event, ++ uint32_t page_flip_flags) + { + struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); + struct drm_device *dev = rcrtc->crtc.dev; +-- +1.8.5.1.163.gd7aced9 + diff --git a/patches.fixes/0003-drm-gem-create-drm_gem_dumb_destroy.patch b/patches.fixes/0003-drm-gem-create-drm_gem_dumb_destroy.patch new file mode 100644 index 0000000000000..06a2312eff4e8 --- /dev/null +++ b/patches.fixes/0003-drm-gem-create-drm_gem_dumb_destroy.patch @@ -0,0 +1,43 @@ +From 5720c96c9efcaecaee29e8876c661049541eefc8 Mon Sep 17 00:00:00 2001 +From: Daniel Vetter <daniel.vetter@ffwll.ch> +Date: Sun, 2 Feb 2014 10:14:53 +0900 +Subject: drm/gem: create drm_gem_dumb_destroy + +All the gem based kms drivers really want the same function to +destroy a dumb framebuffer backing storage object. + +So give it to them and roll it out in all drivers. + +This still leaves the option open for kms drivers which don't use GEM +for backing storage, but it does decently simplify matters for gem +drivers. + +Acked-by: Inki Dae <inki.dae@samsung.com> +Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org> +Cc: Ben Skeggs <skeggsb@gmail.com> +Reviwed-by: Rob Clark <robdclark@gmail.com> +Cc: Alex Deucher <alexdeucher@gmail.com> +Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> +Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> +Signed-off-by: Dave Airlie <airlied@redhat.com> +(cherry picked from commit 43387b37fa2d0f368142b8fa8c9440da92e5381b) +Signed-off-by: Simon Horman <horms@verge.net.au> + +Conflicts: + drivers/gpu/drm/drm_gem.c +--- + drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c +@@ -169,7 +169,7 @@ static struct drm_driver rcar_du_driver + .gem_prime_export = drm_gem_cma_dmabuf_export, + .dumb_create = rcar_du_dumb_create, + .dumb_map_offset = drm_gem_cma_dumb_map_offset, +- .dumb_destroy = drm_gem_cma_dumb_destroy, ++ .dumb_destroy = drm_gem_dumb_destroy, + .fops = &rcar_du_fops, + .name = "rcar-du", + .desc = "Renesas R-Car Display Unit", diff --git a/patches.fixes/0004-drm-cma-add-low-level-hook-functions-to-use-prime-he.patch b/patches.fixes/0004-drm-cma-add-low-level-hook-functions-to-use-prime-he.patch new file mode 100644 index 0000000000000..12c65df6ed81b --- /dev/null +++ b/patches.fixes/0004-drm-cma-add-low-level-hook-functions-to-use-prime-he.patch @@ -0,0 +1,119 @@ +From 1aec88544f02dc2c28fc34658b8d4b414490d96b Mon Sep 17 00:00:00 2001 +From: Joonyoung Shim <jy0922.shim@samsung.com> +Date: Sun, 2 Feb 2014 10:14:54 +0900 +Subject: drm/cma: add low-level hook functions to use prime helpers + +Instead of using the dma_buf functionality for GEM CMA, we can use prime +helpers if we can provide low-level hook functions for GEM CMA. + +Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> +Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Signed-off-by: Dave Airlie <airlied@redhat.com> +(cherry picked from commit 78467dc5f70fb9bee4a32c0c3714c99b0b5465c7) +Signed-off-by: Simon Horman <horms@verge.net.au> +--- + drivers/gpu/drm/drm_gem_cma_helper.c | 79 +++++++++++++++++++++++++++++++++++ + include/drm/drm_gem_cma_helper.h | 9 +++ + 2 files changed, 88 insertions(+) + +--- a/drivers/gpu/drm/drm_gem_cma_helper.c ++++ b/drivers/gpu/drm/drm_gem_cma_helper.c +@@ -586,3 +586,82 @@ error_gem_free: + return ERR_PTR(ret); + } + EXPORT_SYMBOL_GPL(drm_gem_cma_dmabuf_import); ++ ++/* low-level interface prime helpers */ ++struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj) ++{ ++ struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj); ++ struct sg_table *sgt; ++ int ret; ++ ++ sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); ++ if (!sgt) ++ return NULL; ++ ++ ret = dma_get_sgtable(obj->dev->dev, sgt, cma_obj->vaddr, ++ cma_obj->paddr, obj->size); ++ if (ret < 0) ++ goto out; ++ ++ return sgt; ++ ++out: ++ kfree(sgt); ++ return NULL; ++} ++EXPORT_SYMBOL_GPL(drm_gem_cma_prime_get_sg_table); ++ ++struct drm_gem_object * ++drm_gem_cma_prime_import_sg_table(struct drm_device *dev, size_t size, ++ struct sg_table *sgt) ++{ ++ struct drm_gem_cma_object *cma_obj; ++ ++ if (sgt->nents != 1) ++ return ERR_PTR(-EINVAL); ++ ++ /* Create a CMA GEM buffer. */ ++ cma_obj = __drm_gem_cma_create(dev, size); ++ if (IS_ERR(cma_obj)) ++ return ERR_PTR(PTR_ERR(cma_obj)); ++ ++ cma_obj->paddr = sg_dma_address(sgt->sgl); ++ cma_obj->sgt = sgt; ++ ++ DRM_DEBUG_PRIME("dma_addr = 0x%x, size = %zu\n", cma_obj->paddr, size); ++ ++ return &cma_obj->base; ++} ++EXPORT_SYMBOL_GPL(drm_gem_cma_prime_import_sg_table); ++ ++int drm_gem_cma_prime_mmap(struct drm_gem_object *obj, ++ struct vm_area_struct *vma) ++{ ++ struct drm_gem_cma_object *cma_obj; ++ struct drm_device *dev = obj->dev; ++ int ret; ++ ++ mutex_lock(&dev->struct_mutex); ++ ret = drm_gem_mmap_obj(obj, obj->size, vma); ++ mutex_unlock(&dev->struct_mutex); ++ if (ret < 0) ++ return ret; ++ ++ cma_obj = to_drm_gem_cma_obj(obj); ++ return drm_gem_cma_mmap_obj(cma_obj, vma); ++} ++EXPORT_SYMBOL_GPL(drm_gem_cma_prime_mmap); ++ ++void *drm_gem_cma_prime_vmap(struct drm_gem_object *obj) ++{ ++ struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj); ++ ++ return cma_obj->vaddr; ++} ++EXPORT_SYMBOL_GPL(drm_gem_cma_prime_vmap); ++ ++void drm_gem_cma_prime_vunmap(struct drm_gem_object *obj, void *vaddr) ++{ ++ /* Nothing to do */ ++} ++EXPORT_SYMBOL_GPL(drm_gem_cma_prime_vunmap); +--- a/include/drm/drm_gem_cma_helper.h ++++ b/include/drm/drm_gem_cma_helper.h +@@ -46,4 +46,13 @@ struct dma_buf *drm_gem_cma_dmabuf_expor + struct drm_gem_object *drm_gem_cma_dmabuf_import(struct drm_device *drm_dev, + struct dma_buf *dma_buf); + ++struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj); ++struct drm_gem_object * ++drm_gem_cma_prime_import_sg_table(struct drm_device *dev, size_t size, ++ struct sg_table *sgt); ++int drm_gem_cma_prime_mmap(struct drm_gem_object *obj, ++ struct vm_area_struct *vma); ++void *drm_gem_cma_prime_vmap(struct drm_gem_object *obj); ++void drm_gem_cma_prime_vunmap(struct drm_gem_object *obj, void *vaddr); ++ + #endif /* __DRM_GEM_CMA_HELPER_H__ */ diff --git a/patches.fixes/0005-drm-cma-remove-GEM-CMA-specific-dma_buf-functionalit.patch b/patches.fixes/0005-drm-cma-remove-GEM-CMA-specific-dma_buf-functionalit.patch new file mode 100644 index 0000000000000..3570bb397736d --- /dev/null +++ b/patches.fixes/0005-drm-cma-remove-GEM-CMA-specific-dma_buf-functionalit.patch @@ -0,0 +1,327 @@ +From 16eb9670cdfb37e23ed88f81e0574194bffc786a Mon Sep 17 00:00:00 2001 +From: Joonyoung Shim <jy0922.shim@samsung.com> +Date: Sun, 2 Feb 2014 10:14:55 +0900 +Subject: drm/cma: remove GEM CMA specific dma_buf functionality + +We can use prime helpers instead. + +Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> +Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Signed-off-by: Dave Airlie <airlied@redhat.com> +(cherry picked from commit 6d35dea107834eb549c1fba28fea6ec39c81d0ba) +Signed-off-by: Simon Horman <horms@verge.net.au> + +Conflicts: + drivers/gpu/drm/drm_gem_cma_helper.c +--- + drivers/gpu/drm/drm_gem_cma_helper.c | 283 ----------------------------------- + include/drm/drm_gem_cma_helper.h | 6 + 2 files changed, 289 deletions(-) + +--- a/drivers/gpu/drm/drm_gem_cma_helper.c ++++ b/drivers/gpu/drm/drm_gem_cma_helper.c +@@ -304,289 +304,6 @@ void drm_gem_cma_describe(struct drm_gem + EXPORT_SYMBOL_GPL(drm_gem_cma_describe); + #endif + +-/* ----------------------------------------------------------------------------- +- * DMA-BUF +- */ +- +-struct drm_gem_cma_dmabuf_attachment { +- struct sg_table sgt; +- enum dma_data_direction dir; +-}; +- +-static int drm_gem_cma_dmabuf_attach(struct dma_buf *dmabuf, struct device *dev, +- struct dma_buf_attachment *attach) +-{ +- struct drm_gem_cma_dmabuf_attachment *cma_attach; +- +- cma_attach = kzalloc(sizeof(*cma_attach), GFP_KERNEL); +- if (!cma_attach) +- return -ENOMEM; +- +- cma_attach->dir = DMA_NONE; +- attach->priv = cma_attach; +- +- return 0; +-} +- +-static void drm_gem_cma_dmabuf_detach(struct dma_buf *dmabuf, +- struct dma_buf_attachment *attach) +-{ +- struct drm_gem_cma_dmabuf_attachment *cma_attach = attach->priv; +- struct sg_table *sgt; +- +- if (cma_attach == NULL) +- return; +- +- sgt = &cma_attach->sgt; +- +- if (cma_attach->dir != DMA_NONE) +- dma_unmap_sg(attach->dev, sgt->sgl, sgt->nents, +- cma_attach->dir); +- +- sg_free_table(sgt); +- kfree(cma_attach); +- attach->priv = NULL; +-} +- +-static struct sg_table * +-drm_gem_cma_dmabuf_map(struct dma_buf_attachment *attach, +- enum dma_data_direction dir) +-{ +- struct drm_gem_cma_dmabuf_attachment *cma_attach = attach->priv; +- struct drm_gem_cma_object *cma_obj = attach->dmabuf->priv; +- struct drm_device *drm = cma_obj->base.dev; +- struct scatterlist *rd, *wr; +- struct sg_table *sgt; +- unsigned int i; +- int nents, ret; +- +- DRM_DEBUG_PRIME("\n"); +- +- if (WARN_ON(dir == DMA_NONE)) +- return ERR_PTR(-EINVAL); +- +- /* Return the cached mapping when possible. */ +- if (cma_attach->dir == dir) +- return &cma_attach->sgt; +- +- /* Two mappings with different directions for the same attachment are +- * not allowed. +- */ +- if (WARN_ON(cma_attach->dir != DMA_NONE)) +- return ERR_PTR(-EBUSY); +- +- sgt = &cma_attach->sgt; +- +- ret = sg_alloc_table(sgt, cma_obj->sgt->orig_nents, GFP_KERNEL); +- if (ret) { +- DRM_ERROR("failed to alloc sgt.\n"); +- return ERR_PTR(-ENOMEM); +- } +- +- mutex_lock(&drm->struct_mutex); +- +- rd = cma_obj->sgt->sgl; +- wr = sgt->sgl; +- for (i = 0; i < sgt->orig_nents; ++i) { +- sg_set_page(wr, sg_page(rd), rd->length, rd->offset); +- rd = sg_next(rd); +- wr = sg_next(wr); +- } +- +- nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); +- if (!nents) { +- DRM_ERROR("failed to map sgl with iommu.\n"); +- sg_free_table(sgt); +- sgt = ERR_PTR(-EIO); +- goto done; +- } +- +- cma_attach->dir = dir; +- attach->priv = cma_attach; +- +- DRM_DEBUG_PRIME("buffer size = %zu\n", cma_obj->base.size); +- +-done: +- mutex_unlock(&drm->struct_mutex); +- return sgt; +-} +- +-static void drm_gem_cma_dmabuf_unmap(struct dma_buf_attachment *attach, +- struct sg_table *sgt, +- enum dma_data_direction dir) +-{ +- /* Nothing to do. */ +-} +- +-static void drm_gem_cma_dmabuf_release(struct dma_buf *dmabuf) +-{ +- struct drm_gem_cma_object *cma_obj = dmabuf->priv; +- +- DRM_DEBUG_PRIME("%s\n", __FILE__); +- +- /* +- * drm_gem_cma_dmabuf_release() call means that file object's +- * f_count is 0 and it calls drm_gem_object_handle_unreference() +- * to drop the references that these values had been increased +- * at drm_prime_handle_to_fd() +- */ +- if (cma_obj->base.export_dma_buf == dmabuf) { +- cma_obj->base.export_dma_buf = NULL; +- +- /* +- * drop this gem object refcount to release allocated buffer +- * and resources. +- */ +- drm_gem_object_unreference_unlocked(&cma_obj->base); +- } +-} +- +-static void *drm_gem_cma_dmabuf_kmap_atomic(struct dma_buf *dmabuf, +- unsigned long page_num) +-{ +- /* TODO */ +- +- return NULL; +-} +- +-static void drm_gem_cma_dmabuf_kunmap_atomic(struct dma_buf *dmabuf, +- unsigned long page_num, void *addr) +-{ +- /* TODO */ +-} +- +-static void *drm_gem_cma_dmabuf_kmap(struct dma_buf *dmabuf, +- unsigned long page_num) +-{ +- /* TODO */ +- +- return NULL; +-} +- +-static void drm_gem_cma_dmabuf_kunmap(struct dma_buf *dmabuf, +- unsigned long page_num, void *addr) +-{ +- /* TODO */ +-} +- +-static int drm_gem_cma_dmabuf_mmap(struct dma_buf *dmabuf, +- struct vm_area_struct *vma) +-{ +- struct drm_gem_cma_object *cma_obj = dmabuf->priv; +- struct drm_gem_object *gem_obj = &cma_obj->base; +- int ret; +- +- ret = drm_gem_mmap_obj(gem_obj, gem_obj->size, vma); +- if (ret < 0) +- return ret; +- +- return drm_gem_cma_mmap_obj(cma_obj, vma); +-} +- +-static void *drm_gem_cma_dmabuf_vmap(struct dma_buf *dmabuf) +-{ +- struct drm_gem_cma_object *cma_obj = dmabuf->priv; +- +- return cma_obj->vaddr; +-} +- +-static struct dma_buf_ops drm_gem_cma_dmabuf_ops = { +- .attach = drm_gem_cma_dmabuf_attach, +- .detach = drm_gem_cma_dmabuf_detach, +- .map_dma_buf = drm_gem_cma_dmabuf_map, +- .unmap_dma_buf = drm_gem_cma_dmabuf_unmap, +- .kmap = drm_gem_cma_dmabuf_kmap, +- .kmap_atomic = drm_gem_cma_dmabuf_kmap_atomic, +- .kunmap = drm_gem_cma_dmabuf_kunmap, +- .kunmap_atomic = drm_gem_cma_dmabuf_kunmap_atomic, +- .mmap = drm_gem_cma_dmabuf_mmap, +- .vmap = drm_gem_cma_dmabuf_vmap, +- .release = drm_gem_cma_dmabuf_release, +-}; +- +-struct dma_buf *drm_gem_cma_dmabuf_export(struct drm_device *drm, +- struct drm_gem_object *obj, int flags) +-{ +- struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj); +- +- return dma_buf_export(cma_obj, &drm_gem_cma_dmabuf_ops, +- cma_obj->base.size, flags); +-} +-EXPORT_SYMBOL_GPL(drm_gem_cma_dmabuf_export); +- +-struct drm_gem_object *drm_gem_cma_dmabuf_import(struct drm_device *drm, +- struct dma_buf *dma_buf) +-{ +- struct drm_gem_cma_object *cma_obj; +- struct dma_buf_attachment *attach; +- struct sg_table *sgt; +- int ret; +- +- DRM_DEBUG_PRIME("%s\n", __FILE__); +- +- /* is this one of own objects? */ +- if (dma_buf->ops == &drm_gem_cma_dmabuf_ops) { +- struct drm_gem_object *obj; +- +- cma_obj = dma_buf->priv; +- obj = &cma_obj->base; +- +- /* is it from our device? */ +- if (obj->dev == drm) { +- /* +- * Importing dmabuf exported from out own gem increases +- * refcount on gem itself instead of f_count of dmabuf. +- */ +- drm_gem_object_reference(obj); +- dma_buf_put(dma_buf); +- return obj; +- } +- } +- +- /* Create a CMA GEM buffer. */ +- cma_obj = __drm_gem_cma_create(drm, dma_buf->size); +- if (IS_ERR(cma_obj)) +- return ERR_PTR(PTR_ERR(cma_obj)); +- +- /* Attach to the buffer and map it. Make sure the mapping is contiguous +- * on the device memory bus, as that's all we support. +- */ +- attach = dma_buf_attach(dma_buf, drm->dev); +- if (IS_ERR(attach)) { +- ret = -EINVAL; +- goto error_gem_free; +- } +- +- sgt = dma_buf_map_attachment(attach, DMA_BIDIRECTIONAL); +- if (IS_ERR_OR_NULL(sgt)) { +- ret = sgt ? PTR_ERR(sgt) : -ENOMEM; +- goto error_buf_detach; +- } +- +- if (sgt->nents != 1) { +- ret = -EINVAL; +- goto error_buf_unmap; +- } +- +- cma_obj->base.import_attach = attach; +- cma_obj->paddr = sg_dma_address(sgt->sgl); +- cma_obj->sgt = sgt; +- +- DRM_DEBUG_PRIME("dma_addr = 0x%x, size = %zu\n", cma_obj->paddr, +- dma_buf->size); +- +- return &cma_obj->base; +- +-error_buf_unmap: +- dma_buf_unmap_attachment(attach, sgt, DMA_BIDIRECTIONAL); +-error_buf_detach: +- dma_buf_detach(dma_buf, attach); +-error_gem_free: +- drm_gem_cma_free_object(&cma_obj->base); +- return ERR_PTR(ret); +-} +-EXPORT_SYMBOL_GPL(drm_gem_cma_dmabuf_import); +- + /* low-level interface prime helpers */ + struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj) + { +--- a/include/drm/drm_gem_cma_helper.h ++++ b/include/drm/drm_gem_cma_helper.h +@@ -40,12 +40,6 @@ extern const struct vm_operations_struct + void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m); + #endif + +-struct dma_buf *drm_gem_cma_dmabuf_export(struct drm_device *drm_dev, +- struct drm_gem_object *obj, +- int flags); +-struct drm_gem_object *drm_gem_cma_dmabuf_import(struct drm_device *drm_dev, +- struct dma_buf *dma_buf); +- + struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj); + struct drm_gem_object * + drm_gem_cma_prime_import_sg_table(struct drm_device *dev, size_t size, diff --git a/patches.fixes/0006-drm-add-mmap-function-to-prime-helpers.patch b/patches.fixes/0006-drm-add-mmap-function-to-prime-helpers.patch new file mode 100644 index 0000000000000..65b82ef81b228 --- /dev/null +++ b/patches.fixes/0006-drm-add-mmap-function-to-prime-helpers.patch @@ -0,0 +1,45 @@ +From e1cc9ddba7d43e584a4f0a5cebf984c61d586235 Mon Sep 17 00:00:00 2001 +From: Joonyoung Shim <jy0922.shim@samsung.com> +Date: Sun, 2 Feb 2014 10:14:56 +0900 +Subject: drm: add mmap function to prime helpers + +This adds to call low-level mmap() from prime helpers. + +Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> +Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> +Signed-off-by: Dave Airlie <airlied@redhat.com> +(cherry picked from commit 7c397cd97b8f46659698396b420bd48c3e6703e6) +Signed-off-by: Simon Horman <horms@verge.net.au> +--- + drivers/gpu/drm/drm_prime.c | 8 +++++++- + include/drm/drmP.h | 2 ++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/drm_prime.c ++++ b/drivers/gpu/drm/drm_prime.c +@@ -155,7 +155,13 @@ static void drm_gem_dmabuf_kunmap(struct + static int drm_gem_dmabuf_mmap(struct dma_buf *dma_buf, + struct vm_area_struct *vma) + { +- return -EINVAL; ++ struct drm_gem_object *obj = dma_buf->priv; ++ struct drm_device *dev = obj->dev; ++ ++ if (!dev->driver->gem_prime_mmap) ++ return -ENOSYS; ++ ++ return dev->driver->gem_prime_mmap(obj, vma); + } + + static const struct dma_buf_ops drm_gem_prime_dmabuf_ops = { +--- a/include/drm/drmP.h ++++ b/include/drm/drmP.h +@@ -950,6 +950,8 @@ struct drm_driver { + struct sg_table *sgt); + void *(*gem_prime_vmap)(struct drm_gem_object *obj); + void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); ++ int (*gem_prime_mmap)(struct drm_gem_object *obj, ++ struct vm_area_struct *vma); + + /* vga arb irq handler */ + void (*vgaarb_irq)(struct drm_device *dev, bool state); diff --git a/patches.fixes/0007-drm-rcar-du-Use-the-GEM-PRIME-helpers.patch b/patches.fixes/0007-drm-rcar-du-Use-the-GEM-PRIME-helpers.patch new file mode 100644 index 0000000000000..fb81c7c4541c4 --- /dev/null +++ b/patches.fixes/0007-drm-rcar-du-Use-the-GEM-PRIME-helpers.patch @@ -0,0 +1,36 @@ +From d2481ca579b9e70b402f1a2cb6affc71e7c080b1 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> +Date: Sun, 2 Feb 2014 10:14:57 +0900 +Subject: drm/rcar-du: Use the GEM PRIME helpers + +The GEM CMA PRIME import/export helpers have been removed in favor of +generic GEM PRIME helpers with GEM CMA low-level operations. Fix the +driver accordingly. + +Reported-by: Mark Brown <broonie@linaro.org> +Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> +Tested-by: Mark Brown <broonie@linaro.org> +(cherry picked from commit ffb40400762d86a34318160e8f2169b66f01473d) +Signed-off-by: Simon Horman <horms@verge.net.au> +--- + drivers/gpu/drm/rcar-du/rcar_du_drv.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c ++++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c +@@ -165,8 +165,13 @@ static struct drm_driver rcar_du_driver + .gem_vm_ops = &drm_gem_cma_vm_ops, + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, +- .gem_prime_import = drm_gem_cma_dmabuf_import, +- .gem_prime_export = drm_gem_cma_dmabuf_export, ++ .gem_prime_import = drm_gem_prime_import, ++ .gem_prime_export = drm_gem_prime_export, ++ .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table, ++ .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table, ++ .gem_prime_vmap = drm_gem_cma_prime_vmap, ++ .gem_prime_vunmap = drm_gem_cma_prime_vunmap, ++ .gem_prime_mmap = drm_gem_cma_prime_mmap, + .dumb_create = rcar_du_dumb_create, + .dumb_map_offset = drm_gem_cma_dumb_map_offset, + .dumb_destroy = drm_gem_dumb_destroy, diff --git a/patches.fixes/0008-fb-make-fp_get_options-name-argument-const.patch b/patches.fixes/0008-fb-make-fp_get_options-name-argument-const.patch new file mode 100644 index 0000000000000..3438450a42256 --- /dev/null +++ b/patches.fixes/0008-fb-make-fp_get_options-name-argument-const.patch @@ -0,0 +1,54 @@ +From 1d3b7bbf9388e6128739af92de971c7466b38eeb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@freescale.com> +Date: Sun, 2 Feb 2014 10:14:58 +0900 +Subject: fb: make fp_get_options name argument const +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +drm_get_connector_name now returns a const value, which causes the following +compilation warning: + + drivers/gpu/drm/drm_fb_helper.c: In function ‘drm_fb_helper_parse_command_line’: + drivers/gpu/drm/drm_fb_helper.c:127:3: warning: passing argument 1 of ‘fb_get_options’ discards ‘const’ qualifier from pointer target type [enabled by default] + In file included from drivers/gpu/drm/drm_fb_helper.c:35:0: + include/linux/fb.h:627:12: note: expected ‘char *’ but argument is of type ‘const char *’ + +As fb_get_options uses its name argument as read only, make it const. This +fixes the aforementioned compilation warning. + +Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com> +Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> +Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> +Cc: Dave Airlie <airlied@redhat.com> +Cc: trivial@kernel.org +Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> +(cherry picked from commit a66e62ae56307e587e93d7ed4d83ea34c71d2eb9) +Signed-off-by: Simon Horman <horms@verge.net.au> +--- + drivers/video/fbmem.c | 2 +- + include/linux/fb.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/video/fbmem.c ++++ b/drivers/video/fbmem.c +@@ -1881,7 +1881,7 @@ static int ofonly __read_mostly; + * + * NOTE: Needed to maintain backwards compatibility + */ +-int fb_get_options(char *name, char **option) ++int fb_get_options(const char *name, char **option) + { + char *opt, *options = NULL; + int retval = 0; +--- a/include/linux/fb.h ++++ b/include/linux/fb.h +@@ -624,7 +624,7 @@ extern void fb_pad_aligned_buffer(u8 *ds + extern void fb_set_suspend(struct fb_info *info, int state); + extern int fb_get_color_depth(struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix); +-extern int fb_get_options(char *name, char **option); ++extern int fb_get_options(const char *name, char **option); + extern int fb_new_modelist(struct fb_info *info); + + extern struct fb_info *registered_fb[FB_MAX]; diff --git a/patches.fixes/0009-ARM-shmobile-r7s72100-Genmai-DT-reference-DTS-bits.patch b/patches.fixes/0009-ARM-shmobile-r7s72100-Genmai-DT-reference-DTS-bits.patch new file mode 100644 index 0000000000000..cf206662d966b --- /dev/null +++ b/patches.fixes/0009-ARM-shmobile-r7s72100-Genmai-DT-reference-DTS-bits.patch @@ -0,0 +1,61 @@ +From 2bc433de831273d32b15c0f0ed56e2fe602750c9 Mon Sep 17 00:00:00 2001 +From: Magnus Damm <damm@opensource.se> +Date: Sun, 2 Feb 2014 10:14:59 +0900 +Subject: ARM: shmobile: r7s72100 Genmai DT reference DTS bits + +Add the DT bits for r7s72100 Genmai DT reference support. + +Signed-off-by: Magnus Damm <damm@opensource.se> +Signed-off-by: Simon Horman <horms+renesas@verge.net.au> +(cherry picked from commit 495e06d1daff7f59b511c27c95d2601c1d9dad49) +Signed-off-by: Simon Horman <horms+renesas@verge.net.au> +--- + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/r7s72100-genmai-reference.dts | 31 ++++++++++++++++++++++++ + 2 files changed, 32 insertions(+) + create mode 100644 arch/arm/boot/dts/r7s72100-genmai-reference.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -161,6 +161,7 @@ dtb-$(CONFIG_ARCH_U8500) += snowball.dtb + ccu9540.dtb + dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += emev2-kzm9d.dtb \ + r7s72100-genmai.dtb \ ++ r7s72100-genmai-reference.dtb \ + r8a7740-armadillo800eva.dtb \ + r8a7778-bockw.dtb \ + r8a7778-bockw-reference.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts +@@ -0,0 +1,31 @@ ++/* ++ * Device Tree Source for the Genmai board ++ * ++ * Copyright (C) 2013 Renesas Solutions Corp. ++ * ++ * This file is licensed under the terms of the GNU General Public License ++ * version 2. This program is licensed "as is" without any warranty of any ++ * kind, whether express or implied. ++ */ ++ ++/dts-v1/; ++/include/ "r7s72100.dtsi" ++ ++/ { ++ model = "Genmai"; ++ compatible = "renesas,genmai-reference", "renesas,r7s72100"; ++ ++ chosen { ++ bootargs = "console=ttySC2,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp"; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x08000000 0x08000000>; ++ }; ++ ++ lbsc { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ }; ++}; diff --git a/patches.fixes/0010-i2c-mv64xxx-Do-not-use-writel_relaxed.patch b/patches.fixes/0010-i2c-mv64xxx-Do-not-use-writel_relaxed.patch new file mode 100644 index 0000000000000..e971ffbbba8fa --- /dev/null +++ b/patches.fixes/0010-i2c-mv64xxx-Do-not-use-writel_relaxed.patch @@ -0,0 +1,32 @@ +From 230324471b5993556c4c60097961d4d94c8cedef Mon Sep 17 00:00:00 2001 +From: Thierry Reding <thierry.reding@gmail.com> +Date: Sun, 2 Feb 2014 10:15:00 +0900 +Subject: i2c: mv64xxx: Do not use writel_relaxed() + +The driver is used on PowerPC which don't provide writel_relaxed(). This +breaks the c2k and prpmc2800 default configurations. To fix the build, +turn the calls to writel_relaxed() into writel(). The impacts for ARM +should be minimal. + +Signed-off-by: Thierry Reding <treding@nvidia.com> +Signed-off-by: Wolfram Sang <wsa@the-dreams.de> +(cherry picked from commit 85b3a9356e84f683dd27fe8b73ad15608b4fc2c5) +Signed-off-by: Simon Horman <horms+renesas@verge.net.au> +--- + drivers/i2c/busses/i2c-mv64xxx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/i2c/busses/i2c-mv64xxx.c ++++ b/drivers/i2c/busses/i2c-mv64xxx.c +@@ -234,9 +234,9 @@ static int mv64xxx_i2c_offload_msg(struc + ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_WR | + (msg->len - 1) << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT; + +- writel_relaxed(data_reg_lo, ++ writel(data_reg_lo, + drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_LO); +- writel_relaxed(data_reg_hi, ++ writel(data_reg_hi, + drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_HI); + + } else { @@ -2561,4 +2561,13 @@ patches.minnowboard/0004-minnowboard-keys-Bind-MinnowBoard-buttons-to-arrow-k.pa ############################################################################# # fixes that go after all of the above # - +patches.fixes/0001-drm-remove-FASYNC-support.patch +patches.fixes/0002-drm-Pass-page-flip-ioctl-flags-to-driver.patch +patches.fixes/0003-drm-gem-create-drm_gem_dumb_destroy.patch +patches.fixes/0004-drm-cma-add-low-level-hook-functions-to-use-prime-he.patch +patches.fixes/0005-drm-cma-remove-GEM-CMA-specific-dma_buf-functionalit.patch +patches.fixes/0006-drm-add-mmap-function-to-prime-helpers.patch +patches.fixes/0007-drm-rcar-du-Use-the-GEM-PRIME-helpers.patch +patches.fixes/0008-fb-make-fp_get_options-name-argument-const.patch +patches.fixes/0009-ARM-shmobile-r7s72100-Genmai-DT-reference-DTS-bits.patch +patches.fixes/0010-i2c-mv64xxx-Do-not-use-writel_relaxed.patch |