drm/komeda: fixing of DMA mapping sg segment warning
authorLowry Li (Arm Technology China) <Lowry.Li@arm.com>
Thu, 11 Apr 2019 08:37:13 +0000 (09:37 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Tue, 4 Jun 2019 14:12:44 +0000 (15:12 +0100)
Fixing the DMA mapping sg segment warning, which shows "DMA-API: mapping
sg segment longer than device claims to support [len=921600] [max=65536]".
Fixed by setting the max segment size at Komeda driver.

This patch depends on:
- https://patchwork.freedesktop.org/series/54448/
- https://patchwork.freedesktop.org/series/54449/
- https://patchwork.freedesktop.org/series/54450/
- https://patchwork.freedesktop.org/series/58976/

Changes since v1:
- Adds member description
- Adds patch denpendency in the comment

Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Reviewed-by: Ayan Kumar Halder <ayan.halder@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
drivers/gpu/drm/arm/display/komeda/komeda_dev.c
drivers/gpu/drm/arm/display/komeda/komeda_dev.h

index d7527e1266580baca1bf87c5c74e8771d7ae108f..b67030a9f05684d120b9458a22a75cd8a322be49 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/of_device.h>
 #include <linux/of_graph.h>
 #include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
@@ -249,6 +250,9 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
                goto err_cleanup;
        }
 
+       dev->dma_parms = &mdev->dma_parms;
+       dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
+
        err = sysfs_create_group(&dev->kobj, &komeda_sysfs_attr_group);
        if (err) {
                DRM_ERROR("create sysfs group failed.\n");
index 994c6ea3039b9848895139ab7d5368aa27d8163a..973fd5e0eb98ef5fbd897a8a398410673d8b345a 100644 (file)
@@ -149,6 +149,8 @@ struct komeda_dev {
        struct device *dev;
        /** @reg_base: the base address of komeda io space */
        u32 __iomem   *reg_base;
+       /** @dma_parms: the dma parameters of komeda */
+       struct device_dma_parameters dma_parms;
 
        /** @chip: the basic chip information */
        struct komeda_chip_info chip;