All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/etnaviv: init DMA ops for virtual master device
@ 2018-03-22 10:43 Lucas Stach
  2018-03-24  1:43 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2018-03-22 10:43 UTC (permalink / raw)
  To: etnaviv, dri-devel; +Cc: patchwork-lst, kernel, Russell King

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 <l.stach@pengutronix.de>
---
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 = &pdev->dev;
 	struct component_match *match = NULL;
 
-	dma_set_coherent_mask(&pdev->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 = &etnaviv_dmamask;
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+		arch_setup_dma_ops(&pdev->dev, 0, 0x100000000, 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/etnaviv: init DMA ops for virtual master device
  2018-03-22 10:43 [PATCH v2] drm/etnaviv: init DMA ops for virtual master device Lucas Stach
@ 2018-03-24  1:43 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2018-03-24  1:43 UTC (permalink / raw)
  To: Lucas Stach
  Cc: etnaviv, dri-devel, patchwork-lst, kbuild-all, kernel, Russell King

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

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 infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43512 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-24  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 10:43 [PATCH v2] drm/etnaviv: init DMA ops for virtual master device Lucas Stach
2018-03-24  1:43 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.