Re: [PATCHv<8> 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite

2018-01-16 Thread kbuild test robot
Hi Ong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.15-rc8 next-20180116]
[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/Hean-Loong-Ong/Intel-FPGA-Video-and-Image-Processing-Suite/20180117-103626
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 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=ia64 

All error/warnings (new ones prefixed by >>):

   In file included from include/linux/cdev.h:8:0,
from include/drm/drmP.h:36,
from drivers/gpu/drm/ivip/intel_vip_core.c:24:
   drivers/gpu/drm/ivip/intel_vip_core.c: In function 'intelvipfb_enable':
>> drivers/gpu/drm/ivip/intel_vip_core.c:57:33: warning: format '%x' expects 
>> argument of type 'unsigned int', but argument 3 has type 'dma_addr_t {aka 
>> long long unsigned int}' [-Wformat=]
 dev_info(pipe->plane.dev->dev, "Address 0x%x\n", addr);
^
   include/linux/device.h:1355:51: note: in definition of macro 'dev_info'
#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
  ^~~
   drivers/gpu/drm/ivip/intel_vip_core.c: At top level:
>> drivers/gpu/drm/ivip/intel_vip_core.c:76:15: error: 'drm_fb_cma_create' 
>> undeclared here (not in a function); did you mean 'drm_gem_cma_create'?
 .fb_create = drm_fb_cma_create,
  ^
  drm_gem_cma_create
   drivers/gpu/drm/ivip/intel_vip_core.c: In function 
'intelvipfb_pipe_prepare_fb':
>> drivers/gpu/drm/ivip/intel_vip_core.c:90:9: error: implicit declaration of 
>> function 'drm_fb_cma_prepare_fb'; did you mean 'drm_fb_cma_get_gem_obj'? 
>> [-Werror=implicit-function-declaration]
 return drm_fb_cma_prepare_fb(>plane, plane_state);
^
drm_fb_cma_get_gem_obj
   cc1: some warnings being treated as errors

vim +76 drivers/gpu/drm/ivip/intel_vip_core.c

  > 24  #include 
25  #include 
26  #include 
27  #include 
28  #include 
29  #include 
30  #include 
31  #include 
32  #include 
33  
34  #include 
35  #include 
36  #include 
37  
38  #include "intel_vip_drv.h"
39  
40  static void intelvipfb_enable(struct drm_simple_display_pipe *pipe,
41 struct drm_crtc_state *crtc_state)
42  {
43  /*
44   * The frameinfo variable has to correspond to the size of the 
VIP Suite
45   * Frame Reader register 7 which will determine the maximum 
size used
46   * in this frameinfo
47   */
48  
49  u32 frameinfo;
50  struct intelvipfb_priv *priv = pipe->plane.dev->dev_private;
51  void __iomem *base = priv->base;
52  struct drm_plane_state *state = pipe->plane.state;
53  dma_addr_t addr;
54  
55  addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
56  
  > 57  dev_info(pipe->plane.dev->dev, "Address 0x%x\n", addr);
58  
59  frameinfo =
60  readl(base + INTELVIPFB_FRAME_READER) & 0x00ff;
61  writel(frameinfo, base + INTELVIPFB_FRAME_INFO);
62  writel(addr, base + INTELVIPFB_FRAME_START);
63  /* Finally set the control register to 1 to start streaming */
64  writel(1, base + INTELVIPFB_CONTROL);
65  }
66  
67  static void intelvipfb_disable(struct drm_simple_display_pipe *pipe)
68  {
69  struct intelvipfb_priv *priv = pipe->plane.dev->dev_private;
70  void __iomem *base = priv->base;
71  /* set the control register to 0 to stop streaming */
72  writel(0, base + INTELVIPFB_CONTROL);
73  }
74  
75  static const struct drm_mode_config_funcs intelvipfb_mode_config_funcs 
= {
  > 76  .fb_create = drm_fb_cma_create,
77  .atomic_check = drm_atomic_helper_check,
78  .atomic_commit = drm_atomic_helper_commit,
79  };
80  
81  static void intelvipfb_setup_mode_config(struct drm_device *drm)
82  {
83  drm_mode_config_init(drm);
84  drm->mode_config.funcs = _mode_config_funcs;
85  }
86  
87  static int intelvipfb_pipe_prepare_fb(struct drm_simple_display_pipe 
*pipe,
88  struct drm_plane_state 
*plane_state)
89  {
  > 90  return drm_fb_cma_prepare_fb(>plane, plane_state);
91  }
92  

---
0-DAY kernel test infrastructure

