diff mbox series

[02/22] drm/atmel-hlcdc: Use simple encoder

Message ID 20200305155950.2705-3-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 atmel-hlcdc 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/atmel-hlcdc/atmel_hlcdc_output.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

kernel test robot March 6, 2020, 12:32 a.m. UTC | #1
Hi Thomas,

I love your patch! Yet something to improve:

[auto build test ERROR on next-20200305]
[also build test ERROR on v5.6-rc4]
[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]
[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: arm-at91_dt_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.5.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
        GCC_VERSION=7.5.0 make.cross ARCH=arm 

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/atmel-hlcdc/atmel_hlcdc_output.c: In function 'atmel_hlcdc_attach_endpoint':
>> drivers/gpu//drm/atmel-hlcdc/atmel_hlcdc_output.c:98:8: error: implicit declaration of function 'drm_simple_encoder_init'; did you mean 'drm_encoder_init'? [-Werror=implicit-function-declaration]
     ret = drm_simple_encoder_init(dev, &output->encoder,
           ^~~~~~~~~~~~~~~~~~~~~~~
           drm_encoder_init
   cc1: some warnings being treated as errors

vim +98 drivers/gpu//drm/atmel-hlcdc/atmel_hlcdc_output.c

    65	
    66	static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
    67	{
    68		struct atmel_hlcdc_rgb_output *output;
    69		struct device_node *ep;
    70		struct drm_panel *panel;
    71		struct drm_bridge *bridge;
    72		int ret;
    73	
    74		ep = of_graph_get_endpoint_by_regs(dev->dev->of_node, 0, endpoint);
    75		if (!ep)
    76			return -ENODEV;
    77	
    78		ret = drm_of_find_panel_or_bridge(dev->dev->of_node, 0, endpoint,
    79						  &panel, &bridge);
    80		if (ret) {
    81			of_node_put(ep);
    82			return ret;
    83		}
    84	
    85		output = devm_kzalloc(dev->dev, sizeof(*output), GFP_KERNEL);
    86		if (!output) {
    87			of_node_put(ep);
    88			return -ENOMEM;
    89		}
    90	
    91		output->bus_fmt = atmel_hlcdc_of_bus_fmt(ep);
    92		of_node_put(ep);
    93		if (output->bus_fmt < 0) {
    94			dev_err(dev->dev, "endpoint %d: invalid bus width\n", endpoint);
    95			return -EINVAL;
    96		}
    97	
  > 98		ret = drm_simple_encoder_init(dev, &output->encoder,
    99					      DRM_MODE_ENCODER_NONE);
   100		if (ret)
   101			return ret;
   102	
   103		output->encoder.possible_crtcs = 0x1;
   104	
   105		if (panel) {
   106			bridge = drm_panel_bridge_add_typed(panel,
   107							    DRM_MODE_CONNECTOR_Unknown);
   108			if (IS_ERR(bridge))
   109				return PTR_ERR(bridge);
   110		}
   111	
   112		if (bridge) {
   113			ret = drm_bridge_attach(&output->encoder, bridge, NULL, 0);
   114			if (!ret)
   115				return 0;
   116	
   117			if (panel)
   118				drm_panel_bridge_remove(bridge);
   119		}
   120	
   121		drm_encoder_cleanup(&output->encoder);
   122	
   123		return ret;
   124	}
   125	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Sam Ravnborg March 6, 2020, 9:26 p.m. UTC | #2
On Thu, Mar 05, 2020 at 04:59:30PM +0100, Thomas Zimmermann wrote:
> The atmel-hlcdc driver uses an empty implementation for its encoder.
> Replace the code with the generic simple encoder.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> index e2019fe97fff..43bc709e3523 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> @@ -11,9 +11,10 @@
>  #include <linux/media-bus-format.h>
>  #include <linux/of_graph.h>
>  
> +#include <drm/drm_bridge.h>
>  #include <drm/drm_encoder.h>
>  #include <drm/drm_of.h>
> -#include <drm/drm_bridge.h>
> +#include <drm/drm_simple_kms_helper.h>
>  
>  #include "atmel_hlcdc_dc.h"
>  
> @@ -22,10 +23,6 @@ struct atmel_hlcdc_rgb_output {
>  	int bus_fmt;
>  };
>  
> -static const struct drm_encoder_funcs atmel_hlcdc_panel_encoder_funcs = {
> -	.destroy = drm_encoder_cleanup,
> -};
> -
>  static struct atmel_hlcdc_rgb_output *
>  atmel_hlcdc_encoder_to_rgb_output(struct drm_encoder *encoder)
>  {
> @@ -98,9 +95,8 @@ static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
>  		return -EINVAL;
>  	}
>  
> -	ret = drm_encoder_init(dev, &output->encoder,
> -			       &atmel_hlcdc_panel_encoder_funcs,
> -			       DRM_MODE_ENCODER_NONE, NULL);
> +	ret = drm_simple_encoder_init(dev, &output->encoder,
> +				      DRM_MODE_ENCODER_NONE);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
index e2019fe97fff..43bc709e3523 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
@@ -11,9 +11,10 @@ 
 #include <linux/media-bus-format.h>
 #include <linux/of_graph.h>
 
+#include <drm/drm_bridge.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_of.h>
-#include <drm/drm_bridge.h>
+#include <drm/drm_simple_kms_helper.h>
 
 #include "atmel_hlcdc_dc.h"
 
@@ -22,10 +23,6 @@  struct atmel_hlcdc_rgb_output {
 	int bus_fmt;
 };
 
-static const struct drm_encoder_funcs atmel_hlcdc_panel_encoder_funcs = {
-	.destroy = drm_encoder_cleanup,
-};
-
 static struct atmel_hlcdc_rgb_output *
 atmel_hlcdc_encoder_to_rgb_output(struct drm_encoder *encoder)
 {
@@ -98,9 +95,8 @@  static int atmel_hlcdc_attach_endpoint(struct drm_device *dev, int endpoint)
 		return -EINVAL;
 	}
 
-	ret = drm_encoder_init(dev, &output->encoder,
-			       &atmel_hlcdc_panel_encoder_funcs,
-			       DRM_MODE_ENCODER_NONE, NULL);
+	ret = drm_simple_encoder_init(dev, &output->encoder,
+				      DRM_MODE_ENCODER_NONE);
 	if (ret)
 		return ret;