diff mbox series

[11/22] drm/rcar-du: Use simple encoder

Message ID 20200305155950.2705-12-tzimmermann@suse.de
State Not Applicable
Headers show
Series drm: Convert drivers to drm_simple_encoder_init() | expand

Commit Message

Thomas Zimmermann March 5, 2020, 3:59 p.m. UTC
The rcar-du driver uses an empty implementation for its encoder. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

Comments

kernel test robot March 6, 2020, 8:43 a.m. UTC | #1
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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu//drm/rcar-du/rcar_du_encoder.c:107:8: error: implicit declaration of function 'drm_simple_encoder_init' [-Werror,-Wimplicit-function-declaration]
           ret = drm_simple_encoder_init(rcdu->ddev, encoder,
                 ^
   drivers/gpu//drm/rcar-du/rcar_du_encoder.c:107: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 +107 drivers/gpu//drm/rcar-du/rcar_du_encoder.c

    46	
    47	int rcar_du_encoder_init(struct rcar_du_device *rcdu,
    48				 enum rcar_du_output output,
    49				 struct device_node *enc_node)
    50	{
    51		struct rcar_du_encoder *renc;
    52		struct drm_encoder *encoder;
    53		struct drm_bridge *bridge;
    54		int ret;
    55	
    56		renc = devm_kzalloc(rcdu->dev, sizeof(*renc), GFP_KERNEL);
    57		if (renc == NULL)
    58			return -ENOMEM;
    59	
    60		rcdu->encoders[output] = renc;
    61		renc->output = output;
    62		encoder = rcar_encoder_to_drm_encoder(renc);
    63	
    64		dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n",
    65			enc_node, output);
    66	
    67		/*
    68		 * Locate the DRM bridge from the DT node. For the DPAD outputs, if the
    69		 * DT node has a single port, assume that it describes a panel and
    70		 * create a panel bridge.
    71		 */
    72		if ((output == RCAR_DU_OUTPUT_DPAD0 ||
    73		     output == RCAR_DU_OUTPUT_DPAD1) &&
    74		    rcar_du_encoder_count_ports(enc_node) == 1) {
    75			struct drm_panel *panel = of_drm_find_panel(enc_node);
    76	
    77			if (IS_ERR(panel)) {
    78				ret = PTR_ERR(panel);
    79				goto done;
    80			}
    81	
    82			bridge = devm_drm_panel_bridge_add_typed(rcdu->dev, panel,
    83								 DRM_MODE_CONNECTOR_DPI);
    84			if (IS_ERR(bridge)) {
    85				ret = PTR_ERR(bridge);
    86				goto done;
    87			}
    88		} else {
    89			bridge = of_drm_find_bridge(enc_node);
    90			if (!bridge) {
    91				ret = -EPROBE_DEFER;
    92				goto done;
    93			}
    94		}
    95	
    96		/*
    97		 * On Gen3 skip the LVDS1 output if the LVDS1 encoder is used as a
    98		 * companion for LVDS0 in dual-link mode.
    99		 */
   100		if (rcdu->info->gen >= 3 && output == RCAR_DU_OUTPUT_LVDS1) {
   101			if (rcar_lvds_dual_link(bridge)) {
   102				ret = -ENOLINK;
   103				goto done;
   104			}
   105		}
   106	
 > 107		ret = drm_simple_encoder_init(rcdu->ddev, encoder,

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
index c07c6a88aff0..b0335da0c161 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
@@ -13,6 +13,7 @@ 
 #include <drm/drm_crtc.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_panel.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "rcar_du_drv.h"
 #include "rcar_du_encoder.h"
@@ -23,13 +24,6 @@ 
  * Encoder
  */
 
-static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
-};
-
-static const struct drm_encoder_funcs encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
 static unsigned int rcar_du_encoder_count_ports(struct device_node *node)
 {
 	struct device_node *ports;
@@ -110,13 +104,11 @@  int rcar_du_encoder_init(struct rcar_du_device *rcdu,
 		}
 	}
 
-	ret = drm_encoder_init(rcdu->ddev, encoder, &encoder_funcs,
-			       DRM_MODE_ENCODER_NONE, NULL);
+	ret = drm_simple_encoder_init(rcdu->ddev, encoder,
+				      DRM_MODE_ENCODER_NONE);
 	if (ret < 0)
 		goto done;
 
-	drm_encoder_helper_add(encoder, &encoder_helper_funcs);
-
 	/*
 	 * Attach the bridge to the encoder. The bridge will create the
 	 * connector.