[PATCHv<8> 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite

2018-01-15 Thread Hean-Loong, Ong
From: Ong Hean Loong 

Driver for Intel FPGA Video and Image Processing Suite Frame Buffer II.
The driver only supports the Intel Arria10 devkit and its variants.
This driver can be either loaded staticlly or in modules.
The OF device tree binding is located at:
Documentation/devicetree/bindings/display/altr,vip-fb2.txt

Signed-off-by: Ong Hean Loong 
---
 drivers/gpu/drm/Kconfig   |2 +
 drivers/gpu/drm/Makefile  |1 +
 drivers/gpu/drm/ivip/Kconfig  |   14 +++
 drivers/gpu/drm/ivip/Makefile |9 ++
 drivers/gpu/drm/ivip/intel_vip_conn.c |   95 
 drivers/gpu/drm/ivip/intel_vip_core.c |  162 +++
 drivers/gpu/drm/ivip/intel_vip_drv.h  |   52 +
 drivers/gpu/drm/ivip/intel_vip_of.c   |  193 +
 8 files changed, 528 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/ivip/Kconfig
 create mode 100644 drivers/gpu/drm/ivip/Makefile
 create mode 100644 drivers/gpu/drm/ivip/intel_vip_conn.c
 create mode 100644 drivers/gpu/drm/ivip/intel_vip_core.c
 create mode 100644 drivers/gpu/drm/ivip/intel_vip_drv.h
 create mode 100644 drivers/gpu/drm/ivip/intel_vip_of.c

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 83cb2a8..38a184d 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -195,6 +195,8 @@ source "drivers/gpu/drm/nouveau/Kconfig"
 
 source "drivers/gpu/drm/i915/Kconfig"
 
+source "drivers/gpu/drm/ivip/Kconfig"
+
 config DRM_VGEM
tristate "Virtual GEM provider"
depends on DRM
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 8ce0703..f7a57f5 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_DRM_AMDGPU)+= amd/amdgpu/
 obj-$(CONFIG_DRM_MGA)  += mga/
 obj-$(CONFIG_DRM_I810) += i810/
 obj-$(CONFIG_DRM_I915) += i915/
+obj-$(CONFIG_DRM_IVIP) += ivip/
 obj-$(CONFIG_DRM_MGAG200) += mgag200/
 obj-$(CONFIG_DRM_VC4)  += vc4/
 obj-$(CONFIG_DRM_CIRRUS_QEMU) += cirrus/
diff --git a/drivers/gpu/drm/ivip/Kconfig b/drivers/gpu/drm/ivip/Kconfig
new file mode 100644
index 000..1d08b90
--- /dev/null
+++ b/drivers/gpu/drm/ivip/Kconfig
@@ -0,0 +1,14 @@
+config DRM_IVIP
+tristate "Intel FGPA Video and Image Processing"
+depends on DRM && OF
+select DRM_GEM_CMA_HELPER
+select DRM_KMS_HELPER
+select DRM_KMS_FB_HELPER
+select DRM_KMS_CMA_HELPER
+help
+ Choose this option if you have an Intel FPGA Arria 10 system
+ and above with an Intel Display Port IP. This does not support
+ legacy Intel FPGA Cyclone V display port. Currently only 
single
+ frame buffer is supported. Note that ACPI and X_86 
architecture
+ is not supported for Arria10. If M is selected the module 
will be
+ called ivip.
diff --git a/drivers/gpu/drm/ivip/Makefile b/drivers/gpu/drm/ivip/Makefile
new file mode 100644
index 000..cc55b04
--- /dev/null
+++ b/drivers/gpu/drm/ivip/Makefile
@@ -0,0 +1,9 @@
+#
+# Makefile for the drm device driver.  This driver provides support for the
+# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
+
+ccflags-y := -Iinclude/drm
+
+obj-$(CONFIG_DRM_IVIP) += ivip.o
+ivip-objs := intel_vip_of.o intel_vip_core.o \
+   intel_vip_conn.o
diff --git a/drivers/gpu/drm/ivip/intel_vip_conn.c 
b/drivers/gpu/drm/ivip/intel_vip_conn.c
new file mode 100644
index 000..46bb04c
--- /dev/null
+++ b/drivers/gpu/drm/ivip/intel_vip_conn.c
@@ -0,0 +1,95 @@
+/*
+ * intel_vip_conn.c -- Intel Video and Image Processing(VIP)
+ * Frame Buffer II driver
+ *
+ * This driver supports the Intel VIP Frame Reader component.
+ * More info on the hardware can be found in the Intel Video
+ * and Image Processing Suite User Guide at this address
+ * http://www.altera.com/literature/ug/ug_vip.pdf.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * Authors:
+ * Ong, Hean-Loong 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static enum drm_connector_status
+intelvipfb_drm_connector_detect(struct drm_connector *connector, bool force)
+{
+   return connector_status_connected;
+}
+
+static void intelvipfb_drm_connector_destroy(struct drm_connector *connector)
+{
+   drm_connector_unregister(connector);
+   drm_connector_cleanup(connector);
+}
+
+static const struct drm_connector_funcs