Re: [v4 1/4] drm/panel-simple: Add basic DPCD backlight support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rajeev,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-tip/drm-tip]
[also build test ERROR on next-20210525]
[cannot apply to robh/for-next drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.13-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Rajeev-Nandan/drm-Support-basic-DPCD-backlight-in-panel-simple-and-add-a-new-panel-ATNA33XC20/20210525-153326
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: arm-randconfig-r025-20210525 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/24e7ccb98951b0b4c7ae8a367273f8e73c074804
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Rajeev-Nandan/drm-Support-basic-DPCD-backlight-in-panel-simple-and-add-a-new-panel-ATNA33XC20/20210525-153326
        git checkout 24e7ccb98951b0b4c7ae8a367273f8e73c074804
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/panel/panel-simple.c:185:32: error: field has incomplete type 'struct drm_edp_backlight_info'
           struct drm_edp_backlight_info info;
                                         ^
   drivers/gpu/drm/panel/panel-simple.c:185:9: note: forward declaration of 'struct drm_edp_backlight_info'
           struct drm_edp_backlight_info info;
                  ^
>> drivers/gpu/drm/panel/panel-simple.c:352:3: error: implicit declaration of function 'drm_edp_backlight_disable' [-Werror,-Wimplicit-function-declaration]
                   drm_edp_backlight_disable(p->aux, &bl->info);
                   ^
   drivers/gpu/drm/panel/panel-simple.c:352:3: note: did you mean 'backlight_disable'?
   include/linux/backlight.h:379:19: note: 'backlight_disable' declared here
   static inline int backlight_disable(struct backlight_device *bd)
                     ^
>> drivers/gpu/drm/panel/panel-simple.c:352:32: error: no member named 'aux' in 'struct panel_simple'
                   drm_edp_backlight_disable(p->aux, &bl->info);
                                             ~  ^
>> drivers/gpu/drm/panel/panel-simple.c:527:3: error: implicit declaration of function 'drm_edp_backlight_enable' [-Werror,-Wimplicit-function-declaration]
                   drm_edp_backlight_enable(p->aux, &bl->info,
                   ^
   drivers/gpu/drm/panel/panel-simple.c:527:3: note: did you mean 'backlight_enable'?
   include/linux/backlight.h:363:19: note: 'backlight_enable' declared here
   static inline int backlight_enable(struct backlight_device *bd)
                     ^
   drivers/gpu/drm/panel/panel-simple.c:527:31: error: no member named 'aux' in 'struct panel_simple'
                   drm_edp_backlight_enable(p->aux, &bl->info,
                                            ~  ^
>> drivers/gpu/drm/panel/panel-simple.c:598:9: error: implicit declaration of function 'drm_edp_backlight_set_level' [-Werror,-Wimplicit-function-declaration]
           return drm_edp_backlight_set_level(p->aux, &bl->info, bd->props.brightness);
                  ^
   drivers/gpu/drm/panel/panel-simple.c:598:40: error: no member named 'aux' in 'struct panel_simple'
           return drm_edp_backlight_set_level(p->aux, &bl->info, bd->props.brightness);
                                              ~  ^
>> drivers/gpu/drm/panel/panel-simple.c:611:14: error: use of undeclared identifier 'EDP_DISPLAY_CTL_CAP_SIZE'
           u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE];
                       ^
>> drivers/gpu/drm/panel/panel-simple.c:618:8: error: implicit declaration of function 'drm_dp_dpcd_read' [-Werror,-Wimplicit-function-declaration]
           ret = drm_dp_dpcd_read(panel->aux, DP_EDP_DPCD_REV, edp_dpcd,
                 ^
   drivers/gpu/drm/panel/panel-simple.c:618:32: error: no member named 'aux' in 'struct panel_simple'
           ret = drm_dp_dpcd_read(panel->aux, DP_EDP_DPCD_REV, edp_dpcd,
                                  ~~~~~  ^
>> drivers/gpu/drm/panel/panel-simple.c:618:37: error: use of undeclared identifier 'DP_EDP_DPCD_REV'
           ret = drm_dp_dpcd_read(panel->aux, DP_EDP_DPCD_REV, edp_dpcd,
                                              ^
   drivers/gpu/drm/panel/panel-simple.c:619:11: error: use of undeclared identifier 'EDP_DISPLAY_CTL_CAP_SIZE'
                                  EDP_DISPLAY_CTL_CAP_SIZE);
                                  ^
>> drivers/gpu/drm/panel/panel-simple.c:623:8: error: implicit declaration of function 'drm_edp_backlight_init' [-Werror,-Wimplicit-function-declaration]
           ret = drm_edp_backlight_init(panel->aux, &bl->info, 0, edp_dpcd,
                 ^
   drivers/gpu/drm/panel/panel-simple.c:623:38: error: no member named 'aux' in 'struct panel_simple'
           ret = drm_edp_backlight_init(panel->aux, &bl->info, 0, edp_dpcd,
                                        ~~~~~  ^
   drivers/gpu/drm/panel/panel-simple.c:871:15: error: no member named 'aux' in 'struct panel_simple'
                   if (!panel->aux) {
                        ~~~~~  ^
   15 errors generated.


vim +185 drivers/gpu/drm/panel/panel-simple.c

   182	
   183	struct edp_backlight {
   184		struct backlight_device *dev;
 > 185		struct drm_edp_backlight_info info;
   186	};
   187	
   188	struct panel_simple {
   189		struct drm_panel base;
   190		bool enabled;
   191		bool no_hpd;
   192	
   193		bool prepared;
   194	
   195		ktime_t prepared_time;
   196		ktime_t unprepared_time;
   197	
   198		const struct panel_desc *desc;
   199	
   200		struct regulator *supply;
   201		struct i2c_adapter *ddc;
   202	
   203		struct gpio_desc *enable_gpio;
   204		struct gpio_desc *hpd_gpio;
   205	
   206		struct edid *edid;
   207	
   208		struct edp_backlight *edp_bl;
   209	
   210		struct drm_display_mode override_mode;
   211	
   212		enum drm_panel_orientation orientation;
   213	};
   214	
   215	static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
   216	{
   217		return container_of(panel, struct panel_simple, base);
   218	}
   219	
   220	static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
   221							   struct drm_connector *connector)
   222	{
   223		struct drm_display_mode *mode;
   224		unsigned int i, num = 0;
   225	
   226		for (i = 0; i < panel->desc->num_timings; i++) {
   227			const struct display_timing *dt = &panel->desc->timings[i];
   228			struct videomode vm;
   229	
   230			videomode_from_timing(dt, &vm);
   231			mode = drm_mode_create(connector->dev);
   232			if (!mode) {
   233				dev_err(panel->base.dev, "failed to add mode %ux%u\n",
   234					dt->hactive.typ, dt->vactive.typ);
   235				continue;
   236			}
   237	
   238			drm_display_mode_from_videomode(&vm, mode);
   239	
   240			mode->type |= DRM_MODE_TYPE_DRIVER;
   241	
   242			if (panel->desc->num_timings == 1)
   243				mode->type |= DRM_MODE_TYPE_PREFERRED;
   244	
   245			drm_mode_probed_add(connector, mode);
   246			num++;
   247		}
   248	
   249		return num;
   250	}
   251	
   252	static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
   253							   struct drm_connector *connector)
   254	{
   255		struct drm_display_mode *mode;
   256		unsigned int i, num = 0;
   257	
   258		for (i = 0; i < panel->desc->num_modes; i++) {
   259			const struct drm_display_mode *m = &panel->desc->modes[i];
   260	
   261			mode = drm_mode_duplicate(connector->dev, m);
   262			if (!mode) {
   263				dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
   264					m->hdisplay, m->vdisplay,
   265					drm_mode_vrefresh(m));
   266				continue;
   267			}
   268	
   269			mode->type |= DRM_MODE_TYPE_DRIVER;
   270	
   271			if (panel->desc->num_modes == 1)
   272				mode->type |= DRM_MODE_TYPE_PREFERRED;
   273	
   274			drm_mode_set_name(mode);
   275	
   276			drm_mode_probed_add(connector, mode);
   277			num++;
   278		}
   279	
   280		return num;
   281	}
   282	
   283	static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
   284						   struct drm_connector *connector)
   285	{
   286		struct drm_display_mode *mode;
   287		bool has_override = panel->override_mode.type;
   288		unsigned int num = 0;
   289	
   290		if (!panel->desc)
   291			return 0;
   292	
   293		if (has_override) {
   294			mode = drm_mode_duplicate(connector->dev,
   295						  &panel->override_mode);
   296			if (mode) {
   297				drm_mode_probed_add(connector, mode);
   298				num = 1;
   299			} else {
   300				dev_err(panel->base.dev, "failed to add override mode\n");
   301			}
   302		}
   303	
   304		/* Only add timings if override was not there or failed to validate */
   305		if (num == 0 && panel->desc->num_timings)
   306			num = panel_simple_get_timings_modes(panel, connector);
   307	
   308		/*
   309		 * Only add fixed modes if timings/override added no mode.
   310		 *
   311		 * We should only ever have either the display timings specified
   312		 * or a fixed mode. Anything else is rather bogus.
   313		 */
   314		WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
   315		if (num == 0)
   316			num = panel_simple_get_display_modes(panel, connector);
   317	
   318		connector->display_info.bpc = panel->desc->bpc;
   319		connector->display_info.width_mm = panel->desc->size.width;
   320		connector->display_info.height_mm = panel->desc->size.height;
   321		if (panel->desc->bus_format)
   322			drm_display_info_set_bus_formats(&connector->display_info,
   323							 &panel->desc->bus_format, 1);
   324		connector->display_info.bus_flags = panel->desc->bus_flags;
   325	
   326		return num;
   327	}
   328	
   329	static void panel_simple_wait(ktime_t start_ktime, unsigned int min_ms)
   330	{
   331		ktime_t now_ktime, min_ktime;
   332	
   333		if (!min_ms)
   334			return;
   335	
   336		min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
   337		now_ktime = ktime_get();
   338	
   339		if (ktime_before(now_ktime, min_ktime))
   340			msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
   341	}
   342	
   343	static int panel_simple_disable(struct drm_panel *panel)
   344	{
   345		struct panel_simple *p = to_panel_simple(panel);
   346		struct edp_backlight *bl = p->edp_bl;
   347	
   348		if (!p->enabled)
   349			return 0;
   350	
   351		if (p->desc->uses_dpcd_backlight && bl)
 > 352			drm_edp_backlight_disable(p->aux, &bl->info);
   353	
   354		if (p->desc->delay.disable)
   355			msleep(p->desc->delay.disable);
   356	
   357		p->enabled = false;
   358	
   359		return 0;
   360	}
   361	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux