Re: [PATCH v2] drm/etnaviv: init DMA ops for virtual master device

2018-03-23 Thread kbuild test robot
Hi Lucas,

I love your patch! Yet something to improve:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on next-20180323]
[cannot apply to v4.16-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Lucas-Stach/drm-etnaviv-init-DMA-ops-for-virtual-master-device/20180324-045537
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: arm-multi_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> ERROR: "arch_setup_dma_ops" [drivers/gpu/drm/etnaviv/etnaviv.ko] undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2] drm/etnaviv: init DMA ops for virtual master device

2018-03-22 Thread Lucas Stach
All the DRM GEM dma-buf import/export operations are done through the
virtual DRM master device. As this isn't instanciated from DT anymore
we need to make sure the DMA ops are set up correctly.

Signed-off-by: Lucas Stach 
---
v2: Create device with correct DMA mask/ops, instead of fixing up in
probe function.
---
 drivers/gpu/drm/etnaviv/etnaviv_drv.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c 
b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index ab50090d066c..31c49a7bc93f 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -655,8 +655,6 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
struct device *dev = >dev;
struct component_match *match = NULL;
 
-   dma_set_coherent_mask(>dev, DMA_BIT_MASK(32));
-
if (!dev->platform_data) {
struct device_node *core_node;
 
@@ -693,6 +691,8 @@ static struct platform_driver etnaviv_platform_driver = {
},
 };
 
+static u64 etnaviv_dmamask = DMA_BIT_MASK(32);
+
 static int __init etnaviv_init(void)
 {
int ret;
@@ -713,10 +713,16 @@ static int __init etnaviv_init(void)
 * the DRM platform device.
 */
for_each_compatible_node(np, NULL, "vivante,gc") {
+   struct platform_device *pdev;
+
if (!of_device_is_available(np))
continue;
 
-   platform_device_register_simple("etnaviv", -1, NULL, 0);
+   pdev = platform_device_register_simple("etnaviv", -1, NULL, 0);
+   pdev->dev.dma_mask = _dmamask;
+   pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+   arch_setup_dma_ops(>dev, 0, 0x1, NULL, false);
+
of_node_put(np);
break;
}
-- 
2.16.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel