Re: [PATCH 14/22] drm/sun4i: Use simple encoder

2020-03-06 Thread kbuild test robot
Hi Thomas,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200305]
[cannot apply to rockchip/for-next shawnguo/for-next sunxi/sunxi/for-next 
tegra/for-next linus/master v5.6-rc4 v5.6-rc3 v5.6-rc2 v5.6-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Thomas-Zimmermann/drm-Convert-drivers-to-drm_simple_encoder_init/20200306-045931
base:47466dcf84ee66a973ea7d2fca7e582fe9328932
config: arm64-defconfig (attached as .config)
compiler: clang version 11.0.0 (git://gitmirror/llvm_project 
a0cd413426479abb207381bdbab862f3dfb3ce7d)
reproduce:
# FIXME the reproduce steps for clang is not ready yet

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/sun4i/sun4i_lvds.c:121:8: error: implicit declaration of 
>> function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
   ret = drm_simple_encoder_init(drm, >encoder,
 ^
   drivers/gpu/drm/sun4i/sun4i_lvds.c:121:8: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.
--
>> drivers/gpu/drm/sun4i/sun4i_rgb.c:213:8: error: implicit declaration of 
>> function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
   ret = drm_simple_encoder_init(drm, >encoder,
 ^
   drivers/gpu/drm/sun4i/sun4i_rgb.c:213:8: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.
--
>> drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c:611:8: error: implicit declaration of 
>> function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
   ret = drm_simple_encoder_init(drm, >encoder,
 ^
   drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c:611:8: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.
--
>> drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c:220:2: error: implicit declaration of 
>> function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
   drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
   ^
   drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c:220:2: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.
--
>> drivers/gpu/drm/sun4i/sun4i_tv.c:587:8: error: implicit declaration of 
>> function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
   ret = drm_simple_encoder_init(drm, >encoder,
 ^
   drivers/gpu/drm/sun4i/sun4i_tv.c:587:8: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.
--
>> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:1062:8: error: implicit declaration 
>> of function 'drm_simple_encoder_init' 
>> [-Werror,-Wimplicit-function-declaration]
   ret = drm_simple_encoder_init(drm, >encoder,
 ^
   drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:1062:8: note: did you mean 
'drm_encoder_init'?
   include/drm/drm_encoder.h:189:5: note: 'drm_encoder_init' declared here
   int drm_encoder_init(struct drm_device *dev,
   ^
   1 error generated.

vim +/drm_simple_encoder_init +121 drivers/gpu/drm/sun4i/sun4i_lvds.c

99  
   100  int sun4i_lvds_init(struct drm_device *drm, struct sun4i_tcon *tcon)
   101  {
   102  struct drm_encoder *encoder;
   103  struct drm_bridge *bridge;
   104  struct sun4i_lvds *lvds;
   105  int ret;
   106  
   107  lvds = devm_kzalloc(drm->dev, sizeof(*lvds), GFP_KERNEL);
   108  if (!lvds)
   109  return -ENOMEM;
   110  encoder = >encoder;
   111  
   112  ret = drm_of_find_panel_or_bridge(tcon->dev->of_node, 1, 0,
   113>panel, );
   114  if (ret) {
   115  dev_info(drm->dev, "No panel or bridge found... LVDS 
output disabled\n");
   116  return 0;
   117  }
   118  
   119  drm_encoder_helper_add(>encoder,
   120 _lvds_enc_helper_funcs);
 > 121  ret = drm_simple_encoder_init(drm, >encoder,

---
0-DAY CI Kernel Test Service, Intel Corporation

[PATCH 14/22] drm/sun4i: Use simple encoder

2020-03-05 Thread Thomas Zimmermann
The ingenic driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann 
---
 drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 12 +++-
 drivers/gpu/drm/sun4i/sun4i_lvds.c | 12 +++-
 drivers/gpu/drm/sun4i/sun4i_rgb.c  | 17 +++--
 drivers/gpu/drm/sun4i/sun4i_tv.c   | 17 +++--
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++-
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c  |  8 ++--
 6 files changed, 17 insertions(+), 61 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c 
b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
index 68d4644ac2dc..e324d7db7b7d 100644
--- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "sun4i_backend.h"
 #include "sun4i_crtc.h"
@@ -204,10 +205,6 @@ static const struct drm_encoder_helper_funcs 
sun4i_hdmi_helper_funcs = {
.mode_valid = sun4i_hdmi_mode_valid,
 };
 
-static const struct drm_encoder_funcs sun4i_hdmi_funcs = {
-   .destroy= drm_encoder_cleanup,
-};
-
 static int sun4i_hdmi_get_modes(struct drm_connector *connector)
 {
struct sun4i_hdmi *hdmi = drm_connector_to_sun4i_hdmi(connector);
@@ -611,11 +608,8 @@ static int sun4i_hdmi_bind(struct device *dev, struct 
device *master,
 
drm_encoder_helper_add(>encoder,
   _hdmi_helper_funcs);
-   ret = drm_encoder_init(drm,
-  >encoder,
-  _hdmi_funcs,
-  DRM_MODE_ENCODER_TMDS,
-  NULL);
+   ret = drm_simple_encoder_init(drm, >encoder,
+ DRM_MODE_ENCODER_TMDS);
if (ret) {
dev_err(dev, "Couldn't initialise the HDMI encoder\n");
goto err_put_ddc_i2c;
diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c 
b/drivers/gpu/drm/sun4i/sun4i_lvds.c
index 26e5c7ceb8ff..ffda3184aa12 100644
--- a/drivers/gpu/drm/sun4i/sun4i_lvds.c
+++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "sun4i_crtc.h"
 #include "sun4i_tcon.h"
@@ -96,10 +97,6 @@ static const struct drm_encoder_helper_funcs 
sun4i_lvds_enc_helper_funcs = {
.enable = sun4i_lvds_encoder_enable,
 };
 
-static const struct drm_encoder_funcs sun4i_lvds_enc_funcs = {
-   .destroy= drm_encoder_cleanup,
-};
-
 int sun4i_lvds_init(struct drm_device *drm, struct sun4i_tcon *tcon)
 {
struct drm_encoder *encoder;
@@ -121,11 +118,8 @@ int sun4i_lvds_init(struct drm_device *drm, struct 
sun4i_tcon *tcon)
 
drm_encoder_helper_add(>encoder,
   _lvds_enc_helper_funcs);
-   ret = drm_encoder_init(drm,
-  >encoder,
-  _lvds_enc_funcs,
-  DRM_MODE_ENCODER_LVDS,
-  NULL);
+   ret = drm_simple_encoder_init(drm, >encoder,
+ DRM_MODE_ENCODER_LVDS);
if (ret) {
dev_err(drm->dev, "Couldn't initialise the lvds encoder\n");
goto err_out;
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c 
b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index 3b23d5be3cf3..5a7d43939ae6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "sun4i_crtc.h"
 #include "sun4i_tcon.h"
@@ -188,15 +189,6 @@ static struct drm_encoder_helper_funcs 
sun4i_rgb_enc_helper_funcs = {
.mode_valid = sun4i_rgb_mode_valid,
 };
 
-static void sun4i_rgb_enc_destroy(struct drm_encoder *encoder)
-{
-   drm_encoder_cleanup(encoder);
-}
-
-static struct drm_encoder_funcs sun4i_rgb_enc_funcs = {
-   .destroy= sun4i_rgb_enc_destroy,
-};
-
 int sun4i_rgb_init(struct drm_device *drm, struct sun4i_tcon *tcon)
 {
struct drm_encoder *encoder;
@@ -218,11 +210,8 @@ int sun4i_rgb_init(struct drm_device *drm, struct 
sun4i_tcon *tcon)
 
drm_encoder_helper_add(>encoder,
   _rgb_enc_helper_funcs);
-   ret = drm_encoder_init(drm,
-  >encoder,
-  _rgb_enc_funcs,
-  DRM_MODE_ENCODER_NONE,
-  NULL);
+   ret = drm_simple_encoder_init(drm, >encoder,
+ DRM_MODE_ENCODER_NONE);
if (ret) {
dev_err(drm->dev, "Couldn't initialise the rgb encoder\n");
goto err_out;
diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index 39c15282e448..63f4428ac3bf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include