All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/3] drm: LogiCVC display controller support
@ 2020-11-02 15:53 ` Paul Kocialkowski
  0 siblings, 0 replies; 23+ messages in thread
From: Paul Kocialkowski @ 2020-11-02 15:53 UTC (permalink / raw)
  To: dri-devel, devicetree, linux-kernel
  Cc: David Airlie, Daniel Vetter, Rob Herring, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Paul Kocialkowski,
	Thomas Petazzoni

This series introduces support for the LogiCVC display controller.
The controller is a bit unusual since it is usually loaded as
programmable logic on Xilinx FPGAs or Zynq-7000 SoCs.
More details are presented on the main commit for the driver.

More information about the controller is available on the dedicated
web page: https://www.logicbricks.com/Products/logiCVC-ML.aspx

Note that this driver has rather simple connector management, which was
not converted to drm_panel_bridge to keep the ability to enable the panel
at first vblank but also to support DVI.

Changes since v6:
- Updated to the latest DRM internal API changes; 
- Used an enum to index dt properties instead of the name string.

Changes since v5:
- Subclass DRM device and use devm_drm_dev_alloc for allocation;
- Removed call to drm_mode_config_cleanup (done automatically with devm);
- Some related code cleanups;
- Bring back not-for-merge patch adding colorkey support.

Changes since v4:
- Updated to internal DRM API changes (rebased on drm-misc-next);
- Added Kconfig dependency on OF;
- Added MAINTAINERS entry;
- Used drm_err and dev_err instead of DRM_ERROR where possible;
- Various cosmetic changes.

Changes since v3:
- Rebased on latest drm-misc;
- Improved event lock wrapping;
- Added collect tag;
- Added color-key support patch (not for merge, for reference only).

Changes since v2:
- Fixed and slightly improved dt schema.

Changes since v1:
- Switched dt bindings documentation to dt schema;
- Described more possible dt parameters;
- Added support for the lvds-3bit interface;
- Added support for grabbing syscon regmap from parent node;
- Removed layers count property and count layers child nodes instead.

Cheers!

Paul Kocialkowski (3):
  dt-bindings: display: Document the Xylon LogiCVC display controller
  drm: Add support for the LogiCVC display controller
  NOTFORMERGE: drm/logicvc: Add plane colorkey support

 .../display/xylon,logicvc-display.yaml        | 313 ++++++++
 MAINTAINERS                                   |   6 +
 drivers/gpu/drm/Kconfig                       |   2 +
 drivers/gpu/drm/Makefile                      |   1 +
 drivers/gpu/drm/logicvc/Kconfig               |   9 +
 drivers/gpu/drm/logicvc/Makefile              |   4 +
 drivers/gpu/drm/logicvc/logicvc_crtc.c        | 277 +++++++
 drivers/gpu/drm/logicvc/logicvc_crtc.h        |  21 +
 drivers/gpu/drm/logicvc/logicvc_drm.c         | 472 +++++++++++
 drivers/gpu/drm/logicvc/logicvc_drm.h         |  67 ++
 drivers/gpu/drm/logicvc/logicvc_interface.c   | 224 ++++++
 drivers/gpu/drm/logicvc/logicvc_interface.h   |  30 +
 drivers/gpu/drm/logicvc/logicvc_layer.c       | 750 ++++++++++++++++++
 drivers/gpu/drm/logicvc/logicvc_layer.h       |  71 ++
 drivers/gpu/drm/logicvc/logicvc_mode.c        | 101 +++
 drivers/gpu/drm/logicvc/logicvc_mode.h        |  15 +
 drivers/gpu/drm/logicvc/logicvc_of.c          | 197 +++++
 drivers/gpu/drm/logicvc/logicvc_of.h          |  46 ++
 drivers/gpu/drm/logicvc/logicvc_regs.h        |  88 ++
 19 files changed, 2694 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/xylon,logicvc-display.yaml
 create mode 100644 drivers/gpu/drm/logicvc/Kconfig
 create mode 100644 drivers/gpu/drm/logicvc/Makefile
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_crtc.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_crtc.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_drm.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_drm.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_interface.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_interface.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_layer.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_layer.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_mode.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_mode.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_of.c
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_of.h
 create mode 100644 drivers/gpu/drm/logicvc/logicvc_regs.h

-- 
2.28.0


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: [PATCH v7 2/3] drm: Add support for the LogiCVC display controller
@ 2020-11-14  6:50 kernel test robot
  0 siblings, 0 replies; 23+ messages in thread
From: kernel test robot @ 2020-11-14  6:50 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201102155308.142691-3-paul.kocialkowski@bootlin.com>
References: <20201102155308.142691-3-paul.kocialkowski@bootlin.com>
TO: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
TO: dri-devel(a)lists.freedesktop.org
TO: devicetree(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Rob Herring <robh+dt@kernel.org>
CC: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
CC: Maxime Ripard <mripard@kernel.org>
CC: Thomas Zimmermann <tzimmermann@suse.de>
CC: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Hi Paul,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm-exynos/exynos-drm-next]
[also build test WARNING on tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.10-rc3 next-20201113]
[cannot apply to drm-intel/for-linux-next drm/drm-next]
[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/Paul-Kocialkowski/drm-LogiCVC-display-controller-support/20201102-235352
base:   https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git exynos-drm-next
:::::: branch date: 12 days ago
:::::: commit date: 12 days ago
config: x86_64-randconfig-m001-20201114 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
drivers/gpu/drm/logicvc/logicvc_layer.c:312 logicvc_layer_buffer_find_setup() warn: impossible condition '(hoffset > (((((1))) << (16)) - 1)) => (0-u16max > u16max)'

vim +312 drivers/gpu/drm/logicvc/logicvc_layer.c

a88f67f141f33b2 Paul Kocialkowski 2020-11-02  249  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  250  int logicvc_layer_buffer_find_setup(struct logicvc_drm *logicvc,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  251  				    struct logicvc_layer *layer,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  252  				    struct drm_plane_state *state,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  253  				    struct logicvc_layer_buffer_setup *setup)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  254  {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  255  	struct drm_device *drm_dev = &logicvc->drm_dev;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  256  	struct drm_framebuffer *fb = state->fb;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  257  	/* All the supported formats have a single data plane. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  258  	u32 layer_bytespp = fb->format->cpp[0];
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  259  	u32 layer_stride = layer_bytespp * logicvc->config.row_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  260  	u32 base_offset = layer->config.base_offset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  261  	u32 buffer_offset = layer->config.buffer_offset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  262  	u8 buffer_sel = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  263  	u16 voffset = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  264  	u16 hoffset = 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  265  	phys_addr_t fb_addr;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  266  	u32 fb_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  267  	u32 gap;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  268  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  269  	if (!logicvc->reserved_mem_base) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  270  		drm_err(drm_dev, "No reserved memory base was registered!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  271  		return -ENOMEM;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  272  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  273  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  274  	fb_addr = drm_fb_cma_get_gem_addr(fb, state, 0);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  275  	if (fb_addr < logicvc->reserved_mem_base) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  276  		drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  277  			"Framebuffer memory below reserved memory base!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  278  		return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  279  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  280  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  281  	fb_offset = (u32) (fb_addr - logicvc->reserved_mem_base);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  282  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  283  	if (fb_offset < base_offset) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  284  		drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  285  			"Framebuffer offset below layer base offset!\n");
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  286  		return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  287  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  288  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  289  	gap = fb_offset - base_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  290  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  291  	/* Use the possible video buffers selection. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  292  	if (gap && buffer_offset) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  293  		buffer_sel = gap / buffer_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  294  		if (buffer_sel > LOGICVC_BUFFER_SEL_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  295  			buffer_sel = LOGICVC_BUFFER_SEL_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  296  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  297  		gap -= buffer_sel * buffer_offset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  298  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  299  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  300  	/* Use the vertical offset. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  301  	if (gap && layer_stride && logicvc->config.layers_configurable) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  302  		voffset = gap / layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  303  		if (voffset > LOGICVC_LAYER_VOFFSET_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  304  			voffset = LOGICVC_LAYER_VOFFSET_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  305  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  306  		gap -= voffset * layer_stride;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  307  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  308  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  309  	/* Use the horizontal offset. */
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  310  	if (gap && layer_bytespp && logicvc->config.layers_configurable) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  311  		hoffset = gap / layer_bytespp;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02 @312  		if (hoffset > LOGICVC_DIMENSIONS_MAX)
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  313  			hoffset = LOGICVC_DIMENSIONS_MAX;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  314  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  315  		gap -= hoffset * layer_bytespp;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  316  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  317  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  318  	if (gap) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  319  		drm_err(drm_dev,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  320  			"Unable to find layer %d buffer setup for 0x%x byte gap\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  321  			layer->index, fb_offset - base_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  322  		return -EINVAL;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  323  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  324  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  325  	DRM_DEBUG_DRIVER("Found layer %d buffer setup for 0x%x byte gap:\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  326  			 layer->index, fb_offset - base_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  327  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  328  	DRM_DEBUG_DRIVER("- buffer_sel = 0x%x chunks of 0x%x bytes\n",
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  329  			 buffer_sel, buffer_offset);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  330  	DRM_DEBUG_DRIVER("- voffset = 0x%x chunks of 0x%x bytes\n", voffset,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  331  			 layer_stride);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  332  	DRM_DEBUG_DRIVER("- hoffset = 0x%x chunks of 0x%x bytes\n", hoffset,
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  333  			 layer_bytespp);
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  334  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  335  	if (setup) {
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  336  		setup->buffer_sel = buffer_sel;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  337  		setup->voffset = voffset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  338  		setup->hoffset = hoffset;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  339  	}
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  340  
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  341  	return 0;
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  342  }
a88f67f141f33b2 Paul Kocialkowski 2020-11-02  343  

---
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: 27764 bytes --]

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

end of thread, other threads:[~2020-12-11 13:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 15:53 [PATCH v7 0/3] drm: LogiCVC display controller support Paul Kocialkowski
2020-11-02 15:53 ` Paul Kocialkowski
2020-11-02 15:53 ` [PATCH v7 1/3] dt-bindings: display: Document the Xylon LogiCVC display controller Paul Kocialkowski
2020-11-02 15:53   ` Paul Kocialkowski
2020-11-04 18:32   ` Rob Herring
2020-11-04 18:32     ` Rob Herring
2020-11-02 15:53 ` [PATCH v7 2/3] drm: Add support for the " Paul Kocialkowski
2020-11-02 15:53   ` Paul Kocialkowski
2020-11-03  9:46   ` Maxime Ripard
2020-11-03  9:46     ` Maxime Ripard
2020-12-02 16:06     ` Paul Kocialkowski
2020-12-02 16:06       ` Paul Kocialkowski
2020-12-07 10:42       ` Maxime Ripard
2020-12-07 10:42         ` Maxime Ripard
2020-12-11 13:17         ` Paul Kocialkowski
2020-12-11 13:17           ` Paul Kocialkowski
2020-11-04 21:22   ` Sam Ravnborg
2020-11-04 21:22     ` Sam Ravnborg
2020-12-02 15:36     ` Paul Kocialkowski
2020-12-02 15:36       ` Paul Kocialkowski
2020-11-02 15:53 ` [PATCH v7 3/3] NOTFORMERGE: drm/logicvc: Add plane colorkey support Paul Kocialkowski
2020-11-02 15:53   ` Paul Kocialkowski
  -- strict thread matches above, loose matches on Subject: below --
2020-11-14  6:50 [PATCH v7 2/3] drm: Add support for the LogiCVC display controller 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.