All of lore.kernel.org
 help / color / mirror / Atom feed
* [lkundrak-linux-mmp:lr/gud2 7/7] drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean
@ 2020-07-08 11:28 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-08 11:28 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 18044 bytes --]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git lr/gud2
head:   84d9081acc7185e369834b2b0808d197d7a79d2c
commit: 84d9081acc7185e369834b2b0808d197d7a79d2c [7/7] usb: gadget: function: Add Generic USB Display support
config: i386-randconfig-r015-20200708 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        git checkout 84d9081acc7185e369834b2b0808d197d7a79d2c
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All errors (new ones prefixed by >>):

   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_check':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean 'drm_client_modeset_set'? [-Werror=implicit-function-declaration]
     330 |  ret = drm_client_modeset_check(&gdg->client);
         |        ^~~~~~~~~~~~~~~~~~~~~~~~
         |        drm_client_modeset_set
   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_write_buffer':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:457:9: error: implicit declaration of function 'drm_client_framebuffer_flush'; did you mean 'drm_client_framebuffer_delete'? [-Werror=implicit-function-declaration]
     457 |  return drm_client_framebuffer_flush(buffer, rect);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |         drm_client_framebuffer_delete
   cc1: some warnings being treated as errors

vim +330 drivers/gpu/drm/gud/gud_drm_gadget.c

9e2361b992206e Noralf Trønnes 2020-05-29  244  
9e2361b992206e Noralf Trønnes 2020-05-29  245  static int gud_drm_gadget_check(struct gud_drm_gadget *gdg, struct gud_drm_req_set_state *req,
9e2361b992206e Noralf Trønnes 2020-05-29  246  				size_t size)
9e2361b992206e Noralf Trønnes 2020-05-29  247  {
9e2361b992206e Noralf Trønnes 2020-05-29  248  	struct drm_client_dev *client = &gdg->client;
9e2361b992206e Noralf Trønnes 2020-05-29  249  	u32 format = le32_to_cpu(req->format);
9e2361b992206e Noralf Trønnes 2020-05-29  250  	struct drm_client_buffer *buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  251  	struct drm_connector *connector;
9e2361b992206e Noralf Trønnes 2020-05-29  252  	struct drm_display_mode mode;
9e2361b992206e Noralf Trønnes 2020-05-29  253  	unsigned int i;
9e2361b992206e Noralf Trønnes 2020-05-29  254  	void *vaddr;
9e2361b992206e Noralf Trønnes 2020-05-29  255  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  256  
9e2361b992206e Noralf Trønnes 2020-05-29  257  	if (size < sizeof(struct gud_drm_req_set_state))
9e2361b992206e Noralf Trønnes 2020-05-29  258  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  259  
9e2361b992206e Noralf Trønnes 2020-05-29  260  	if (size != struct_size(req, properties, req->num_properties))
9e2361b992206e Noralf Trønnes 2020-05-29  261  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  262  
9e2361b992206e Noralf Trønnes 2020-05-29  263  	memset(&mode, 0, sizeof(mode));
9e2361b992206e Noralf Trønnes 2020-05-29  264  	gud_drm_to_display_mode(&mode, &req->mode);
9e2361b992206e Noralf Trønnes 2020-05-29  265  
9e2361b992206e Noralf Trønnes 2020-05-29  266  	gdg->check_ok = false;
9e2361b992206e Noralf Trønnes 2020-05-29  267  
9e2361b992206e Noralf Trønnes 2020-05-29  268  	if (!mode.hdisplay || !format)
9e2361b992206e Noralf Trønnes 2020-05-29  269  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  270  
9e2361b992206e Noralf Trønnes 2020-05-29  271  	if (req->connector >= gdg->connector_count)
9e2361b992206e Noralf Trønnes 2020-05-29  272  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  273  
9e2361b992206e Noralf Trønnes 2020-05-29  274  	connector = gdg->connectors[req->connector].connector;
9e2361b992206e Noralf Trønnes 2020-05-29  275  
9e2361b992206e Noralf Trønnes 2020-05-29  276  	if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29  277  		drm_client_framebuffer_delete(gdg->buffer_check);
9e2361b992206e Noralf Trønnes 2020-05-29  278  		gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29  279  	}
9e2361b992206e Noralf Trønnes 2020-05-29  280  
9e2361b992206e Noralf Trønnes 2020-05-29  281  	if (!gud_drm_gadget_check_buffer(gdg, gdg->buffer, &mode, format)) {
9e2361b992206e Noralf Trønnes 2020-05-29  282  		buffer = drm_client_framebuffer_create(client, mode.hdisplay, mode.vdisplay,
9e2361b992206e Noralf Trønnes 2020-05-29  283  						       format);
9e2361b992206e Noralf Trønnes 2020-05-29  284  		if (IS_ERR(buffer))
9e2361b992206e Noralf Trønnes 2020-05-29  285  			return PTR_ERR(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  286  
9e2361b992206e Noralf Trønnes 2020-05-29  287  		vaddr = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  288  		if (IS_ERR(vaddr)) {
9e2361b992206e Noralf Trønnes 2020-05-29  289  			drm_client_framebuffer_delete(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  290  			return PTR_ERR(vaddr);
9e2361b992206e Noralf Trønnes 2020-05-29  291  		}
9e2361b992206e Noralf Trønnes 2020-05-29  292  
9e2361b992206e Noralf Trønnes 2020-05-29  293  		gdg->buffer_check = buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  294  	} else {
9e2361b992206e Noralf Trønnes 2020-05-29  295  		buffer = gdg->buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  296  	}
9e2361b992206e Noralf Trønnes 2020-05-29  297  
9e2361b992206e Noralf Trønnes 2020-05-29  298  	ret = drm_client_modeset_set(client, connector, &mode, buffer->fb);
9e2361b992206e Noralf Trønnes 2020-05-29  299  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  300  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  301  
9e2361b992206e Noralf Trønnes 2020-05-29  302  	for (i = 0; i < req->num_properties; i++) {
9e2361b992206e Noralf Trønnes 2020-05-29  303  		u16 prop = le16_to_cpu(req->properties[i].prop);
9e2361b992206e Noralf Trønnes 2020-05-29  304  		u64 val = le64_to_cpu(req->properties[i].val);
9e2361b992206e Noralf Trønnes 2020-05-29  305  
9e2361b992206e Noralf Trønnes 2020-05-29  306  		if (gud_drm_gadget_set_connector_property(client, connector, prop, val, &ret)) {
9e2361b992206e Noralf Trønnes 2020-05-29  307  			if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  308  				return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  309  			continue;
9e2361b992206e Noralf Trønnes 2020-05-29  310  		}
9e2361b992206e Noralf Trønnes 2020-05-29  311  
9e2361b992206e Noralf Trønnes 2020-05-29  312  		switch (prop) {
9e2361b992206e Noralf Trønnes 2020-05-29  313  		case GUD_DRM_PROPERTY_BACKLIGHT_BRIGHTNESS:
9e2361b992206e Noralf Trønnes 2020-05-29  314  			if (val > 100)
9e2361b992206e Noralf Trønnes 2020-05-29  315  				return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  316  			gdg->brightness = val;
9e2361b992206e Noralf Trønnes 2020-05-29  317  			break;
9e2361b992206e Noralf Trønnes 2020-05-29  318  		case GUD_DRM_PROPERTY_ROTATION:
9e2361b992206e Noralf Trønnes 2020-05-29  319  			ret = drm_client_modeset_set_rotation(client, val);
9e2361b992206e Noralf Trønnes 2020-05-29  320  			break;
9e2361b992206e Noralf Trønnes 2020-05-29  321  		default:
9e2361b992206e Noralf Trønnes 2020-05-29  322  			pr_err("%s: Unknown property: %u\n", __func__, prop);
9e2361b992206e Noralf Trønnes 2020-05-29  323  			continue;
9e2361b992206e Noralf Trønnes 2020-05-29  324  		}
9e2361b992206e Noralf Trønnes 2020-05-29  325  
9e2361b992206e Noralf Trønnes 2020-05-29  326  		if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  327  			return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  328  	}
9e2361b992206e Noralf Trønnes 2020-05-29  329  
9e2361b992206e Noralf Trønnes 2020-05-29 @330  	ret = drm_client_modeset_check(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29  331  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  332  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  333  
9e2361b992206e Noralf Trønnes 2020-05-29  334  	gdg->check_ok = true;
9e2361b992206e Noralf Trønnes 2020-05-29  335  
9e2361b992206e Noralf Trønnes 2020-05-29  336  	return 0;
9e2361b992206e Noralf Trønnes 2020-05-29  337  }
9e2361b992206e Noralf Trønnes 2020-05-29  338  
9e2361b992206e Noralf Trønnes 2020-05-29  339  static int gud_drm_gadget_commit(struct gud_drm_gadget *gdg)
9e2361b992206e Noralf Trønnes 2020-05-29  340  {
9e2361b992206e Noralf Trønnes 2020-05-29  341  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  342  
9e2361b992206e Noralf Trønnes 2020-05-29  343  	if (!gdg->check_ok)
9e2361b992206e Noralf Trønnes 2020-05-29  344  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  345  
9e2361b992206e Noralf Trønnes 2020-05-29  346  	if (gdg->backlight) {
9e2361b992206e Noralf Trønnes 2020-05-29  347  		int val, max_brightness = gdg->backlight->props.max_brightness;
9e2361b992206e Noralf Trønnes 2020-05-29  348  
9e2361b992206e Noralf Trønnes 2020-05-29  349  		val = DIV64_U64_ROUND_UP(gdg->brightness * max_brightness, 100);
9e2361b992206e Noralf Trønnes 2020-05-29  350  		ret = backlight_device_set_brightness(gdg->backlight, val);
9e2361b992206e Noralf Trønnes 2020-05-29  351  		if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  352  			return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  353  	}
9e2361b992206e Noralf Trønnes 2020-05-29  354  
9e2361b992206e Noralf Trønnes 2020-05-29  355  	ret = drm_client_modeset_commit(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29  356  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  357  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  358  
9e2361b992206e Noralf Trønnes 2020-05-29  359  	if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29  360  		drm_client_framebuffer_delete(gdg->buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  361  		gdg->buffer = gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29  362  		gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29  363  	}
9e2361b992206e Noralf Trønnes 2020-05-29  364  
9e2361b992206e Noralf Trønnes 2020-05-29  365  	return 0;
9e2361b992206e Noralf Trønnes 2020-05-29  366  }
9e2361b992206e Noralf Trønnes 2020-05-29  367  
9e2361b992206e Noralf Trønnes 2020-05-29  368  static size_t gud_drm_gadget_write_buffer_memcpy(struct drm_client_buffer *buffer,
9e2361b992206e Noralf Trønnes 2020-05-29  369  						 const void *src, size_t len,
9e2361b992206e Noralf Trønnes 2020-05-29  370  						 struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29  371  {
9e2361b992206e Noralf Trønnes 2020-05-29  372  	unsigned int cpp = buffer->fb->format->cpp[0];
9e2361b992206e Noralf Trønnes 2020-05-29  373  	size_t dst_pitch = buffer->fb->pitches[0];
9e2361b992206e Noralf Trønnes 2020-05-29  374  	size_t src_pitch = drm_rect_width(rect) * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29  375  	unsigned int y;
9e2361b992206e Noralf Trønnes 2020-05-29  376  	void *dst;
9e2361b992206e Noralf Trønnes 2020-05-29  377  
9e2361b992206e Noralf Trønnes 2020-05-29  378  	/* Get the address, it's already mapped */
9e2361b992206e Noralf Trønnes 2020-05-29  379  	dst = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  380  	dst += rect->y1 * dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  381  	dst += rect->x1 * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29  382  
9e2361b992206e Noralf Trønnes 2020-05-29  383  	for (y = 0; y < drm_rect_height(rect) && len; y++) {
9e2361b992206e Noralf Trønnes 2020-05-29  384  		src_pitch = min(src_pitch, len);
9e2361b992206e Noralf Trønnes 2020-05-29  385  		memcpy(dst, src, src_pitch);
9e2361b992206e Noralf Trønnes 2020-05-29  386  		src += src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  387  		dst += dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  388  		len -= src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  389  	}
9e2361b992206e Noralf Trønnes 2020-05-29  390  
9e2361b992206e Noralf Trønnes 2020-05-29  391  	return len;
9e2361b992206e Noralf Trønnes 2020-05-29  392  }
9e2361b992206e Noralf Trønnes 2020-05-29  393  
9e2361b992206e Noralf Trønnes 2020-05-29  394  static bool gud_drm_gadget_check_rect(struct drm_client_buffer *buffer, struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29  395  {
9e2361b992206e Noralf Trønnes 2020-05-29  396  	return buffer->fb && rect->x1 < rect->x2 && rect->y1 < rect->y2 &&
9e2361b992206e Noralf Trønnes 2020-05-29  397  	       rect->x2 <= buffer->fb->width && rect->y2 <= buffer->fb->height;
9e2361b992206e Noralf Trønnes 2020-05-29  398  }
9e2361b992206e Noralf Trønnes 2020-05-29  399  
9e2361b992206e Noralf Trønnes 2020-05-29  400  int gud_drm_gadget_write_buffer(struct gud_drm_gadget *gdg, const void *buf, size_t len)
9e2361b992206e Noralf Trønnes 2020-05-29  401  {
9e2361b992206e Noralf Trønnes 2020-05-29  402  	struct drm_client_buffer *buffer = gdg->buffer ? gdg->buffer : gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29  403  	struct drm_rect *rect = &gdg->set_buffer_rect;
9e2361b992206e Noralf Trønnes 2020-05-29  404  	u8 compression = gdg->set_buffer_compression;
9e2361b992206e Noralf Trønnes 2020-05-29  405  	struct drm_framebuffer *fb;
9e2361b992206e Noralf Trønnes 2020-05-29  406  	size_t remain;
9e2361b992206e Noralf Trønnes 2020-05-29  407  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  408  
9e2361b992206e Noralf Trønnes 2020-05-29  409  	pr_debug("%s: len=%zu compression=0x%x\n", __func__, len, compression);
9e2361b992206e Noralf Trønnes 2020-05-29  410  
9e2361b992206e Noralf Trønnes 2020-05-29  411  	if (WARN_ON_ONCE(!buffer))
9e2361b992206e Noralf Trønnes 2020-05-29  412  		return -ENOMEM;
9e2361b992206e Noralf Trønnes 2020-05-29  413  
9e2361b992206e Noralf Trønnes 2020-05-29  414  	if (!gud_drm_gadget_check_rect(buffer, rect)) {
9e2361b992206e Noralf Trønnes 2020-05-29  415  		pr_err("%s: Rectangle doesn't fit: " DRM_RECT_FMT "\n",
9e2361b992206e Noralf Trønnes 2020-05-29  416  		       __func__, DRM_RECT_ARG(rect));
9e2361b992206e Noralf Trønnes 2020-05-29  417  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  418  	}
9e2361b992206e Noralf Trønnes 2020-05-29  419  
9e2361b992206e Noralf Trønnes 2020-05-29  420  	fb = buffer->fb;
9e2361b992206e Noralf Trønnes 2020-05-29  421  
9e2361b992206e Noralf Trønnes 2020-05-29  422  	if (compression & GUD_DRM_COMPRESSION_LZ4) {
9e2361b992206e Noralf Trønnes 2020-05-29  423  		if (len != gdg->set_buffer_compressed_length) {
9e2361b992206e Noralf Trønnes 2020-05-29  424  			pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  425  			       __func__, len, gdg->set_buffer_compressed_length);
9e2361b992206e Noralf Trønnes 2020-05-29  426  			return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  427  		}
9e2361b992206e Noralf Trønnes 2020-05-29  428  
9e2361b992206e Noralf Trønnes 2020-05-29  429  		ret = LZ4_decompress_safe(buf, gdg->work_buf, len, gdg->max_buffer_size);
9e2361b992206e Noralf Trønnes 2020-05-29  430  		if (ret < 0) {
9e2361b992206e Noralf Trønnes 2020-05-29  431  			pr_err("%s: Failed to decompress buffer\n", __func__);
9e2361b992206e Noralf Trønnes 2020-05-29  432  			return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29  433  		}
9e2361b992206e Noralf Trønnes 2020-05-29  434  
9e2361b992206e Noralf Trønnes 2020-05-29  435  		buf = gdg->work_buf;
9e2361b992206e Noralf Trønnes 2020-05-29  436  		len = ret;
9e2361b992206e Noralf Trønnes 2020-05-29  437  	}
9e2361b992206e Noralf Trønnes 2020-05-29  438  
9e2361b992206e Noralf Trønnes 2020-05-29  439  	if (len != gdg->set_buffer_length) {
9e2361b992206e Noralf Trønnes 2020-05-29  440  		pr_err("%s: Buffer len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  441  		       __func__, len, gdg->set_buffer_length);
9e2361b992206e Noralf Trønnes 2020-05-29  442  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  443  	}
9e2361b992206e Noralf Trønnes 2020-05-29  444  
9e2361b992206e Noralf Trønnes 2020-05-29  445  	if (len > (drm_rect_width(rect) * drm_rect_height(rect) * fb->format->cpp[0])) {
9e2361b992206e Noralf Trønnes 2020-05-29  446  		pr_err("%s: Buffer is too big for rectangle: " DRM_RECT_FMT " len=%zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  447  		       __func__, DRM_RECT_ARG(rect), len);
9e2361b992206e Noralf Trønnes 2020-05-29  448  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  449  	}
9e2361b992206e Noralf Trønnes 2020-05-29  450  
9e2361b992206e Noralf Trønnes 2020-05-29  451  	remain = gud_drm_gadget_write_buffer_memcpy(buffer, buf, len, rect);
9e2361b992206e Noralf Trønnes 2020-05-29  452  	if (remain) {
9e2361b992206e Noralf Trønnes 2020-05-29  453  		pr_err("%s: Failed to write buffer: remain=%zu\n", __func__, remain);
9e2361b992206e Noralf Trønnes 2020-05-29  454  		return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29  455  	}
9e2361b992206e Noralf Trønnes 2020-05-29  456  
9e2361b992206e Noralf Trønnes 2020-05-29 @457  	return drm_client_framebuffer_flush(buffer, rect);
9e2361b992206e Noralf Trønnes 2020-05-29  458  }
9e2361b992206e Noralf Trønnes 2020-05-29  459  EXPORT_SYMBOL(gud_drm_gadget_write_buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  460  

:::::: The code at line 330 was first introduced by commit
:::::: 9e2361b992206e76551d08195854205ba3a2b002 drm/gud: Add functionality for the USB gadget side

:::::: TO: Noralf Trønnes <noralf@tronnes.org>
:::::: CC: Lubomir Rintel <lkundrak@v3.sk>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29655 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [lkundrak-linux-mmp:lr/gud2 7/7] drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean
@ 2020-07-18  7:26 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-18  7:26 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 23222 bytes --]

Hi Noralf,

First bad commit (maybe != root cause):

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/lkundrak/linux-mmp.git lr/gud2
head:   84d9081acc7185e369834b2b0808d197d7a79d2c
commit: 84d9081acc7185e369834b2b0808d197d7a79d2c [7/7] usb: gadget: function: Add Generic USB Display support
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
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
        git checkout 84d9081acc7185e369834b2b0808d197d7a79d2c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

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

All errors (new ones prefixed by >>):

   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_check':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean 'drm_client_modeset_set'? [-Werror=implicit-function-declaration]
     330 |  ret = drm_client_modeset_check(&gdg->client);
         |        ^~~~~~~~~~~~~~~~~~~~~~~~
         |        drm_client_modeset_set
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:43,
                    from include/linux/spinlock_types.h:18,
                    from arch/powerpc/include/asm/lppaca.h:45,
                    from arch/powerpc/include/asm/paca.h:17,
                    from arch/powerpc/include/asm/current.h:13,
                    from include/linux/sched.h:12,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/backlight.h:12,
                    from drivers/gpu/drm/gud/gud_drm_gadget.c:6:
   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_write_buffer':
   include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'u32' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:338:9: note: in expansion of macro 'KERN_ERR'
     338 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/gpu/drm/gud/gud_drm_gadget.c:424:4: note: in expansion of macro 'pr_err'
     424 |    pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
         |    ^~~~~~
   drivers/gpu/drm/gud/gud_drm_gadget.c:424:56: note: format string is defined here
     424 |    pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
         |                                                      ~~^
         |                                                        |
         |                                                        long unsigned int
         |                                                      %u
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:43,
                    from include/linux/spinlock_types.h:18,
                    from arch/powerpc/include/asm/lppaca.h:45,
                    from arch/powerpc/include/asm/paca.h:17,
                    from arch/powerpc/include/asm/current.h:13,
                    from include/linux/sched.h:12,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/backlight.h:12,
                    from drivers/gpu/drm/gud/gud_drm_gadget.c:6:
   include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of type 'size_t', but argument 4 has type 'u32' {aka 'unsigned int'} [-Wformat=]
       5 | #define KERN_SOH "\001"  /* ASCII Start Of Header */
         |                  ^~~~~~
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
         |                  ^~~~~~~~
   include/linux/printk.h:338:9: note: in expansion of macro 'KERN_ERR'
     338 |  printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
         |         ^~~~~~~~
   drivers/gpu/drm/gud/gud_drm_gadget.c:440:3: note: in expansion of macro 'pr_err'
     440 |   pr_err("%s: Buffer len differs: %zu != %zu\n",
         |   ^~~~~~
   drivers/gpu/drm/gud/gud_drm_gadget.c:440:44: note: format string is defined here
     440 |   pr_err("%s: Buffer len differs: %zu != %zu\n",
         |                                          ~~^
         |                                            |
         |                                            long unsigned int
         |                                          %u
>> drivers/gpu/drm/gud/gud_drm_gadget.c:457:9: error: implicit declaration of function 'drm_client_framebuffer_flush'; did you mean 'drm_client_framebuffer_delete'? [-Werror=implicit-function-declaration]
     457 |  return drm_client_framebuffer_flush(buffer, rect);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |         drm_client_framebuffer_delete
   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_client_unregister':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:1044:2: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
    1044 |  vfree(gdg->work_buf);
         |  ^~~~~
         |  kvfree
   drivers/gpu/drm/gud/gud_drm_gadget.c: In function 'gud_drm_gadget_init':
>> drivers/gpu/drm/gud/gud_drm_gadget.c:1123:18: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
    1123 |  gdg->work_buf = vmalloc(gdg->max_buffer_size);
         |                  ^~~~~~~
         |                  kvmalloc
   drivers/gpu/drm/gud/gud_drm_gadget.c:1123:16: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1123 |  gdg->work_buf = vmalloc(gdg->max_buffer_size);
         |                ^
   cc1: some warnings being treated as errors

vim +330 drivers/gpu/drm/gud/gud_drm_gadget.c

9e2361b992206e Noralf Trønnes 2020-05-29  244  
9e2361b992206e Noralf Trønnes 2020-05-29  245  static int gud_drm_gadget_check(struct gud_drm_gadget *gdg, struct gud_drm_req_set_state *req,
9e2361b992206e Noralf Trønnes 2020-05-29  246  				size_t size)
9e2361b992206e Noralf Trønnes 2020-05-29  247  {
9e2361b992206e Noralf Trønnes 2020-05-29  248  	struct drm_client_dev *client = &gdg->client;
9e2361b992206e Noralf Trønnes 2020-05-29  249  	u32 format = le32_to_cpu(req->format);
9e2361b992206e Noralf Trønnes 2020-05-29  250  	struct drm_client_buffer *buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  251  	struct drm_connector *connector;
9e2361b992206e Noralf Trønnes 2020-05-29  252  	struct drm_display_mode mode;
9e2361b992206e Noralf Trønnes 2020-05-29  253  	unsigned int i;
9e2361b992206e Noralf Trønnes 2020-05-29  254  	void *vaddr;
9e2361b992206e Noralf Trønnes 2020-05-29  255  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  256  
9e2361b992206e Noralf Trønnes 2020-05-29  257  	if (size < sizeof(struct gud_drm_req_set_state))
9e2361b992206e Noralf Trønnes 2020-05-29  258  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  259  
9e2361b992206e Noralf Trønnes 2020-05-29  260  	if (size != struct_size(req, properties, req->num_properties))
9e2361b992206e Noralf Trønnes 2020-05-29  261  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  262  
9e2361b992206e Noralf Trønnes 2020-05-29  263  	memset(&mode, 0, sizeof(mode));
9e2361b992206e Noralf Trønnes 2020-05-29  264  	gud_drm_to_display_mode(&mode, &req->mode);
9e2361b992206e Noralf Trønnes 2020-05-29  265  
9e2361b992206e Noralf Trønnes 2020-05-29  266  	gdg->check_ok = false;
9e2361b992206e Noralf Trønnes 2020-05-29  267  
9e2361b992206e Noralf Trønnes 2020-05-29  268  	if (!mode.hdisplay || !format)
9e2361b992206e Noralf Trønnes 2020-05-29  269  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  270  
9e2361b992206e Noralf Trønnes 2020-05-29  271  	if (req->connector >= gdg->connector_count)
9e2361b992206e Noralf Trønnes 2020-05-29  272  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  273  
9e2361b992206e Noralf Trønnes 2020-05-29  274  	connector = gdg->connectors[req->connector].connector;
9e2361b992206e Noralf Trønnes 2020-05-29  275  
9e2361b992206e Noralf Trønnes 2020-05-29  276  	if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29  277  		drm_client_framebuffer_delete(gdg->buffer_check);
9e2361b992206e Noralf Trønnes 2020-05-29  278  		gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29  279  	}
9e2361b992206e Noralf Trønnes 2020-05-29  280  
9e2361b992206e Noralf Trønnes 2020-05-29  281  	if (!gud_drm_gadget_check_buffer(gdg, gdg->buffer, &mode, format)) {
9e2361b992206e Noralf Trønnes 2020-05-29  282  		buffer = drm_client_framebuffer_create(client, mode.hdisplay, mode.vdisplay,
9e2361b992206e Noralf Trønnes 2020-05-29  283  						       format);
9e2361b992206e Noralf Trønnes 2020-05-29  284  		if (IS_ERR(buffer))
9e2361b992206e Noralf Trønnes 2020-05-29  285  			return PTR_ERR(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  286  
9e2361b992206e Noralf Trønnes 2020-05-29  287  		vaddr = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  288  		if (IS_ERR(vaddr)) {
9e2361b992206e Noralf Trønnes 2020-05-29  289  			drm_client_framebuffer_delete(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  290  			return PTR_ERR(vaddr);
9e2361b992206e Noralf Trønnes 2020-05-29  291  		}
9e2361b992206e Noralf Trønnes 2020-05-29  292  
9e2361b992206e Noralf Trønnes 2020-05-29  293  		gdg->buffer_check = buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  294  	} else {
9e2361b992206e Noralf Trønnes 2020-05-29  295  		buffer = gdg->buffer;
9e2361b992206e Noralf Trønnes 2020-05-29  296  	}
9e2361b992206e Noralf Trønnes 2020-05-29  297  
9e2361b992206e Noralf Trønnes 2020-05-29  298  	ret = drm_client_modeset_set(client, connector, &mode, buffer->fb);
9e2361b992206e Noralf Trønnes 2020-05-29  299  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  300  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  301  
9e2361b992206e Noralf Trønnes 2020-05-29  302  	for (i = 0; i < req->num_properties; i++) {
9e2361b992206e Noralf Trønnes 2020-05-29  303  		u16 prop = le16_to_cpu(req->properties[i].prop);
9e2361b992206e Noralf Trønnes 2020-05-29  304  		u64 val = le64_to_cpu(req->properties[i].val);
9e2361b992206e Noralf Trønnes 2020-05-29  305  
9e2361b992206e Noralf Trønnes 2020-05-29  306  		if (gud_drm_gadget_set_connector_property(client, connector, prop, val, &ret)) {
9e2361b992206e Noralf Trønnes 2020-05-29  307  			if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  308  				return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  309  			continue;
9e2361b992206e Noralf Trønnes 2020-05-29  310  		}
9e2361b992206e Noralf Trønnes 2020-05-29  311  
9e2361b992206e Noralf Trønnes 2020-05-29  312  		switch (prop) {
9e2361b992206e Noralf Trønnes 2020-05-29  313  		case GUD_DRM_PROPERTY_BACKLIGHT_BRIGHTNESS:
9e2361b992206e Noralf Trønnes 2020-05-29  314  			if (val > 100)
9e2361b992206e Noralf Trønnes 2020-05-29  315  				return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  316  			gdg->brightness = val;
9e2361b992206e Noralf Trønnes 2020-05-29  317  			break;
9e2361b992206e Noralf Trønnes 2020-05-29  318  		case GUD_DRM_PROPERTY_ROTATION:
9e2361b992206e Noralf Trønnes 2020-05-29  319  			ret = drm_client_modeset_set_rotation(client, val);
9e2361b992206e Noralf Trønnes 2020-05-29  320  			break;
9e2361b992206e Noralf Trønnes 2020-05-29  321  		default:
9e2361b992206e Noralf Trønnes 2020-05-29  322  			pr_err("%s: Unknown property: %u\n", __func__, prop);
9e2361b992206e Noralf Trønnes 2020-05-29  323  			continue;
9e2361b992206e Noralf Trønnes 2020-05-29  324  		}
9e2361b992206e Noralf Trønnes 2020-05-29  325  
9e2361b992206e Noralf Trønnes 2020-05-29  326  		if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  327  			return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  328  	}
9e2361b992206e Noralf Trønnes 2020-05-29  329  
9e2361b992206e Noralf Trønnes 2020-05-29 @330  	ret = drm_client_modeset_check(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29  331  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  332  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  333  
9e2361b992206e Noralf Trønnes 2020-05-29  334  	gdg->check_ok = true;
9e2361b992206e Noralf Trønnes 2020-05-29  335  
9e2361b992206e Noralf Trønnes 2020-05-29  336  	return 0;
9e2361b992206e Noralf Trønnes 2020-05-29  337  }
9e2361b992206e Noralf Trønnes 2020-05-29  338  
9e2361b992206e Noralf Trønnes 2020-05-29  339  static int gud_drm_gadget_commit(struct gud_drm_gadget *gdg)
9e2361b992206e Noralf Trønnes 2020-05-29  340  {
9e2361b992206e Noralf Trønnes 2020-05-29  341  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  342  
9e2361b992206e Noralf Trønnes 2020-05-29  343  	if (!gdg->check_ok)
9e2361b992206e Noralf Trønnes 2020-05-29  344  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  345  
9e2361b992206e Noralf Trønnes 2020-05-29  346  	if (gdg->backlight) {
9e2361b992206e Noralf Trønnes 2020-05-29  347  		int val, max_brightness = gdg->backlight->props.max_brightness;
9e2361b992206e Noralf Trønnes 2020-05-29  348  
9e2361b992206e Noralf Trønnes 2020-05-29  349  		val = DIV64_U64_ROUND_UP(gdg->brightness * max_brightness, 100);
9e2361b992206e Noralf Trønnes 2020-05-29  350  		ret = backlight_device_set_brightness(gdg->backlight, val);
9e2361b992206e Noralf Trønnes 2020-05-29  351  		if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  352  			return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  353  	}
9e2361b992206e Noralf Trønnes 2020-05-29  354  
9e2361b992206e Noralf Trønnes 2020-05-29  355  	ret = drm_client_modeset_commit(&gdg->client);
9e2361b992206e Noralf Trønnes 2020-05-29  356  	if (ret)
9e2361b992206e Noralf Trønnes 2020-05-29  357  		return ret;
9e2361b992206e Noralf Trønnes 2020-05-29  358  
9e2361b992206e Noralf Trønnes 2020-05-29  359  	if (gdg->buffer_check) {
9e2361b992206e Noralf Trønnes 2020-05-29  360  		drm_client_framebuffer_delete(gdg->buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  361  		gdg->buffer = gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29  362  		gdg->buffer_check = NULL;
9e2361b992206e Noralf Trønnes 2020-05-29  363  	}
9e2361b992206e Noralf Trønnes 2020-05-29  364  
9e2361b992206e Noralf Trønnes 2020-05-29  365  	return 0;
9e2361b992206e Noralf Trønnes 2020-05-29  366  }
9e2361b992206e Noralf Trønnes 2020-05-29  367  
9e2361b992206e Noralf Trønnes 2020-05-29  368  static size_t gud_drm_gadget_write_buffer_memcpy(struct drm_client_buffer *buffer,
9e2361b992206e Noralf Trønnes 2020-05-29  369  						 const void *src, size_t len,
9e2361b992206e Noralf Trønnes 2020-05-29  370  						 struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29  371  {
9e2361b992206e Noralf Trønnes 2020-05-29  372  	unsigned int cpp = buffer->fb->format->cpp[0];
9e2361b992206e Noralf Trønnes 2020-05-29  373  	size_t dst_pitch = buffer->fb->pitches[0];
9e2361b992206e Noralf Trønnes 2020-05-29  374  	size_t src_pitch = drm_rect_width(rect) * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29  375  	unsigned int y;
9e2361b992206e Noralf Trønnes 2020-05-29  376  	void *dst;
9e2361b992206e Noralf Trønnes 2020-05-29  377  
9e2361b992206e Noralf Trønnes 2020-05-29  378  	/* Get the address, it's already mapped */
9e2361b992206e Noralf Trønnes 2020-05-29  379  	dst = drm_client_buffer_vmap(buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  380  	dst += rect->y1 * dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  381  	dst += rect->x1 * cpp;
9e2361b992206e Noralf Trønnes 2020-05-29  382  
9e2361b992206e Noralf Trønnes 2020-05-29  383  	for (y = 0; y < drm_rect_height(rect) && len; y++) {
9e2361b992206e Noralf Trønnes 2020-05-29  384  		src_pitch = min(src_pitch, len);
9e2361b992206e Noralf Trønnes 2020-05-29  385  		memcpy(dst, src, src_pitch);
9e2361b992206e Noralf Trønnes 2020-05-29  386  		src += src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  387  		dst += dst_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  388  		len -= src_pitch;
9e2361b992206e Noralf Trønnes 2020-05-29  389  	}
9e2361b992206e Noralf Trønnes 2020-05-29  390  
9e2361b992206e Noralf Trønnes 2020-05-29  391  	return len;
9e2361b992206e Noralf Trønnes 2020-05-29  392  }
9e2361b992206e Noralf Trønnes 2020-05-29  393  
9e2361b992206e Noralf Trønnes 2020-05-29  394  static bool gud_drm_gadget_check_rect(struct drm_client_buffer *buffer, struct drm_rect *rect)
9e2361b992206e Noralf Trønnes 2020-05-29  395  {
9e2361b992206e Noralf Trønnes 2020-05-29  396  	return buffer->fb && rect->x1 < rect->x2 && rect->y1 < rect->y2 &&
9e2361b992206e Noralf Trønnes 2020-05-29  397  	       rect->x2 <= buffer->fb->width && rect->y2 <= buffer->fb->height;
9e2361b992206e Noralf Trønnes 2020-05-29  398  }
9e2361b992206e Noralf Trønnes 2020-05-29  399  
9e2361b992206e Noralf Trønnes 2020-05-29  400  int gud_drm_gadget_write_buffer(struct gud_drm_gadget *gdg, const void *buf, size_t len)
9e2361b992206e Noralf Trønnes 2020-05-29  401  {
9e2361b992206e Noralf Trønnes 2020-05-29  402  	struct drm_client_buffer *buffer = gdg->buffer ? gdg->buffer : gdg->buffer_check;
9e2361b992206e Noralf Trønnes 2020-05-29  403  	struct drm_rect *rect = &gdg->set_buffer_rect;
9e2361b992206e Noralf Trønnes 2020-05-29  404  	u8 compression = gdg->set_buffer_compression;
9e2361b992206e Noralf Trønnes 2020-05-29  405  	struct drm_framebuffer *fb;
9e2361b992206e Noralf Trønnes 2020-05-29  406  	size_t remain;
9e2361b992206e Noralf Trønnes 2020-05-29  407  	int ret;
9e2361b992206e Noralf Trønnes 2020-05-29  408  
9e2361b992206e Noralf Trønnes 2020-05-29  409  	pr_debug("%s: len=%zu compression=0x%x\n", __func__, len, compression);
9e2361b992206e Noralf Trønnes 2020-05-29  410  
9e2361b992206e Noralf Trønnes 2020-05-29  411  	if (WARN_ON_ONCE(!buffer))
9e2361b992206e Noralf Trønnes 2020-05-29  412  		return -ENOMEM;
9e2361b992206e Noralf Trønnes 2020-05-29  413  
9e2361b992206e Noralf Trønnes 2020-05-29  414  	if (!gud_drm_gadget_check_rect(buffer, rect)) {
9e2361b992206e Noralf Trønnes 2020-05-29  415  		pr_err("%s: Rectangle doesn't fit: " DRM_RECT_FMT "\n",
9e2361b992206e Noralf Trønnes 2020-05-29  416  		       __func__, DRM_RECT_ARG(rect));
9e2361b992206e Noralf Trønnes 2020-05-29  417  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  418  	}
9e2361b992206e Noralf Trønnes 2020-05-29  419  
9e2361b992206e Noralf Trønnes 2020-05-29  420  	fb = buffer->fb;
9e2361b992206e Noralf Trønnes 2020-05-29  421  
9e2361b992206e Noralf Trønnes 2020-05-29  422  	if (compression & GUD_DRM_COMPRESSION_LZ4) {
9e2361b992206e Noralf Trønnes 2020-05-29  423  		if (len != gdg->set_buffer_compressed_length) {
9e2361b992206e Noralf Trønnes 2020-05-29  424  			pr_err("%s: Buffer compressed len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  425  			       __func__, len, gdg->set_buffer_compressed_length);
9e2361b992206e Noralf Trønnes 2020-05-29  426  			return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  427  		}
9e2361b992206e Noralf Trønnes 2020-05-29  428  
9e2361b992206e Noralf Trønnes 2020-05-29  429  		ret = LZ4_decompress_safe(buf, gdg->work_buf, len, gdg->max_buffer_size);
9e2361b992206e Noralf Trønnes 2020-05-29  430  		if (ret < 0) {
9e2361b992206e Noralf Trønnes 2020-05-29  431  			pr_err("%s: Failed to decompress buffer\n", __func__);
9e2361b992206e Noralf Trønnes 2020-05-29  432  			return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29  433  		}
9e2361b992206e Noralf Trønnes 2020-05-29  434  
9e2361b992206e Noralf Trønnes 2020-05-29  435  		buf = gdg->work_buf;
9e2361b992206e Noralf Trønnes 2020-05-29  436  		len = ret;
9e2361b992206e Noralf Trønnes 2020-05-29  437  	}
9e2361b992206e Noralf Trønnes 2020-05-29  438  
9e2361b992206e Noralf Trønnes 2020-05-29  439  	if (len != gdg->set_buffer_length) {
9e2361b992206e Noralf Trønnes 2020-05-29  440  		pr_err("%s: Buffer len differs: %zu != %zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  441  		       __func__, len, gdg->set_buffer_length);
9e2361b992206e Noralf Trønnes 2020-05-29  442  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  443  	}
9e2361b992206e Noralf Trønnes 2020-05-29  444  
9e2361b992206e Noralf Trønnes 2020-05-29  445  	if (len > (drm_rect_width(rect) * drm_rect_height(rect) * fb->format->cpp[0])) {
9e2361b992206e Noralf Trønnes 2020-05-29  446  		pr_err("%s: Buffer is too big for rectangle: " DRM_RECT_FMT " len=%zu\n",
9e2361b992206e Noralf Trønnes 2020-05-29  447  		       __func__, DRM_RECT_ARG(rect), len);
9e2361b992206e Noralf Trønnes 2020-05-29  448  		return -EINVAL;
9e2361b992206e Noralf Trønnes 2020-05-29  449  	}
9e2361b992206e Noralf Trønnes 2020-05-29  450  
9e2361b992206e Noralf Trønnes 2020-05-29  451  	remain = gud_drm_gadget_write_buffer_memcpy(buffer, buf, len, rect);
9e2361b992206e Noralf Trønnes 2020-05-29  452  	if (remain) {
9e2361b992206e Noralf Trønnes 2020-05-29  453  		pr_err("%s: Failed to write buffer: remain=%zu\n", __func__, remain);
9e2361b992206e Noralf Trønnes 2020-05-29  454  		return -EIO;
9e2361b992206e Noralf Trønnes 2020-05-29  455  	}
9e2361b992206e Noralf Trønnes 2020-05-29  456  
9e2361b992206e Noralf Trønnes 2020-05-29 @457  	return drm_client_framebuffer_flush(buffer, rect);
9e2361b992206e Noralf Trønnes 2020-05-29  458  }
9e2361b992206e Noralf Trønnes 2020-05-29  459  EXPORT_SYMBOL(gud_drm_gadget_write_buffer);
9e2361b992206e Noralf Trønnes 2020-05-29  460  

:::::: The code at line 330 was first introduced by commit
:::::: 9e2361b992206e76551d08195854205ba3a2b002 drm/gud: Add functionality for the USB gadget side

:::::: TO: Noralf Trønnes <noralf@tronnes.org>
:::::: CC: Lubomir Rintel <lkundrak@v3.sk>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 69783 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-18  7:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 11:28 [lkundrak-linux-mmp:lr/gud2 7/7] drivers/gpu/drm/gud/gud_drm_gadget.c:330:8: error: implicit declaration of function 'drm_client_modeset_check'; did you mean kernel test robot
2020-07-18  7:26 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.