Skip to contentSkip to conversation

Armada DRM stuff

PATCH In review Russell King - ARM Linux 8 participants 43 messages Oct 6, 2013 – Oct 22, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Armada DRM stuff

The Armada DRM drivers again, along with the TDA998x HDMI output support, and an illustration to show how to add Armada 610 support (and others.)

Rob has looked at this a couple of times since its last posting, and has provided additional useful feedback which has been incorporated. I believe all the major issues have been addressed now.

 drivers/gpu/drm/Kconfig                 |    2 +
 drivers/gpu/drm/Makefile                |    1 +
 drivers/gpu/drm/armada/Kconfig          |   24 +
 drivers/gpu/drm/armada/Makefile         |    8 +
 drivers/gpu/drm/armada/armada_510.c     |   87 +++
 drivers/gpu/drm/armada/armada_610.c     |   49 ++
 drivers/gpu/drm/armada/armada_crtc.c    | 1099 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.h    |   83 +++
 drivers/gpu/drm/armada/armada_debugfs.c |  183 +++++
 drivers/gpu/drm/armada/armada_drm.h     |  114 ++++
 drivers/gpu/drm/armada/armada_drv.c     |  428 ++++++++++++
 drivers/gpu/drm/armada/armada_fb.c      |  170 +++++
 drivers/gpu/drm/armada/armada_fb.h      |   24 +
 drivers/gpu/drm/armada/armada_fbdev.c   |  202 ++++++
 drivers/gpu/drm/armada/armada_gem.c     |  616 +++++++++++++++++
 drivers/gpu/drm/armada/armada_gem.h     |   52 ++
 drivers/gpu/drm/armada/armada_hw.h      |  326 +++++++++
 drivers/gpu/drm/armada/armada_ioctlP.h  |   18 +
 drivers/gpu/drm/armada/armada_output.c  |  158 +++++
 drivers/gpu/drm/armada/armada_output.h  |   39 ++
 drivers/gpu/drm/armada/armada_overlay.c |  477 ++++++++++++++
 drivers/gpu/drm/armada/armada_slave.c   |  139 ++++
 drivers/gpu/drm/armada/armada_slave.h   |   26 +
 drivers/gpu/drm/i2c/tda998x_drv.c       |    2 +
 include/drm/drm_crtc.h                  |   17 +
 include/uapi/drm/armada_drm.h           |   45 ++
 26 files changed, 4389 insertions(+), 0 deletions(-)
#1 lore raw

PATCH 1/5 drm/i2c: tda998x: set VIF for full range, underscanned display

---
 drivers/gpu/drm/i2c/tda998x_drv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/i2c/tda998x_drv.c +2 -0
index 60e8404..704040b5 100644
@@ -549,6 +549,8 @@ tda998x_write_avi(struct drm_encoder *encoder, struct drm_display_mode *mode)
 	buf[HB(0)] = 0x82;
 	buf[HB(1)] = 0x02;
 	buf[HB(2)] = 13;
+	buf[PB(1)] = 2; /* underscanned display */
+	buf[PB(3)] = 2 << 2; /* full range */
 	buf[PB(4)] = drm_match_cea_mode(mode);
 
 	tda998x_write_if(encoder, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf,
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [PATCH 1/5] drm/i2c: tda998x: set VIF for full range, underscanned display

Quoted 10 lines · On Sun, 06 Oct 2013 23:07:55 +0100 Russell King <[email protected]>…
---
 drivers/gpu/drm/i2c/tda998x_drv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/i2c/tda998x_drv.c +0 -0
index 60e8404..704040b5 100644

drivers/gpu/drm/i2c/tda998x_drv.c tda998x_write_avi(struct drm_encoder *encoder, struct drm_display_mode *mode) · line 556

Quoted 8 lines
drivers/gpu/drm/i2c/tda998x_drv.c +2 -0
@@ -549,6 +549,8 @@ tda998x_write_avi(struct drm_encoder *encoder, struct drm_display_mode *mode)
 	buf[HB(0)] = 0x82;
 	buf[HB(1)] = 0x02;
 	buf[HB(2)] = 13;
+	buf[PB(1)] = 2; /* underscanned display */
+	buf[PB(3)] = 2 << 2; /* full range */
 	buf[PB(4)] = drm_match_cea_mode(mode);
 
 	tda998x_write_if(encoder, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf,

You should use the 'hdmi.h' constants which are meaningful enough:

	buf[PB(1)] = HDMI_SCAN_MODE_UNDERSCAN;
	buf[PB(3)] = HDMI_QUANTIZATION_RANGE_FULL << 2;
Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by
#3 lore raw

Re: [PATCH 1/5] drm/i2c: tda998x: set VIF for full range, underscanned display

Quoted 20 lines · Jean-Francois Moine
Quoted 17 lines · On Sun, 06 Oct 2013 23:07:55 +0100 Russell King <[email protected]>…
---
 drivers/gpu/drm/i2c/tda998x_drv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/gpu/drm/i2c/tda998x_drv.c +2 -0
index 60e8404..704040b5 100644
@@ -549,6 +549,8 @@ tda998x_write_avi(struct drm_encoder *encoder, struct drm_display_mode *mode)
      buf[HB(0)] = 0x82;
      buf[HB(1)] = 0x02;
      buf[HB(2)] = 13;
+     buf[PB(1)] = 2; /* underscanned display */
+     buf[PB(3)] = 2 << 2; /* full range */
      buf[PB(4)] = drm_match_cea_mode(mode);
 
Quoted 7 lines

drivers/gpu/drm/i2c/tda998x_drv.c tda998x_write_avi(struct drm_encoder *encoder, struct drm_display_mode *mode) · line 556

Quoted 1 line
drivers/gpu/drm/i2c/tda998x_drv.c +0 -0
      tda998x_write_if(encoder, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf,

You should use the 'hdmi.h' constants which are meaningful enough:

        buf[PB(1)] = HDMI_SCAN_MODE_UNDERSCAN;
        buf[PB(3)] = HDMI_QUANTIZATION_RANGE_FULL << 2;

with the update to use hdmi.h const, this has my

(and other ones I replied last night, s/s-o-b/r-b/)

Quoted 3 lines

--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/

#4 lore raw

PATCH 2/5 DRM: Armada: Add Armada DRM driver

In reply to Russell King - ARM Linux

This patch adds support for the pair of LCD controllers on the Marvell Armada 510 SoCs. This driver supports:
- multiple contiguous scanout buffers for video and graphics
- shm backed cacheable buffer objects for X pixmaps for Vivante GPU acceleration
- dual lcd0 and lcd1 crt operation
- video overlay on each LCD crt via DRM planes
- page flipping of the main scanout buffers
- DRM prime for buffer export/import

This driver is trivial to extend to other Armada SoCs.

Included in this commit is the core driver with no output support; output support is platform and encoder driver dependent.

---
 drivers/gpu/drm/Kconfig                 |    2 +
 drivers/gpu/drm/Makefile                |    1 +
 drivers/gpu/drm/armada/Kconfig          |   15 +
 drivers/gpu/drm/armada/Makefile         |    7 +
 drivers/gpu/drm/armada/armada_510.c     |   86 +++
 drivers/gpu/drm/armada/armada_crtc.c    |  861 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.h    |   74 +++
 drivers/gpu/drm/armada/armada_debugfs.c |  183 +++++++
 drivers/gpu/drm/armada/armada_drm.h     |  112 ++++
 drivers/gpu/drm/armada/armada_drv.c     |  380 ++++++++++++++
 drivers/gpu/drm/armada/armada_fb.c      |  170 ++++++
 drivers/gpu/drm/armada/armada_fb.h      |   24 +
 drivers/gpu/drm/armada/armada_fbdev.c   |  202 ++++++++
 drivers/gpu/drm/armada/armada_gem.c     |  616 ++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_gem.h     |   52 ++
 drivers/gpu/drm/armada/armada_hw.h      |  316 +++++++++++
 drivers/gpu/drm/armada/armada_ioctlP.h  |   18 +
 drivers/gpu/drm/armada/armada_output.c  |  158 ++++++
 drivers/gpu/drm/armada/armada_output.h  |   39 ++
 drivers/gpu/drm/armada/armada_overlay.c |  477 +++++++++++++++++
 drivers/gpu/drm/armada/armada_slave.c   |  139 +++++
 drivers/gpu/drm/armada/armada_slave.h   |   26 +
 include/drm/drm_crtc.h                  |   17 +
 include/uapi/drm/armada_drm.h           |   45 ++
 24 files changed, 4020 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/armada/Kconfig
 create mode 100644 drivers/gpu/drm/armada/Makefile
 create mode 100644 drivers/gpu/drm/armada/armada_510.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.h
 create mode 100644 drivers/gpu/drm/armada/armada_debugfs.c
 create mode 100644 drivers/gpu/drm/armada/armada_drm.h
 create mode 100644 drivers/gpu/drm/armada/armada_drv.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.h
 create mode 100644 drivers/gpu/drm/armada/armada_fbdev.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.h
 create mode 100644 drivers/gpu/drm/armada/armada_hw.h
 create mode 100644 drivers/gpu/drm/armada/armada_ioctlP.h
 create mode 100644 drivers/gpu/drm/armada/armada_output.c
 create mode 100644 drivers/gpu/drm/armada/armada_output.h
 create mode 100644 drivers/gpu/drm/armada/armada_overlay.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.h
 create mode 100644 include/uapi/drm/armada_drm.h
drivers/gpu/drm/Kconfig +2 -0
index 955555d..3b5176d 100644
@@ -225,6 +225,8 @@ source "drivers/gpu/drm/mgag200/Kconfig"
 
 source "drivers/gpu/drm/cirrus/Kconfig"
 
+source "drivers/gpu/drm/armada/Kconfig"
+
 source "drivers/gpu/drm/rcar-du/Kconfig"
 
 source "drivers/gpu/drm/shmobile/Kconfig"
drivers/gpu/drm/Makefile +1 -0
index f089adf..385f460 100644
@@ -49,6 +49,7 @@ obj-$(CONFIG_DRM_EXYNOS) +=exynos/
 obj-$(CONFIG_DRM_GMA500) += gma500/
 obj-$(CONFIG_DRM_UDL) += udl/
 obj-$(CONFIG_DRM_AST) += ast/
+obj-$(CONFIG_DRM_ARMADA) += armada/
 obj-$(CONFIG_DRM_RCAR_DU) += rcar-du/
 obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
 obj-$(CONFIG_DRM_OMAP)	+= omapdrm/
drivers/gpu/drm/armada/Kconfig new file +15 -0
new file mode 100644
index 0000000..c7a0a94
@@ -0,0 +1,15 @@
+config DRM_ARMADA
+	tristate "DRM support for Marvell Armada SoCs"
+	depends on DRM && HAVE_CLK
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	select DRM_KMS_HELPER
+	help
+	  Support the "LCD" controllers found on the Marvell Armada 510
+	  devices.  There are two controllers on the device, each controller
+	  supports graphics and video overlays.
+
+	  This driver provides no built-in acceleration; acceleration is
+	  performed by other IP found on the SoC.  This driver provides
+	  kernel mode setting and buffer management to userspace.
drivers/gpu/drm/armada/Makefile new file +7 -0
new file mode 100644
index 0000000..d6f43e0
@@ -0,0 +1,7 @@
+armada-y	:= armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
+		   armada_gem.o armada_output.o armada_overlay.o \
+		   armada_slave.o
+armada-y	+= armada_510.o
+armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
+
+obj-$(CONFIG_DRM_ARMADA) := armada.o
drivers/gpu/drm/armada/armada_510.c new file +86 -0

86 lines not on this page · raw message

drivers/gpu/drm/armada/armada_crtc.c new file +861 -0

861 lines not on this page · raw message

drivers/gpu/drm/armada/armada_crtc.h new file +74 -0

74 lines not on this page · raw message

drivers/gpu/drm/armada/armada_debugfs.c new file +183 -0

183 lines not on this page · raw message

drivers/gpu/drm/armada/armada_drm.h new file +112 -0

112 lines not on this page · raw message

drivers/gpu/drm/armada/armada_drv.c new file +380 -0

380 lines not on this page · raw message

drivers/gpu/drm/armada/armada_fb.c new file +170 -0

170 lines not on this page · raw message

drivers/gpu/drm/armada/armada_fb.h new file +24 -0
new file mode 100644
index 0000000..ce3f12e
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ARMADA_FB_H
+#define ARMADA_FB_H
+
+struct armada_framebuffer {
+	struct drm_framebuffer	fb;
+	struct armada_gem_object *obj;
+	uint8_t			fmt;
+	uint8_t			mod;
+};
+#define drm_fb_to_armada_fb(dfb) \
+	container_of(dfb, struct armada_framebuffer, fb)
+#define drm_fb_obj(fb) drm_fb_to_armada_fb(fb)->obj
+
+struct armada_framebuffer *armada_framebuffer_create(struct drm_device *,
+	struct drm_mode_fb_cmd2 *, struct armada_gem_object *);
+
+#endif
drivers/gpu/drm/armada/armada_fbdev.c new file +202 -0

202 lines not on this page · raw message

drivers/gpu/drm/armada/armada_gem.c new file +616 -0

616 lines not on this page · raw message

drivers/gpu/drm/armada/armada_gem.h new file +52 -0

52 lines not on this page · raw message

drivers/gpu/drm/armada/armada_hw.h new file +316 -0

203 lines not on this page · raw message

drivers/gpu/drm/armada/armada_ioctlP.h new file +18 -0
new file mode 100644
index 0000000..bd8c456

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/armada/armada_output.c new file +158 -0

158 lines not on this page · raw message

drivers/gpu/drm/armada/armada_output.h new file +39 -0
new file mode 100644
index 0000000..4126d43

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/armada/armada_overlay.c new file +477 -0

477 lines not on this page · raw message

drivers/gpu/drm/armada/armada_slave.c new file +139 -0

139 lines not on this page · raw message

drivers/gpu/drm/armada/armada_slave.h new file +26 -0
new file mode 100644
index 0000000..bf2374c

Lines of this file are not shown. View the raw message.

include/drm/drm_crtc.h +17 -0
index 24f4995..e5e6e91 100644

Lines of this file are not shown. View the raw message.

include/uapi/drm/armada_drm.h new file +45 -0

45 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.4.4

Part of the diff is not shown here. View the raw message.

Reviewed-by on v1 2/5
#5 lore raw

Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver

Quoted 10 lines · Russell King

This patch adds support for the pair of LCD controllers on the Marvell Armada 510 SoCs. This driver supports:
- multiple contiguous scanout buffers for video and graphics
- shm backed cacheable buffer objects for X pixmaps for Vivante GPU acceleration
- dual lcd0 and lcd1 crt operation
- video overlay on each LCD crt via DRM planes
- page flipping of the main scanout buffers
- DRM prime for buffer export/import

Quoted 4 lines

This driver is trivial to extend to other Armada SoCs.

Included in this commit is the core driver with no output support; output support is platform and encoder driver dependent.

w/ a couple minor comments below:

Quoted 49 lines
---
 drivers/gpu/drm/Kconfig                 |    2 +
 drivers/gpu/drm/Makefile                |    1 +
 drivers/gpu/drm/armada/Kconfig          |   15 +
 drivers/gpu/drm/armada/Makefile         |    7 +
 drivers/gpu/drm/armada/armada_510.c     |   86 +++
 drivers/gpu/drm/armada/armada_crtc.c    |  861 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.h    |   74 +++
 drivers/gpu/drm/armada/armada_debugfs.c |  183 +++++++
 drivers/gpu/drm/armada/armada_drm.h     |  112 ++++
 drivers/gpu/drm/armada/armada_drv.c     |  380 ++++++++++++++
 drivers/gpu/drm/armada/armada_fb.c      |  170 ++++++
 drivers/gpu/drm/armada/armada_fb.h      |   24 +
 drivers/gpu/drm/armada/armada_fbdev.c   |  202 ++++++++
 drivers/gpu/drm/armada/armada_gem.c     |  616 ++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_gem.h     |   52 ++
 drivers/gpu/drm/armada/armada_hw.h      |  316 +++++++++++
 drivers/gpu/drm/armada/armada_ioctlP.h  |   18 +
 drivers/gpu/drm/armada/armada_output.c  |  158 ++++++
 drivers/gpu/drm/armada/armada_output.h  |   39 ++
 drivers/gpu/drm/armada/armada_overlay.c |  477 +++++++++++++++++
 drivers/gpu/drm/armada/armada_slave.c   |  139 +++++
 drivers/gpu/drm/armada/armada_slave.h   |   26 +
 include/drm/drm_crtc.h                  |   17 +
 include/uapi/drm/armada_drm.h           |   45 ++
 24 files changed, 4020 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/armada/Kconfig
 create mode 100644 drivers/gpu/drm/armada/Makefile
 create mode 100644 drivers/gpu/drm/armada/armada_510.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.h
 create mode 100644 drivers/gpu/drm/armada/armada_debugfs.c
 create mode 100644 drivers/gpu/drm/armada/armada_drm.h
 create mode 100644 drivers/gpu/drm/armada/armada_drv.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.h
 create mode 100644 drivers/gpu/drm/armada/armada_fbdev.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.h
 create mode 100644 drivers/gpu/drm/armada/armada_hw.h
 create mode 100644 drivers/gpu/drm/armada/armada_ioctlP.h
 create mode 100644 drivers/gpu/drm/armada/armada_output.c
 create mode 100644 drivers/gpu/drm/armada/armada_output.h
 create mode 100644 drivers/gpu/drm/armada/armada_overlay.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.h
 create mode 100644 include/uapi/drm/armada_drm.h

[snip]

Quoted 7 lines
drivers/gpu/drm/armada/armada_crtc.c new file +7 -0
+/*
+ * Prepare for a mode set.  Turn off overlay to ensure that we don't end
+ * up with the overlay size being bigger than the active screen size.
+ * We rely upon X refreshing this state after the mode set has completed.
+ *
+ * The mode_config.mutex will be held for this call
+ */

drivers/gpu/drm/armada/armada_crtc.c line 308

Quoted 10 lines
drivers/gpu/drm/armada/armada_crtc.c new file +10 -0
+static void armada_drm_crtc_prepare(struct drm_crtc *crtc)
+{
+       struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
+       struct drm_plane *plane;
+
+       /*
+        * If we have an overlay plane associated with this CRTC, disable
+        * it before the modeset to avoid its coordinates being outside
+        * the new mode parameters.  DRM doesn't provide help with this.
+        */

Getting a bit off topic, but yeah.. I'd be in favor of "clarifying" things by having crtc helpers disable planes on setcrtc (rather than only doing this on fbdev/lastclose restore). I
don't know of any userspace that this would cause problems for. But not really sure if it would be considered an interface break or just "fixing a bug".. since we have different behavior on different drivers, I'd lean towards the latter.

Quoted 38 lines
drivers/gpu/drm/armada/armada_crtc.c new file +10 -0
+       plane = dcrtc->plane;
+       if (plane) {
+               struct drm_framebuffer *fb = plane->fb;
+
+               plane->funcs->disable_plane(plane);
+               plane->fb = NULL;
+               plane->crtc = NULL;
+               drm_framebuffer_unreference(fb);
+       }
+}
drivers/gpu/drm/armada/armada_gem.c new file +20 -0
new file mode 100644
index 0000000..c865a9a
@@ -0,0 +1,616 @@
+/*
+ * Copyright (C) 2012 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/dma-buf.h>
+#include <linux/dma-mapping.h>
+#include <linux/shmem_fs.h>
+#include <drm/drmP.h>
+#include "armada_drm.h"
+#include "armada_gem.h"
+#include <drm/armada_drm.h>
+#include "armada_ioctlP.h"
+
+static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+       struct armada_gem_object *obj = drm_to_armada_gem(vma->vm_private_data);
+       unsigned long addr = (unsigned long)vmf->virtual_address;

drivers/gpu/drm/armada/armada_gem.c line 30

Quoted 10 lines
drivers/gpu/drm/armada/armada_gem.c new file +10 -0
+       unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
+       int ret;
+
+       pfn += (addr - vma->vm_start) >> PAGE_SHIFT;
+       ret = vm_insert_pfn(vma, addr, pfn);
+
+       switch (ret) {
+       case -EIO:
+       case -EAGAIN:
+               set_need_resched();

probably this thread is applicable here too?

https://lkml.org/lkml/2013/9/12/417

(although.. we have at least a few slightly differet variants on the same errno -> VM_FAULT_x switch in different drivers.. maybe we should do something better)

Quoted 12 lines
drivers/gpu/drm/armada/armada_gem.c new file +12 -0
+       case 0:
+       case -ERESTARTSYS:
+       case -EINTR:
+       case -EBUSY:
+               return VM_FAULT_NOPAGE;
+       case -ENOMEM:
+               return VM_FAULT_OOM;
+       default:
+               return VM_FAULT_SIGBUS;
+       }
+}
+

[snip]

Quoted 21 lines
drivers/gpu/drm/armada/armada_gem.c new file +21 -0
+/* Prime support */
+struct sg_table *
+armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
+       enum dma_data_direction dir)
+{
+       struct drm_gem_object *obj = attach->dmabuf->priv;
+       struct armada_gem_object *dobj = drm_to_armada_gem(obj);
+       struct scatterlist *sg;
+       struct sg_table *sgt;
+       int i, num;
+
+       sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
+       if (!sgt)
+               return NULL;
+
+       if (dobj->obj.filp) {
+               struct address_space *mapping;
+               gfp_t gfp;
+               int count;
+
+               count = dobj->obj.size / PAGE_SIZE;

drivers/gpu/drm/armada/armada_gem.c line 453

Quoted 10 lines
drivers/gpu/drm/armada/armada_gem.c new file +10 -0
+               if (sg_alloc_table(sgt, count, GFP_KERNEL))
+                       goto free_sgt;
+
+               mapping = file_inode(dobj->obj.filp)->i_mapping;
+               gfp = mapping_gfp_mask(mapping);
+
+               for_each_sg(sgt->sgl, sg, count, i) {
+                       struct page *page;
+
+                       page = shmem_read_mapping_page_gfp(mapping, i, gfp);

you could almost use drm_gem_get_pages().. although I guess you otherwise have no need for the page[] array?

(the page array would be handy if you supported mmap on shmem backed files.. which as long as they are cached should be the easy case)

Quoted 41 lines
drivers/gpu/drm/armada/armada_gem.c new file +41 -0
+                       if (IS_ERR(page)) {
+                               num = i;
+                               goto release;
+                       }
+
+                       sg_set_page(sg, page, PAGE_SIZE, 0);
+               }
+
+               if (dma_map_sg(attach->dev, sgt->sgl, sgt->nents, dir) == 0) {
+                       num = sgt->nents;
+                       goto release;
+               }
+       } else if (dobj->page) {
+               /* Single contiguous page */
+               if (sg_alloc_table(sgt, 1, GFP_KERNEL))
+                       goto free_sgt;
+
+               sg_set_page(sgt->sgl, dobj->page, dobj->obj.size, 0);
+
+               if (dma_map_sg(attach->dev, sgt->sgl, sgt->nents, dir) == 0)
+                       goto free_table;
+       } else if (dobj->linear) {
+               /* Single contiguous physical region - no struct page */
+               if (sg_alloc_table(sgt, 1, GFP_KERNEL))
+                       goto free_sgt;
+               sg_dma_address(sgt->sgl) = dobj->dev_addr;
+               sg_dma_len(sgt->sgl) = dobj->obj.size;
+       } else {
+               goto free_sgt;
+       }
+       return sgt;
+
+ release:
+       for_each_sg(sgt->sgl, sg, num, i)
+               page_cache_release(sg_page(sg));
+ free_table:
+       sg_free_table(sgt);
+ free_sgt:
+       kfree(sgt);
+       return NULL;
+}

[snip]

Quoted 15 lines

+> diff --git a/include/uapi/drm/armada_drm.h b/include/uapi/drm/armada_drm.h new file mode 100644
index 0000000..8dec3fd

include/uapi/drm/armada_drm.h new file +9 -0
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Russell King
+ *  With inspiration from the i915 driver
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef DRM_ARMADA_IOCTL_H

include/uapi/drm/armada_drm.h line 19

Quoted 10 lines
include/uapi/drm/armada_drm.h new file +10 -0
+#define DRM_ARMADA_IOCTL_H
+
+#define DRM_ARMADA_GEM_CREATE          0x00
+#define DRM_ARMADA_GEM_MMAP            0x02
+#define DRM_ARMADA_GEM_PWRITE          0x03
+
+#define ARMADA_IOCTL(dir, name, str) \
+       DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
+
+struct drm_armada_gem_create {

Any reason not to throw in a 'uint32_t flags' field? At least then you could indicate what sort of backing memory you want, and do things like allocate linear scanout buffer w/ your gem_create rather than having to use dumb_create. Maybe not something you need now, but seems like eventually you'll come up with some reason or another to want to pass some flags into gem_create.

Quoted 29 lines
include/uapi/drm/armada_drm.h new file +26 -1
+       uint32_t handle;
+       uint32_t size;
+};
+#define DRM_IOCTL_ARMADA_GEM_CREATE \
+       ARMADA_IOCTL(IOWR, GEM_CREATE, gem_create)
+
+struct drm_armada_gem_mmap {
+       uint32_t handle;
+       uint32_t pad;
+       uint64_t offset;
+       uint64_t size;
+       uint64_t addr;
+};
+#define DRM_IOCTL_ARMADA_GEM_MMAP \
+       ARMADA_IOCTL(IOWR, GEM_MMAP, gem_mmap)
+
+struct drm_armada_gem_pwrite {
+       uint64_t ptr;
+       uint32_t handle;
+       uint32_t offset;
+       uint32_t size;
+};
+#define DRM_IOCTL_ARMADA_GEM_PWRITE \
+       ARMADA_IOCTL(IOW, GEM_PWRITE, gem_pwrite)
+
+#endif
--

1.7.4.4

#6 lore raw

Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver

Quoted 8 lines · Rob Clark

drivers/gpu/drm/armada/armada_crtc.c line 308

Quoted 5 lines · Russell King
drivers/gpu/drm/armada/armada_crtc.c new file +5 -0
+       /*
+        * If we have an overlay plane associated with this CRTC, disable
+        * it before the modeset to avoid its coordinates being outside
+        * the new mode parameters.  DRM doesn't provide help with this.
+        */
Quoted 7 lines

Getting a bit off topic, but yeah.. I'd be in favor of "clarifying" things by having crtc helpers disable planes on setcrtc (rather than only doing this on fbdev/lastclose restore). I
don't know of any userspace that this would cause problems for. But not really sure if it would be considered an interface break or just "fixing a bug".. since we have different behavior on different drivers, I'd lean towards the latter.

The reasoning here is if the overlay plane is larger than the mode being set, we will end up having the hardware programmed in an inconsistent state - the overlay plane position/width/height can be outside of the active region, which is invalid for the hardware. So, it's safer to disable the plane and wait for the next plane to be sent and have that validated against the new mode.

It's not like you would be able to see the plane immediately, because most monitors blank while they retrain to the new mode settings.

Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/armada/armada_gem.c new file +4 -0
+static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+       struct armada_gem_object *obj = drm_to_armada_gem(vma->vm_private_data);
+       unsigned long addr = (unsigned long)vmf->virtual_address;

drivers/gpu/drm/armada/armada_gem.c line 30

Quoted 10 lines
drivers/gpu/drm/armada/armada_gem.c new file +10 -0
+       unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
+       int ret;
+
+       pfn += (addr - vma->vm_start) >> PAGE_SHIFT;
+       ret = vm_insert_pfn(vma, addr, pfn);
+
+       switch (ret) {
+       case -EIO:
+       case -EAGAIN:
+               set_need_resched();

probably this thread is applicable here too?

Quoted 5 lines

https://lkml.org/lkml/2013/9/12/417

(although.. we have at least a few slightly differet variants on the same errno -> VM_FAULT_x switch in different drivers.. maybe we should do something better)

Hmm. It seems today's vm_insert_pfn() has the following error return values:

-EFAULT - virtual address outside vma
-EINVAL - track_pfn_insert() failure
-ENOMEM - failed to get locked pte
-EBUSY - entry already exists in pte

So it seems my handling -EIO, -EAGAIN, -ERESTARTSYS and -EINTR are all redundant and can be removed. I'm not sure if it makes sense for this to be generic - it looks like it's only Intel, gma500 and me who use this, and Intel handles more error codes (due to it calling other functions.)

I'll respin dropping those four unnecessary error codes, and post the delta for this.

Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/armada/armada_gem.c new file +26 -0
+/* Prime support */
+struct sg_table *
+armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
+       enum dma_data_direction dir)
+{
+       struct drm_gem_object *obj = attach->dmabuf->priv;
+       struct armada_gem_object *dobj = drm_to_armada_gem(obj);
+       struct scatterlist *sg;
+       struct sg_table *sgt;
+       int i, num;
+
+       sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
+       if (!sgt)
+               return NULL;
+
+       if (dobj->obj.filp) {
+               struct address_space *mapping;
+               gfp_t gfp;
+               int count;
+
+               count = dobj->obj.size / PAGE_SIZE;
+               if (sg_alloc_table(sgt, count, GFP_KERNEL))
+                       goto free_sgt;
+
+               mapping = file_inode(dobj->obj.filp)->i_mapping;
+               gfp = mapping_gfp_mask(mapping);
Quoted 8 lines

drivers/gpu/drm/armada/armada_gem.c line 453

Quoted 5 lines
drivers/gpu/drm/armada/armada_gem.c new file +5 -0
+
+               for_each_sg(sgt->sgl, sg, count, i) {
+                       struct page *page;
+
+                       page = shmem_read_mapping_page_gfp(mapping, i, gfp);

you could almost use drm_gem_get_pages().. although I guess you otherwise have no need for the page[] array?

Correct. The page[] array would just be an additional unnecessary allocation, and therefore would be an additional unnecessary point of failure.

Quoted 7 lines
Quoted 7 lines
include/uapi/drm/armada_drm.h new file +7 -0
+#define DRM_ARMADA_GEM_CREATE          0x00
+#define DRM_ARMADA_GEM_MMAP            0x02
+#define DRM_ARMADA_GEM_PWRITE          0x03
+
+#define ARMADA_IOCTL(dir, name, str) \
+       DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
+
Quoted 8 lines
Quoted 1 line

+struct drm_armada_gem_create {

Any reason not to throw in a 'uint32_t flags' field? At least then you could indicate what sort of backing memory you want, and do things like allocate linear scanout buffer w/ your gem_create rather than having to use dumb_create. Maybe not something you need now, but seems like eventually you'll come up with some reason or another to want to pass some flags into gem_create.

I thought one of the points of the dumb_create stuff was so that there is a standard API for dumb scanout buffers across all DRM drivers. It has that advantage, and as I understand it, a generic KMS driver for X is on the cards.

Thanks for the review.

#7 lore raw

Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver

Quoted 17 lines · Russell King - ARM Linux
Quoted 8 lines · Rob Clark

drivers/gpu/drm/armada/armada_crtc.c line 308

Quoted 5 lines · Russell King
drivers/gpu/drm/armada/armada_crtc.c new file +5 -0
+       /*
+        * If we have an overlay plane associated with this CRTC, disable
+        * it before the modeset to avoid its coordinates being outside
+        * the new mode parameters.  DRM doesn't provide help with this.
+        */
Quoted 7 lines

Getting a bit off topic, but yeah.. I'd be in favor of "clarifying" things by having crtc helpers disable planes on setcrtc (rather than only doing this on fbdev/lastclose restore). I
don't know of any userspace that this would cause problems for. But not really sure if it would be considered an interface break or just "fixing a bug".. since we have different behavior on different drivers, I'd lean towards the latter.

Quoted 6 lines

The reasoning here is if the overlay plane is larger than the mode being set, we will end up having the hardware programmed in an inconsistent state - the overlay plane position/width/height can be outside of the active region, which is invalid for the hardware. So, it's safer to disable the plane and wait for the next plane to be sent and have that validated against the new mode.

right. I think disabling the planes is the correct behavior. So nothing to do here for armada. I mostly just wanted to get some opinions about making the crtc helpers do this automatically for us.

Quoted 34 lines

It's not like you would be able to see the plane immediately, because most monitors blank while they retrain to the new mode settings.

Quoted 17 lines
Quoted 4 lines
drivers/gpu/drm/armada/armada_gem.c new file +4 -0
+static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+       struct armada_gem_object *obj = drm_to_armada_gem(vma->vm_private_data);
+       unsigned long addr = (unsigned long)vmf->virtual_address;

drivers/gpu/drm/armada/armada_gem.c line 30

Quoted 10 lines
drivers/gpu/drm/armada/armada_gem.c new file +10 -0
+       unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
+       int ret;
+
+       pfn += (addr - vma->vm_start) >> PAGE_SHIFT;
+       ret = vm_insert_pfn(vma, addr, pfn);
+
+       switch (ret) {
+       case -EIO:
+       case -EAGAIN:
+               set_need_resched();

probably this thread is applicable here too?

Quoted 5 lines

https://lkml.org/lkml/2013/9/12/417

(although.. we have at least a few slightly differet variants on the same errno -> VM_FAULT_x switch in different drivers.. maybe we should do something better)

Hmm. It seems today's vm_insert_pfn() has the following error return values:

(quoted diff) +0 -4
-EFAULT - virtual address outside vma
-EINVAL - track_pfn_insert() failure
-ENOMEM - failed to get locked pte
-EBUSY - entry already exists in pte
Quoted 5 lines

So it seems my handling -EIO, -EAGAIN, -ERESTARTSYS and -EINTR are all redundant and can be removed. I'm not sure if it makes sense for this to be generic - it looks like it's only Intel, gma500 and me who use this, and Intel handles more error codes (due to it calling other functions.)

I just noticed msm and omapdrm are missing the -EBUSY case (have some patches I need to send), which was why I mentioned this. They do have other error cases from other fxns, so maybe something generic/common doesn't make sense.. but I realized i915 fixed the same issue a while back, so somewhere common has the advantage of somehow not forgetting to fix other drivers ;-)

Quoted 58 lines

I'll respin dropping those four unnecessary error codes, and post the delta for this.

Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/armada/armada_gem.c new file +26 -0
+/* Prime support */
+struct sg_table *
+armada_gem_prime_map_dma_buf(struct dma_buf_attachment *attach,
+       enum dma_data_direction dir)
+{
+       struct drm_gem_object *obj = attach->dmabuf->priv;
+       struct armada_gem_object *dobj = drm_to_armada_gem(obj);
+       struct scatterlist *sg;
+       struct sg_table *sgt;
+       int i, num;
+
+       sgt = kmalloc(sizeof(*sgt), GFP_KERNEL);
+       if (!sgt)
+               return NULL;
+
+       if (dobj->obj.filp) {
+               struct address_space *mapping;
+               gfp_t gfp;
+               int count;
+
+               count = dobj->obj.size / PAGE_SIZE;
+               if (sg_alloc_table(sgt, count, GFP_KERNEL))
+                       goto free_sgt;
+
+               mapping = file_inode(dobj->obj.filp)->i_mapping;
+               gfp = mapping_gfp_mask(mapping);
Quoted 8 lines

drivers/gpu/drm/armada/armada_gem.c line 453

Quoted 5 lines
drivers/gpu/drm/armada/armada_gem.c new file +5 -0
+
+               for_each_sg(sgt->sgl, sg, count, i) {
+                       struct page *page;
+
+                       page = shmem_read_mapping_page_gfp(mapping, i, gfp);

you could almost use drm_gem_get_pages().. although I guess you otherwise have no need for the page[] array?

Correct. The page[] array would just be an additional unnecessary allocation, and therefore would be an additional unnecessary point of failure.

Quoted 7 lines
Quoted 7 lines
include/uapi/drm/armada_drm.h new file +7 -0
+#define DRM_ARMADA_GEM_CREATE          0x00
+#define DRM_ARMADA_GEM_MMAP            0x02
+#define DRM_ARMADA_GEM_PWRITE          0x03
+
+#define ARMADA_IOCTL(dir, name, str) \
+       DRM_##dir(DRM_COMMAND_BASE + DRM_ARMADA_##name, struct drm_armada_##str)
+
Quoted 8 lines
Quoted 1 line

+struct drm_armada_gem_create {

Any reason not to throw in a 'uint32_t flags' field? At least then you could indicate what sort of backing memory you want, and do things like allocate linear scanout buffer w/ your gem_create rather than having to use dumb_create. Maybe not something you need now, but seems like eventually you'll come up with some reason or another to want to pass some flags into gem_create.

Quoted 4 lines

I thought one of the points of the dumb_create stuff was so that there is a standard API for dumb scanout buffers across all DRM drivers. It has that advantage, and as I understand it, a generic KMS driver for X is on the cards.

Yeah, xf86-video-modesetting currently uses dumb allocation. So you definitely want to continue to support the dumb buffer path.

I can't really think of any immediate need for 'flags'.. but seems like sooner or later someone will come up with some need for it, so it seemed like a convenient placeholder to have.

Well, technically you can get away w/ adding new fields to the end of the ioctl struct, and drm_ioctl() will take care of zero'ing that out for you with an old userspace. So I guess you could just rely on that if you ever need to add 'flags' or some other fields.

Quoted 1 line

Thanks for the review.

no prob

BR,
-R

#8 lore raw

Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver

Quoted 19 lines · Rob Clark
Quoted 17 lines · Russell King - ARM Linux
Quoted 7 lines · Rob Clark

probably this thread is applicable here too?

https://lkml.org/lkml/2013/9/12/417

(although.. we have at least a few slightly differet variants on the same errno -> VM_FAULT_x switch in different drivers.. maybe we should do something better)

Hmm. It seems today's vm_insert_pfn() has the following error return values:

(quoted diff) +0 -4
-EFAULT - virtual address outside vma
-EINVAL - track_pfn_insert() failure
-ENOMEM - failed to get locked pte
-EBUSY - entry already exists in pte
Quoted 12 lines
Quoted 5 lines

So it seems my handling -EIO, -EAGAIN, -ERESTARTSYS and -EINTR are all redundant and can be removed. I'm not sure if it makes sense for this to be generic - it looks like it's only Intel, gma500 and me who use this, and Intel handles more error codes (due to it calling other functions.)

I just noticed msm and omapdrm are missing the -EBUSY case (have some patches I need to send), which was why I mentioned this. They do have other error cases from other fxns, so maybe something generic/common doesn't make sense.. but I realized i915 fixed the same issue a while back, so somewhere common has the advantage of somehow not forgetting to fix other drivers ;-)

Here's the promised delta:

 drivers/gpu/drm/armada/armada_gem.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +0 -5
index 02de7a4..1e74f70 100644
@@ -25,12 +25,7 @@ static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	ret = vm_insert_pfn(vma, addr, pfn);
 
 	switch (ret) {
-	case -EIO:
-	case -EAGAIN:
-		set_need_resched();
 	case 0:
-	case -ERESTARTSYS:
-	case -EINTR:
 	case -EBUSY:
 		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
Reviewed-by
#9 lore raw

Re: [PATCH 2/5] DRM: Armada: Add Armada DRM driver

Quoted 33 lines · Russell King - ARM Linux
Quoted 19 lines · Rob Clark
Quoted 17 lines · Russell King - ARM Linux
Quoted 7 lines · Rob Clark

probably this thread is applicable here too?

https://lkml.org/lkml/2013/9/12/417

(although.. we have at least a few slightly differet variants on the same errno -> VM_FAULT_x switch in different drivers.. maybe we should do something better)

Hmm. It seems today's vm_insert_pfn() has the following error return values:

(quoted diff) +0 -4
-EFAULT - virtual address outside vma
-EINVAL - track_pfn_insert() failure
-ENOMEM - failed to get locked pte
-EBUSY - entry already exists in pte
Quoted 12 lines
Quoted 5 lines

So it seems my handling -EIO, -EAGAIN, -ERESTARTSYS and -EINTR are all redundant and can be removed. I'm not sure if it makes sense for this to be generic - it looks like it's only Intel, gma500 and me who use this, and Intel handles more error codes (due to it calling other functions.)

I just noticed msm and omapdrm are missing the -EBUSY case (have some patches I need to send), which was why I mentioned this. They do have other error cases from other fxns, so maybe something generic/common doesn't make sense.. but I realized i915 fixed the same issue a while back, so somewhere common has the advantage of somehow not forgetting to fix other drivers ;-)

Quoted 1 line

Here's the promised delta:

looks good.. I'll try to get to reviewing the rest of the series tomorrow, or at least before the end of the weekend

BR,
-R

Quoted 21 lines
 drivers/gpu/drm/armada/armada_gem.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +0 -5
index 02de7a4..1e74f70 100644
@@ -25,12 +25,7 @@ static int armada_gem_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
        ret = vm_insert_pfn(vma, addr, pfn);
 
        switch (ret) {
-       case -EIO:
-       case -EAGAIN:
-               set_need_resched();
        case 0:
-       case -ERESTARTSYS:
-       case -EINTR:
        case -EBUSY:
                return VM_FAULT_NOPAGE;
        case -ENOMEM:
#10 lore raw

PATCH 3/5 DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

In reply to Russell King - ARM Linux

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

---
 drivers/gpu/drm/armada/armada_510.c  |    1 +
 drivers/gpu/drm/armada/armada_crtc.c |  245 +++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/armada/armada_crtc.h |    9 ++
 drivers/gpu/drm/armada/armada_drm.h  |    1 +
 drivers/gpu/drm/armada/armada_hw.h   |    6 +-
 5 files changed, 256 insertions(+), 6 deletions(-)
drivers/gpu/drm/armada/armada_510.c +1 -0
index a016888..59948ef 100644
@@ -80,6 +80,7 @@ static int armada510_crtc_compute_clock(struct armada_crtc *dcrtc,
 
 const struct armada_variant armada510_ops = {
 	.has_spu_adv_reg = true,
+	.spu_adv_reg = ADV_HWC32ENABLE | ADV_HWC32ARGB | ADV_HWC32BLEND,
 	.init = armada510_init,
 	.crtc_init = armada510_crtc_init,
 	.crtc_compute_clock = armada510_crtc_compute_clock,
drivers/gpu/drm/armada/armada_crtc.c +241 -4

290 lines not on this page · raw message

drivers/gpu/drm/armada/armada_crtc.h +9 -0
index 972da53..9c10a07 100644
@@ -44,11 +44,20 @@ struct armada_crtc {
 		uint32_t	spu_adv_reg;
 	} v[2];
 	bool			interlaced;
+	bool			cursor_update;
 	uint8_t			csc_yuv_mode;
 	uint8_t			csc_rgb_mode;
 
 	struct drm_plane	*plane;
 
+	struct armada_gem_object	*cursor_obj;
+	int			cursor_x;
+	int			cursor_y;
+	uint32_t		cursor_hw_pos;
+	uint32_t		cursor_hw_sz;
+	uint32_t		cursor_w;
+	uint32_t		cursor_h;
+
 	int			dpms;
 	uint32_t		cfg_dumb_ctrl;
 	uint32_t		dumb_ctrl;
drivers/gpu/drm/armada/armada_drm.h +1 -0
index e8c4f80..eef09ec 100644
@@ -60,6 +60,7 @@ struct armada_private;
 
 struct armada_variant {
 	bool	has_spu_adv_reg;
+	uint32_t spu_adv_reg;
 	int (*init)(struct armada_private *, struct device *);
 	int (*crtc_init)(struct armada_crtc *);
 	int (*crtc_compute_clock)(struct armada_crtc *,
drivers/gpu/drm/armada/armada_hw.h +4 -2
index 216a4b5..27319a8 100644
@@ -168,8 +168,10 @@ enum {
 	SRAM_READ	= 0 << 14,
 	SRAM_WRITE	= 2 << 14,
 	SRAM_INIT	= 3 << 14,
-	SRAM_HWC32_RAMR	= 0xc << 8,
-	SRAM_HWC32_RAMG	= 0xd << 8,
+	SRAM_HWC32_RAM1	= 0xc << 8,
+	SRAM_HWC32_RAM2	= 0xd << 8,
+	SRAM_HWC32_RAMR	= SRAM_HWC32_RAM1,
+	SRAM_HWC32_RAMG	= SRAM_HWC32_RAM2,
 	SRAM_HWC32_RAMB	= 0xe << 8,
 	SRAM_HWC32_TRAN	= 0xf << 8,
 	SRAM_HWC	= 0xf << 8,
Signature · 1 line
1.7.4.4
#11 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 3 lines · On Sun, 06 Oct 2013 23:09:56 +0100 Russell King <[email protected]>…

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

	[snip]

I don't see the interest of such cursors. Actually, most often, the cursors are 64x64 and 'A' is either 0 or 0xff. As the Armada 510 supports 64x64 cursors with transparency, it would be more useful to implement these ones...

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#12 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 6 lines · Jean-Francois Moine
Quoted 3 lines · On Sun, 06 Oct 2013 23:09:56 +0100 Russell King <[email protected]>…

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

Quoted 6 lines
	[snip]

I don't see the interest of such cursors. Actually, most often, the cursors are 64x64 and 'A' is either 0 or 0xff. As the Armada 510 supports 64x64 cursors with transparency, it would be more useful to implement these ones...

Sorry, you're completely wrong there. Xorg uses an alphablended cursor. This patch is a result of trialling each of the Armada's cursor options and this is the only one which results in a reasonable looking cursor.

#13 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 5 lines · On Mon, 7 Oct 2013 10:40:08 +0100 Russell King - ARM Linux…
Quoted 5 lines
Quoted 3 lines

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

	[snip]
Quoted 8 lines
Quoted 4 lines

I don't see the interest of such cursors. Actually, most often, the cursors are 64x64 and 'A' is either 0 or 0xff. As the Armada 510 supports 64x64 cursors with transparency, it would be more useful to implement these ones...

Sorry, you're completely wrong there. Xorg uses an alphablended cursor. This patch is a result of trialling each of the Armada's cursor options and this is the only one which results in a reasonable looking cursor.

Strange. I am using the 64x64 cursor with transparency of the 510 for many months and I never saw any problem.

If you absolutely want to have all transparency shades, you should accept 64x64 cursors and test if they may be rendered as 64x32 or 32x64, i.e. test that there is only pure transparency in the non-rendered rectangles...

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#14 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 13 lines · Jean-Francois Moine
Quoted 10 lines · On Mon, 7 Oct 2013 10:40:08 +0100 Russell King - ARM Linux…
Quoted 9 lines
Quoted 3 lines

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

	[snip]

I don't see the interest of such cursors. Actually, most often, the cursors are 64x64 and 'A' is either 0 or 0xff. As the Armada 510 supports 64x64 cursors with transparency, it would be more useful to implement these ones...

Quoted 6 lines
Quoted 3 lines

Sorry, you're completely wrong there. Xorg uses an alphablended cursor. This patch is a result of trialling each of the Armada's cursor options and this is the only one which results in a reasonable looking cursor.

Strange. I am using the 64x64 cursor with transparency of the 510 for many months and I never saw any problem.

When I tried it, all cursors had variable alpha, and converting the alpha to a single transparency bit made the cursor look rubbish against certain backgrounds.

Quoted 4 lines

If you absolutely want to have all transparency shades, you should accept 64x64 cursors and test if they may be rendered as 64x32 or 32x64, i.e. test that there is only pure transparency in the non- rendered rectangles...

That is policy, and that is something which can be done by the X server rather than the kernel. The kernel exposes the hardware capabilities, which are to allow a 64x32 or a 32x64 cursor. Userspace can make the decision dynamically which it wishes to use.

However, what you're suggesting is dangerous. What do you do when you're presented with a cursor which is 64x64 ? Do you:

(a) not display it
(b) crash the X server

There isn't a fallback to using software cursors available in the X server because there's no error reporting for a failed hardware cursor update.

#15 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 35 lines · On Mon, 7 Oct 2013 11:32:50 +0100 Russell King - ARM Linux…
Quoted 13 lines · Jean-Francois Moine
Quoted 10 lines · On Mon, 7 Oct 2013 10:40:08 +0100 Russell King - ARM Linux…
Quoted 9 lines
Quoted 3 lines

This patch adds ARGB hardware cursor support to the DRM driver for the Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or 64x32 resolutions.

	[snip]

I don't see the interest of such cursors. Actually, most often, the cursors are 64x64 and 'A' is either 0 or 0xff. As the Armada 510 supports 64x64 cursors with transparency, it would be more useful to implement these ones...

Quoted 6 lines
Quoted 3 lines

Sorry, you're completely wrong there. Xorg uses an alphablended cursor. This patch is a result of trialling each of the Armada's cursor options and this is the only one which results in a reasonable looking cursor.

Strange. I am using the 64x64 cursor with transparency of the 510 for many months and I never saw any problem.

When I tried it, all cursors had variable alpha, and converting the alpha to a single transparency bit made the cursor look rubbish against certain backgrounds.

Quoted 4 lines

If you absolutely want to have all transparency shades, you should accept 64x64 cursors and test if they may be rendered as 64x32 or 32x64, i.e. test that there is only pure transparency in the non- rendered rectangles...

That is policy, and that is something which can be done by the X server rather than the kernel. The kernel exposes the hardware capabilities, which are to allow a 64x32 or a 32x64 cursor. Userspace can make the decision dynamically which it wishes to use.

Quoted 8 lines

However, what you're suggesting is dangerous. What do you do when you're presented with a cursor which is 64x64 ? Do you:

(a) not display it
(b) crash the X server

There isn't a fallback to using software cursors available in the X server because there's no error reporting for a failed hardware cursor update.

Hmm, maybe I'm missing something, but doesn't returning FALSE from UseHWCursorARGB just make the X server fallback to using a software cursor?

https://github.com/ssvb/xf86-video-fbturbo/blob/689c08256555/src/sunxi_disp_hwcursor.c#L72

I'm just doing this. And also have hooks to notify the DRI2 code about the status of the cursor. In the case if the hardware cursor is not enabled, hardware overlays can't be safely used with the software cursor and we need to fallback to CPU/GPU copy instead of zero-copy buffers swapping.

And I fully agree that it is the responsibility of the kernel to expose as much of the hardware capabilities as possible (without compromising reliability and/or security).

Signature · 2 lines
Best regards,
Siarhei Siamashka
#16 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 23 lines · Siarhei Siamashka
Quoted 8 lines · On Mon, 7 Oct 2013 11:32:50 +0100 Russell King - ARM Linux…

However, what you're suggesting is dangerous. What do you do when you're presented with a cursor which is 64x64 ? Do you:

(a) not display it
(b) crash the X server

There isn't a fallback to using software cursors available in the X server because there's no error reporting for a failed hardware cursor update.

Hmm, maybe I'm missing something, but doesn't returning FALSE from UseHWCursorARGB just make the X server fallback to using a software cursor?

https://github.com/ssvb/xf86-video-fbturbo/blob/689c08256555/src/sunxi_disp_hwcursor.c#L72

I'm just doing this. And also have hooks to notify the DRI2 code about the status of the cursor. In the case if the hardware cursor is not enabled, hardware overlays can't be safely used with the software cursor and we need to fallback to CPU/GPU copy instead of zero-copy buffers swapping.

Quoted 3 lines

And I fully agree that it is the responsibility of the kernel to expose as much of the hardware capabilities as possible (without compromising reliability and/or security).

If you wish to go in below the level presented by hw/xfree86/modes/xf86Cursors.c (as you are doing), then yes you can do this, and it's something which maybe should be looked into. You have a good reason to do this (due to your hardware cursor being incompatible with overlays).

We have no such restriction - the only issue here is the "odd" size of cursors. Practically, choosing one or other of 64x32 or 32x64 works fine for the cases I've seen. I haven't seen any cursors which are 64x64 yet. I'm not saying they don't exist though! I can imagine that some accessibility options might want to display a large cursor.

Now, the way I handle this is that the kernel allows _either_ a (1 to 32)x(1 to 64) or (1 to 64)x(1 to 32) cursor. Both width and height larger than 32 gets rejected with -EINVAL:

+ /* maximum size is 64x32 or 32x64 */
+ if (w > 64 || h > 64 || (w > 32 && h > 32))
+ return -ENOMEM;

which is quite reasonable for this hardware. However, there is no way to export this from DRM - adding maximum cursor size properties wouldn't really represent this.

The only question is whether DRM should export some capabilities to indicate what's possible with the cursor, so that X knows about this quirk of this hardware. Overall, I suspect that it's just rare and not worth the effort. I think it's just easier to pick one of these and stick with it, and if we happen to encounter a cursor larger than our chosen dimentions, XFree86 will already automatically fall back to s/w cursor.

#17 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 48 lines · Russell King - ARM Linux
Quoted 23 lines · Siarhei Siamashka
Quoted 8 lines · On Mon, 7 Oct 2013 11:32:50 +0100 Russell King - ARM Linux…

However, what you're suggesting is dangerous. What do you do when you're presented with a cursor which is 64x64 ? Do you:

(a) not display it
(b) crash the X server

There isn't a fallback to using software cursors available in the X server because there's no error reporting for a failed hardware cursor update.

Hmm, maybe I'm missing something, but doesn't returning FALSE from UseHWCursorARGB just make the X server fallback to using a software cursor?

https://github.com/ssvb/xf86-video-fbturbo/blob/689c08256555/src/sunxi_disp_hwcursor.c#L72

I'm just doing this. And also have hooks to notify the DRI2 code about the status of the cursor. In the case if the hardware cursor is not enabled, hardware overlays can't be safely used with the software cursor and we need to fallback to CPU/GPU copy instead of zero-copy buffers swapping.

Quoted 3 lines

And I fully agree that it is the responsibility of the kernel to expose as much of the hardware capabilities as possible (without compromising reliability and/or security).

If you wish to go in below the level presented by hw/xfree86/modes/xf86Cursors.c (as you are doing), then yes you can do this, and it's something which maybe should be looked into. You have a good reason to do this (due to your hardware cursor being incompatible with overlays).

We have no such restriction - the only issue here is the "odd" size of cursors. Practically, choosing one or other of 64x32 or 32x64 works fine for the cases I've seen. I haven't seen any cursors which are 64x64 yet. I'm not saying they don't exist though! I can imagine that some accessibility options might want to display a large cursor.

Now, the way I handle this is that the kernel allows _either_ a (1 to 32)x(1 to 64) or (1 to 64)x(1 to 32) cursor. Both width and height larger than 32 gets rejected with -EINVAL:

(quoted diff) +3 -0
+               /* maximum size is 64x32 or 32x64 */
+               if (w > 64 || h > 64 || (w > 32 && h > 32))
+                       return -ENOMEM;
Quoted 3 lines

which is quite reasonable for this hardware. However, there is no way to export this from DRM - adding maximum cursor size properties wouldn't really represent this.

Until relatively recently, it had always been a device specific ddx which would somehow know what w/h values to pass to xf86_cursors_init(). I think for xf86-video-modesetting and wayland compositors, we probably need to come up with something better. Although off the top of my head I can't think of a good way to express 64x32 or 32x64.. that is a weird restriction.

Anyways, right now I don't think there is anything different that I'd do in the kernel part. I *suppose* you could try and figure out that all the alpha values are either 0x00 or 0xff and support 64x64 in that special case. I'm not sure that is actually better.. it at least makes the failure vs success cases more confusing. And unless you are rockin' the twm+xterm+xcalc setup, I doubt you will see many cursors with only 0x00 or 0xff alpha.

So,

Quoted 7 lines

The only question is whether DRM should export some capabilities to indicate what's possible with the cursor, so that X knows about this quirk of this hardware. Overall, I suspect that it's just rare and not worth the effort. I think it's just easier to pick one of these and stick with it, and if we happen to encounter a cursor larger than our chosen dimentions, XFree86 will already automatically fall back to s/w cursor.

#18 lore raw

Re: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors

Quoted 54 lines · Rob Clark
Quoted 48 lines · Russell King - ARM Linux
Quoted 23 lines · Siarhei Siamashka
Quoted 8 lines · On Mon, 7 Oct 2013 11:32:50 +0100 Russell King - ARM Linux…

However, what you're suggesting is dangerous. What do you do when you're presented with a cursor which is 64x64 ? Do you:

(a) not display it
(b) crash the X server

There isn't a fallback to using software cursors available in the X server because there's no error reporting for a failed hardware cursor update.

Hmm, maybe I'm missing something, but doesn't returning FALSE from UseHWCursorARGB just make the X server fallback to using a software cursor?

https://github.com/ssvb/xf86-video-fbturbo/blob/689c08256555/src/sunxi_disp_hwcursor.c#L72

I'm just doing this. And also have hooks to notify the DRI2 code about the status of the cursor. In the case if the hardware cursor is not enabled, hardware overlays can't be safely used with the software cursor and we need to fallback to CPU/GPU copy instead of zero-copy buffers swapping.

Quoted 3 lines

And I fully agree that it is the responsibility of the kernel to expose as much of the hardware capabilities as possible (without compromising reliability and/or security).

If you wish to go in below the level presented by hw/xfree86/modes/xf86Cursors.c (as you are doing), then yes you can do this, and it's something which maybe should be looked into. You have a good reason to do this (due to your hardware cursor being incompatible with overlays).

We have no such restriction - the only issue here is the "odd" size of cursors. Practically, choosing one or other of 64x32 or 32x64 works fine for the cases I've seen. I haven't seen any cursors which are 64x64 yet. I'm not saying they don't exist though! I can imagine that some accessibility options might want to display a large cursor.

Now, the way I handle this is that the kernel allows _either_ a (1 to 32)x(1 to 64) or (1 to 64)x(1 to 32) cursor. Both width and height larger than 32 gets rejected with -EINVAL:

(quoted diff) +3 -0
+               /* maximum size is 64x32 or 32x64 */
+               if (w > 64 || h > 64 || (w > 32 && h > 32))
+                       return -ENOMEM;
Quoted 3 lines

which is quite reasonable for this hardware. However, there is no way to export this from DRM - adding maximum cursor size properties wouldn't really represent this.

Quoted 7 lines

Until relatively recently, it had always been a device specific ddx which would somehow know what w/h values to pass to xf86_cursors_init(). I think for xf86-video-modesetting and wayland compositors, we probably need to come up with something better. Although off the top of my head I can't think of a good way to express 64x32 or 32x64.. that is a weird restriction.

We have a similar problem on our newer asics. They require a 128x128 cursors so when you use xf86-video-modesetting, you end up with messed up cursors because it assumes 64x64. We could add cursor size to drm caps.

Alex

Quoted 24 lines

Anyways, right now I don't think there is anything different that I'd do in the kernel part. I *suppose* you could try and figure out that all the alpha values are either 0x00 or 0xff and support 64x64 in that special case. I'm not sure that is actually better.. it at least makes the failure vs success cases more confusing. And unless you are rockin' the twm+xterm+xcalc setup, I doubt you will see many cursors with only 0x00 or 0xff alpha.

So,

Quoted 7 lines

The only question is whether DRM should export some capabilities to indicate what's possible with the cursor, so that X knows about this quirk of this hardware. Overall, I suspect that it's just rare and not worth the effort. I think it's just easier to pick one of these and stick with it, and if we happen to encounter a cursor larger than our chosen dimentions, XFree86 will already automatically fall back to s/w cursor.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#19 lore raw

PATCH 4/5 DRM: Armada: start of MMP2/MMP3 support

In reply to Russell King - ARM Linux
---
 drivers/gpu/drm/armada/Makefile      |    1 +
 drivers/gpu/drm/armada/armada_610.c  |   49 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.c |    1 +
 drivers/gpu/drm/armada/armada_drm.h  |    1 +
 drivers/gpu/drm/armada/armada_drv.c  |    6 ++++
 drivers/gpu/drm/armada/armada_hw.h   |    8 +++++
 6 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/armada/armada_610.c
drivers/gpu/drm/armada/Makefile +1 -0
index d6f43e0..088db4a 100644
@@ -2,6 +2,7 @@ armada-y	:= armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
 		   armada_gem.o armada_output.o armada_overlay.o \
 		   armada_slave.o
 armada-y	+= armada_510.o
+armada-y	+= armada_610.o
 armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
 
 obj-$(CONFIG_DRM_ARMADA) := armada.o
drivers/gpu/drm/armada/armada_610.c new file +49 -0

49 lines not on this page · raw message

drivers/gpu/drm/armada/armada_crtc.c +1 -0
index e8605bf..b5877ee 100644
@@ -1054,6 +1054,7 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
 	dcrtc->clk = ERR_PTR(-EINVAL);
 	dcrtc->csc_yuv_mode = CSC_AUTO;
 	dcrtc->csc_rgb_mode = CSC_AUTO;
+	/* FIXME: MMP2/MMP3: OLPC panel is RGB666 */
 	dcrtc->cfg_dumb_ctrl = DUMB24_RGB888_0;
 	dcrtc->spu_iopad_ctrl = CFG_VSCALE_LN_EN | CFG_IOPAD_DUMB24;
 	spin_lock_init(&dcrtc->irq_lock);
drivers/gpu/drm/armada/armada_drm.h +1 -0
index eef09ec..f52fccb 100644
@@ -70,6 +70,7 @@ struct armada_variant {
 
 /* Variant ops */
 extern const struct armada_variant armada510_ops;
+extern const struct armada_variant mmp23_ops;
 
 struct armada_private {
 	const struct armada_variant *variant;
drivers/gpu/drm/armada/armada_drv.c +6 -0
index 7bfab9a..db62f1b 100644
@@ -344,6 +344,12 @@ static const struct platform_device_id armada_drm_platform_ids[] = {
 		.name		= "armada-drm",
 		.driver_data	= (unsigned long)&armada510_ops,
 	}, {
+		.name		= "armada-610-drm", /* aka MMP2 */
+		.driver_data	= (unsigned long)&mmp23_ops,
+	}, {
+		.name		= "mmp3-drm",
+		.driver_data	= (unsigned long)&mmp23_ops,
+	}, {
 		.name		= "armada-510-drm",
 		.driver_data	= (unsigned long)&armada510_ops,
 	},
drivers/gpu/drm/armada/armada_hw.h +8 -0
index 27319a8..1688716 100644
@@ -74,6 +74,7 @@ enum {
 	LCD_SPU_IOPAD_CONTROL		= 0x01bc,
 	LCD_SPU_IRQ_ENA			= 0x01c0,
 	LCD_SPU_IRQ_ISR			= 0x01c4,
+	LCD_MISC_CNTL			= 0x01c8,	/* Armada 168 */
 };
 
 /* For LCD_SPU_ADV_REG */
@@ -211,6 +212,13 @@ enum {
 	SCLK_16X_PLL		= 0x8 << 28,
 	SCLK_16X_FRAC_DIV_MASK	= 0xfff << 16,
 	SCLK_16X_INT_DIV_MASK	= 0xffff << 0,
+
+	/* PXA910 / MMP2 (Armada 610) / MMP3 / PXA988 */
+	SCLK_MMP_SRC_SEL	= 1 << 31,
+	SCLK_MMP_DISABLE	= 1 << 28,
+	SCLK_MMP_FRAC_DIV_MASK	= 0xfff << 16,
+	SCLK_MMP_DSI_DIV_MASK	= 0xf << 8,
+	SCLK_MMP_INT_DIV_MASK	= 0xff << 0,
 };
 
 /* For LCD_SPU_DUMB_CTRL */
Signature · 1 line
1.7.4.4
#20 lore raw

Re: [PATCH 4/5] DRM: Armada: start of MMP2/MMP3 support

Quoted 61 lines · Russell King
---
 drivers/gpu/drm/armada/Makefile      |    1 +
 drivers/gpu/drm/armada/armada_610.c  |   49 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.c |    1 +
 drivers/gpu/drm/armada/armada_drm.h  |    1 +
 drivers/gpu/drm/armada/armada_drv.c  |    6 ++++
 drivers/gpu/drm/armada/armada_hw.h   |    8 +++++
 6 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/armada/armada_610.c
drivers/gpu/drm/armada/Makefile +1 -0
index d6f43e0..088db4a 100644
@@ -2,6 +2,7 @@ armada-y        := armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
                   armada_gem.o armada_output.o armada_overlay.o \
                   armada_slave.o
 armada-y       += armada_510.o
+armada-y       += armada_610.o
 armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
 
 obj-$(CONFIG_DRM_ARMADA) := armada.o
drivers/gpu/drm/armada/armada_610.c new file +32 -0
new file mode 100644
index 0000000..36a10e3
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Russell King
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Armada 610/MMP2/MMP3 variant support
+ */
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+#include "armada_crtc.h"
+#include "armada_drm.h"
+#include "armada_hw.h"
+
+static int mmp23_init(struct armada_private *priv, struct device *dev)
+{
+       priv->extclk[0] = devm_clk_get(dev, NULL);
+
+       if (IS_ERR(priv->extclk[0]) && PTR_ERR(priv->extclk[0]) == -ENOENT)
+               priv->extclk[0] = ERR_PTR(-EPROBE_DEFER);
+
+       return PTR_RET(priv->extclk[0]);
+}
+
+/*
+ * This gets called with sclk = NULL to test whether the mode is
+ * supportable, and again with sclk != NULL to set the clocks up for
+ * that.  The former can return an error, but the latter is expected
+ * not to.

drivers/gpu/drm/armada/armada_610.c line 42

Quoted 10 lines
drivers/gpu/drm/armada/armada_610.c new file +10 -0
+ */
+static int mmp23_crtc_compute_clock(struct armada_crtc *dcrtc,
+       const struct drm_display_mode *mode, uint32_t *sclk)
+{
+       /*
+        * on MMP3 bits 31:29 select the clock, OLPC wants 0x1 here, LCD clock 1
+        * on MMP2 bits 31:30 select the clock, OLPC wants 0x1 here, LCD clock 1
+        */
+       *sclk = 0x20001100; // FIXME hardcoded mmp3 value
+

maybe fix this? Or comment out for now mmp2 below in armada_drm_platform_ids?

BR,
-R

Quoted 77 lines
drivers/gpu/drm/armada/armada_610.c new file +7 -0
+       return 0;
+}
+
+const struct armada_variant mmp23_ops = {
+       .init = mmp23_init,
+       .crtc_compute_clock = mmp23_crtc_compute_clock,
+};
drivers/gpu/drm/armada/armada_crtc.c +1 -0
index e8605bf..b5877ee 100644
@@ -1054,6 +1054,7 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
        dcrtc->clk = ERR_PTR(-EINVAL);
        dcrtc->csc_yuv_mode = CSC_AUTO;
        dcrtc->csc_rgb_mode = CSC_AUTO;
+       /* FIXME: MMP2/MMP3: OLPC panel is RGB666 */
        dcrtc->cfg_dumb_ctrl = DUMB24_RGB888_0;
        dcrtc->spu_iopad_ctrl = CFG_VSCALE_LN_EN | CFG_IOPAD_DUMB24;
        spin_lock_init(&dcrtc->irq_lock);
drivers/gpu/drm/armada/armada_drm.h +1 -0
index eef09ec..f52fccb 100644
@@ -70,6 +70,7 @@ struct armada_variant {
 
 /* Variant ops */
 extern const struct armada_variant armada510_ops;
+extern const struct armada_variant mmp23_ops;
 
 struct armada_private {
        const struct armada_variant *variant;
drivers/gpu/drm/armada/armada_drv.c +6 -0
index 7bfab9a..db62f1b 100644
@@ -344,6 +344,12 @@ static const struct platform_device_id armada_drm_platform_ids[] = {
                .name           = "armada-drm",
                .driver_data    = (unsigned long)&armada510_ops,
        }, {
+               .name           = "armada-610-drm", /* aka MMP2 */
+               .driver_data    = (unsigned long)&mmp23_ops,
+       }, {
+               .name           = "mmp3-drm",
+               .driver_data    = (unsigned long)&mmp23_ops,
+       }, {
                .name           = "armada-510-drm",
                .driver_data    = (unsigned long)&armada510_ops,
        },
drivers/gpu/drm/armada/armada_hw.h +8 -1
index 27319a8..1688716 100644
@@ -74,6 +74,7 @@ enum {
        LCD_SPU_IOPAD_CONTROL           = 0x01bc,
        LCD_SPU_IRQ_ENA                 = 0x01c0,
        LCD_SPU_IRQ_ISR                 = 0x01c4,
+       LCD_MISC_CNTL                   = 0x01c8,       /* Armada 168 */
 };
 
 /* For LCD_SPU_ADV_REG */
@@ -211,6 +212,13 @@ enum {
        SCLK_16X_PLL            = 0x8 << 28,
        SCLK_16X_FRAC_DIV_MASK  = 0xfff << 16,
        SCLK_16X_INT_DIV_MASK   = 0xffff << 0,
+
+       /* PXA910 / MMP2 (Armada 610) / MMP3 / PXA988 */
+       SCLK_MMP_SRC_SEL        = 1 << 31,
+       SCLK_MMP_DISABLE        = 1 << 28,
+       SCLK_MMP_FRAC_DIV_MASK  = 0xfff << 16,
+       SCLK_MMP_DSI_DIV_MASK   = 0xf << 8,
+       SCLK_MMP_INT_DIV_MASK   = 0xff << 0,
 };
 
 /* For LCD_SPU_DUMB_CTRL */
--

1.7.4.4

#21 lore raw

PATCH 5/5 DRM: Armada: add support for drm tda19988 driver

In reply to Russell King - ARM Linux
---
 drivers/gpu/drm/armada/Kconfig      |    9 +++++++
 drivers/gpu/drm/armada/armada_drv.c |   42 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
drivers/gpu/drm/armada/Kconfig +9 -0
index c7a0a94..87e62dd 100644
@@ -13,3 +13,12 @@ config DRM_ARMADA
 	  This driver provides no built-in acceleration; acceleration is
 	  performed by other IP found on the SoC.  This driver provides
 	  kernel mode setting and buffer management to userspace.
+
+config DRM_ARMADA_TDA1998X
+	bool "Support TDA1998X HDMI output"
+	depends on DRM_ARMADA != n
+	depends on I2C && DRM_I2C_NXP_TDA998X = y
+	default y
+	help
+	  Support the TDA1998x HDMI output device found on the Solid-Run
+	  CuBox.
drivers/gpu/drm/armada/armada_drv.c +42 -0

54 lines not on this page · raw message

Signature · 1 line
1.7.4.4
#22 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 13 lines · On Sun, 06 Oct 2013 23:11:56 +0100 Russell King <[email protected]>…
---
 drivers/gpu/drm/armada/Kconfig      |    9 +++++++
 drivers/gpu/drm/armada/armada_drv.c |   42 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
drivers/gpu/drm/armada/Kconfig +0 -0
index c7a0a94..87e62dd 100644
@@ -13,3 +13,12 @@ config DRM_ARMADA
 	  This driver provides no built-in acceleration; acceleration is
 	  performed by other IP found on the SoC.  This driver provides

drivers/gpu/drm/armada/Kconfig config DRM_ARMADA · line 24

Quoted 10 lines
drivers/gpu/drm/armada/Kconfig +9 -0
 	  kernel mode setting and buffer management to userspace.
+
+config DRM_ARMADA_TDA1998X
+	bool "Support TDA1998X HDMI output"
+	depends on DRM_ARMADA != n
+	depends on I2C && DRM_I2C_NXP_TDA998X = y
+	default y
+	help
+	  Support the TDA1998x HDMI output device found on the Solid-Run
+	  CuBox.

It seems we are going backwards: as the Armada based boards will soon move to full DT (mvebu), you are making an exception for the Cubox, so that there should be Cubox specific kernels. I don't like that...

Quoted 15 lines
drivers/gpu/drm/armada/armada_drv.c +7 -0
index db62f1b..69517cf 100644
@@ -16,6 +16,42 @@
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"
 
+#ifdef CONFIG_DRM_ARMADA_TDA1998X
+#include <drm/i2c/tda998x.h>
+#include "armada_slave.h"
+
+static struct tda998x_encoder_params params = {
+	/* With 0x24, there is no translation between vp_out and int_vp
+	FB	LCD out	Pins	VIP	Int Vp

drivers/gpu/drm/armada/armada_drv.c line 35

Quoted 10 lines
drivers/gpu/drm/armada/armada_drv.c +10 -0
+	R:23:16	R:7:0	VPC7:0	7:0	7:0[R]
+	G:15:8	G:15:8	VPB7:0	23:16	23:16[G]
+	B:7:0	B:23:16	VPA7:0	15:8	15:8[B]
+	*/
+	.swap_a = 2,
+	.swap_b = 3,
+	.swap_c = 4,
+	.swap_d = 5,
+	.swap_e = 0,
+	.swap_f = 1,

I still don't agree. You don't need to invert R <-> B for the Cubox at the tda998x level: this may be done setting as it should be the CFG_GRA_SWAPRB flag of the lcd register LCD_SPU_DMA_CTRL0.

drivers/gpu/drm/armada/armada_drv.c line 39

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.audio_cfg = BIT(2),
+	.audio_frame[1] = 1,
+	.audio_format = AFMT_SPDIF,
+	.audio_sample_rate = 44100,

These values are rather mysterious!

Looking at the tda998x driver, I found that:
- audio_cfg can be 0x03 for i2s input and 0x04 for spdif input
- audio_frame[1] is the (channel count - 1)
- audio_format and audio_sample_rate are hardcoding the audio input to spdif and the sample rate to 44.1kHz

I don't think that these parameters are needed:

- the tda998x must be prepared to get either i2s or spdif as the audio input at any time. The choice of this input results from the audio subsystem constraints (codec) found at audio streaming start time.

- the channel count is always 2 for spdif. Do we need to accept four channels for i2s?

- audio on hdmi works fine for me at any input rate setting the tda998x sample rate to 96 kHz. Anyway, in the actual tda998x driver, this audio_sample_rate value is just used to set an approximate value of ACR. But this value is not used because an optimal value is computed by the hardware thanks to the flag AIP_CNTRL_0_ACR_MAN!

	[snip]

The remaining patch is Cubox specific.

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#23 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 22 lines · Jean-Francois Moine
Quoted 19 lines · On Sun, 06 Oct 2013 23:11:56 +0100 Russell King <[email protected]>…
---
 drivers/gpu/drm/armada/Kconfig      |    9 +++++++
 drivers/gpu/drm/armada/armada_drv.c |   42 +++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)
drivers/gpu/drm/armada/Kconfig +5 -0
index c7a0a94..87e62dd 100644
@@ -13,3 +13,12 @@ config DRM_ARMADA
 	  This driver provides no built-in acceleration; acceleration is
 	  performed by other IP found on the SoC.  This driver provides
 	  kernel mode setting and buffer management to userspace.
+
+config DRM_ARMADA_TDA1998X
+	bool "Support TDA1998X HDMI output"
+	depends on DRM_ARMADA != n
+	depends on I2C && DRM_I2C_NXP_TDA998X = y
Quoted 8 lines

drivers/gpu/drm/armada/Kconfig config DRM_ARMADA · line 24

Quoted 4 lines
drivers/gpu/drm/armada/Kconfig +4 -0
+	default y
+	help
+	  Support the TDA1998x HDMI output device found on the Solid-Run
+	  CuBox.

It seems we are going backwards: as the Armada based boards will soon move to full DT (mvebu), you are making an exception for the Cubox, so that there should be Cubox specific kernels. I don't like that...

*Ignored*. You know why.

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/armada/armada_drv.c +13 -0
index db62f1b..69517cf 100644
@@ -16,6 +16,42 @@
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"
 
+#ifdef CONFIG_DRM_ARMADA_TDA1998X
+#include <drm/i2c/tda998x.h>
+#include "armada_slave.h"
+
+static struct tda998x_encoder_params params = {
+	/* With 0x24, there is no translation between vp_out and int_vp
+	FB	LCD out	Pins	VIP	Int Vp
+	R:23:16	R:7:0	VPC7:0	7:0	7:0[R]
+	G:15:8	G:15:8	VPB7:0	23:16	23:16[G]
+	B:7:0	B:23:16	VPA7:0	15:8	15:8[B]
+	*/
+	.swap_a = 2,
+	.swap_b = 3,
Quoted 8 lines

drivers/gpu/drm/armada/armada_drv.c line 35

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.swap_c = 4,
+	.swap_d = 5,
+	.swap_e = 0,
+	.swap_f = 1,

I still don't agree. You don't need to invert R <-> B for the Cubox at the tda998x level: this may be done setting as it should be the CFG_GRA_SWAPRB flag of the lcd register LCD_SPU_DMA_CTRL0.

You are totally and utterly wrong there. We need R and B presented on their correct lanes to the TDA998x so that the Armadas YUV->RGB conversion works. Setting CFG_GRA_SWAPRB does not swap the YUV output to match, neither does setting any of the other bits.

CFG_GRA_SWAPRB is all about the _graphics_ _framebuffer_ format, it's got nothing to do at all with how the output is wired.

Quoted 6 lines

drivers/gpu/drm/armada/armada_drv.c line 39

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.audio_cfg = BIT(2),
+	.audio_frame[1] = 1,
+	.audio_format = AFMT_SPDIF,
+	.audio_sample_rate = 44100,

These values are rather mysterious!

Also I'm going to ignore this comment, because quite honestly, I think this is worthless. You haven't investigated how the TDA998x actually gets setup by Rabeeh.

#24 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 1 line · On Mon, 7 Oct 2013 10:44:04 +0100 Russell King - ARM Linux…

On Mon, Oct 07, 2013 at 11:18:07AM +0200, Jean-Francois Moine wrote:

	[snip]
Quoted 5 lines
Quoted 3 lines

It seems we are going backwards: as the Armada based boards will soon move to full DT (mvebu), you are making an exception for the Cubox, so that there should be Cubox specific kernels. I don't like that...

*Ignored*. You know why.

Sorry. I don't see why. May you explain again?

Quoted 1 line
Quoted 1 line

drivers/gpu/drm/armada/armada_drv.c

Quoted 1 line
drivers/gpu/drm/armada/armada_drv.c +0 -0
	[snip]
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/armada/armada_drv.c +9 -0
+static struct tda998x_encoder_params params = {
+	/* With 0x24, there is no translation between vp_out and int_vp
+	FB	LCD out	Pins	VIP	Int Vp
+	R:23:16	R:7:0	VPC7:0	7:0	7:0[R]
+	G:15:8	G:15:8	VPB7:0	23:16	23:16[G]
+	B:7:0	B:23:16	VPA7:0	15:8	15:8[B]
+	*/
+	.swap_a = 2,
+	.swap_b = 3,
Quoted 8 lines

drivers/gpu/drm/armada/armada_drv.c line 35

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.swap_c = 4,
+	.swap_d = 5,
+	.swap_e = 0,
+	.swap_f = 1,

I still don't agree. You don't need to invert R <-> B for the Cubox at the tda998x level: this may be done setting as it should be the CFG_GRA_SWAPRB flag of the lcd register LCD_SPU_DMA_CTRL0.

Quoted 7 lines

You are totally and utterly wrong there. We need R and B presented on their correct lanes to the TDA998x so that the Armadas YUV->RGB conversion works. Setting CFG_GRA_SWAPRB does not swap the YUV output to match, neither does setting any of the other bits.

CFG_GRA_SWAPRB is all about the _graphics_ _framebuffer_ format, it's got nothing to do at all with how the output is wired.

Then, may you explain why you must swap R/B on simple RGB output?

From your [PATCH 2/5] DRM: Armada: Add Armada DRM driver:

+ FMT(RGB888, 888PACK, CFG_SWAPRB);
+ FMT(BGR888, 888PACK, 0);

+ FMT(YUYV, 422PACK, CFG_YUV2RGB | CFG_SWAPYU | CFG_SWAPUV);

Quoted 10 lines
Quoted 6 lines

drivers/gpu/drm/armada/armada_drv.c line 39

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.audio_cfg = BIT(2),
+	.audio_frame[1] = 1,
+	.audio_format = AFMT_SPDIF,
+	.audio_sample_rate = 44100,

These values are rather mysterious!

Also I'm going to ignore this comment, because quite honestly, I think this is worthless. You haven't investigated how the TDA998x actually gets setup by Rabeeh.

Rabeeh did the most he could to have a working Cubox. He used bad written drivers and he had not the time to think about how the drivers could be enhanced.

Here is a small story about i2s/spdif: once, I set the tda998x to use the spdif input, and at this time, I was using the dummy codec. This codec accepts the format 32_LE, as does the audio device, but the output cannot go to spdif. Result: no hdmi sound.

Should we restrict the hdmi transmitter to spdif (thus 'no 32 bits stream') or to i2s (thus 'no compressed stream') only, or accept both i2s and spdif and allow a full range of supported audio streams?

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
+
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#25 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 4 lines · Jean-Francois Moine
Quoted 1 line · On Mon, 7 Oct 2013 10:44:04 +0100 Russell King - ARM Linux…

On Mon, Oct 07, 2013 at 11:18:07AM +0200, Jean-Francois Moine wrote:

Quoted 8 lines
	[snip]
Quoted 5 lines
Quoted 3 lines

It seems we are going backwards: as the Armada based boards will soon move to full DT (mvebu), you are making an exception for the Cubox, so that there should be Cubox specific kernels. I don't like that...

*Ignored*. You know why.

Sorry. I don't see why. May you explain again?

I don't run DT because DT lacks most of the features I require on the cubox. Therefore I can't develop for DT. Simple.

Quoted 32 lines
Quoted 1 line
Quoted 1 line

drivers/gpu/drm/armada/armada_drv.c

Quoted 1 line
drivers/gpu/drm/armada/armada_drv.c +0 -0
	[snip]
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/armada/armada_drv.c +9 -0
+static struct tda998x_encoder_params params = {
+	/* With 0x24, there is no translation between vp_out and int_vp
+	FB	LCD out	Pins	VIP	Int Vp
+	R:23:16	R:7:0	VPC7:0	7:0	7:0[R]
+	G:15:8	G:15:8	VPB7:0	23:16	23:16[G]
+	B:7:0	B:23:16	VPA7:0	15:8	15:8[B]
+	*/
+	.swap_a = 2,
+	.swap_b = 3,
Quoted 8 lines

drivers/gpu/drm/armada/armada_drv.c line 35

Quoted 4 lines
drivers/gpu/drm/armada/armada_drv.c +4 -0
+	.swap_c = 4,
+	.swap_d = 5,
+	.swap_e = 0,
+	.swap_f = 1,

I still don't agree. You don't need to invert R <-> B for the Cubox at the tda998x level: this may be done setting as it should be the CFG_GRA_SWAPRB flag of the lcd register LCD_SPU_DMA_CTRL0.

Quoted 7 lines

You are totally and utterly wrong there. We need R and B presented on their correct lanes to the TDA998x so that the Armadas YUV->RGB conversion works. Setting CFG_GRA_SWAPRB does not swap the YUV output to match, neither does setting any of the other bits.

CFG_GRA_SWAPRB is all about the _graphics_ _framebuffer_ format, it's got nothing to do at all with how the output is wired.

Then, may you explain why you must swap R/B on simple RGB output?

From your [PATCH 2/5] DRM: Armada: Add Armada DRM driver:

Review

Quoted 2 lines
(quoted diff) +2 -0
+	FMT(RGB888,	888PACK,	CFG_SWAPRB);
+	FMT(BGR888,	888PACK,	0);

I think I explained above. This is to do with the *graphics* *framebuffer* *format* in *memory*. This has nothing to do with how the hardware is wired up.

With no swapping, the 888 format is defined by the documentation to be:

	[7:0] = red
	[15:8] = green
	[23:16] = blue

Now, if you look this up in the drm_fourcc.h header file, this corresponds with this entry:

#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */

Hence, this is the BGR888 format with no swapping. Therefore, my second line is correct.

With CFG_SWAPRB set, the format in hardware becomes:

	[7:0] = blue
	[15:8] = green
	[23:16] = red

Again, if you look this up in the drm_fourcc.h header, you get:

#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */

So, the two entries you quote above are 100% correct.

Review

Quoted 1 line
(quoted diff) +1 -0
+	FMT(YUYV,	422PACK,	CFG_YUV2RGB | CFG_SWAPYU | CFG_SWAPUV);

Where is the RGB swap there? Again, this is to do with swapping the format to match the hardware. Please read the documentation on the framebuffer formats.

The native 422PACK format is:

	[7:0] = U
	[15:8] = Y0
	[23:16] = V
	[31:24] = Y1

and we need to set both CFG_SWAPYU and CFG_SWAPUV to get this to be:

	[7:0] = V
	[15:8] = Y1
	[23:16] = U
	[31:24] = Y0

which is what the YUYV format wants.

Quoted 3 lines

Rabeeh did the most he could to have a working Cubox. He used bad written drivers and he had not the time to think about how the drivers could be enhanced.

What does I2S give us in terms of "enhancement" which SPDIF does not, remembering that audio is transmitted over HDMI in a format which closely resembles SPDIF (but with a 28-bit subframe size.)

Quoted 4 lines

Here is a small story about i2s/spdif: once, I set the tda998x to use the spdif input, and at this time, I was using the dummy codec. This codec accepts the format 32_LE, as does the audio device, but the output cannot go to spdif. Result: no hdmi sound.

How ASoC works in this regard is that the capabilities are the _union_ of the codec and the cpu DAIs.

The SPDIF transmitter codec supports 16, 20 and 24 bits per sample but not
32. Quite simply, that's because the SPDIF format does not allow 32-bits per sample. Therefore, 32_LE is not available for use with audio output, and userspace must convert down to something which the hardware does support.

"Because I2S can support 32-bit audio" is a poor reason, because you can't pass 32-bit audio via HDMI due to a subframe being limited to 28 bits - up to 24 bits for the sample and 4 bits of control/status information.

#26 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 9 lines · Russell King - ARM Linux
Quoted 4 lines · Jean-Francois Moine

On Mon, 7 Oct 2013 10:44:04 +0100
Rabeeh did the most he could to have a working Cubox. He used bad written drivers and he had not the time to think about how the drivers could be enhanced.

What does I2S give us in terms of "enhancement" which SPDIF does not, remembering that audio is transmitted over HDMI in a format which closely resembles SPDIF (but with a 28-bit subframe size.)

With respect to what _most_ users want, we should use SPDIF and ignore I2S. Consumer audio fits well into SPDIF and we get pass-through, which we loose on I2S.

I2S _can_ support more than two channels, but only if you wire up more DATA lines. Those are not available on Dove, so its I2S is limited to two channel audio.

The CuBox is simply not designed for HBR or multi-channel PCM, it is a _consumer_ settop box replacement.

Sebastian

#27 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 3 lines · Sebastian Hesselbarth

I2S _can_ support more than two channels, but only if you wire up more DATA lines. Those are not available on Dove, so its I2S is limited to two channel audio.

A lot of devices implement extra channels with TDM rather than with extra wires - you get all the left channels and all the right channels grouped together (like with DSP/PCM modes except the channels are ordered differently). I'm never sure that's actually useful, though, since it's not something that just works with most hosts that don't understand it in hardware and most of those can do DSP/PCM anyway.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#28 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 6 lines · Mark Brown
Quoted 3 lines · Sebastian Hesselbarth

I2S _can_ support more than two channels, but only if you wire up more DATA lines. Those are not available on Dove, so its I2S is limited to two channel audio.

Quoted 6 lines

A lot of devices implement extra channels with TDM rather than with extra wires - you get all the left channels and all the right channels grouped together (like with DSP/PCM modes except the channels are ordered differently). I'm never sure that's actually useful, though, since it's not something that just works with most hosts that don't understand it in hardware and most of those can do DSP/PCM anyway.

True, I didn't mention TDM modes squeezing multiple channels into one L/R frame. Neither Dove nor TDA998x support this, but thanks for the clarification.

#29 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 3 lines · Sebastian Hesselbarth

True, I didn't mention TDM modes squeezing multiple channels into one L/R frame. Neither Dove nor TDA998x support this, but thanks for the clarification.

Depending on how the DMA and so on is done you can sometimes still do it on the CPU side by lying to the CPU about the data format (eg, tell it that two 16 bit samples are actually a 32 bit one) though it gets messy for I2S since you need to be able to gather all the left samples and all the right samples. Though given that your CODEC doesn't support it it's still all moot anyway as you say.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#30 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

In reply to Russell King - ARM Linux
Quoted 14 lines · On Mon, 7 Oct 2013 12:09:02 +0100 Russell King - ARM Linux…
Quoted 4 lines

Here is a small story about i2s/spdif: once, I set the tda998x to use the spdif input, and at this time, I was using the dummy codec. This codec accepts the format 32_LE, as does the audio device, but the output cannot go to spdif. Result: no hdmi sound.

How ASoC works in this regard is that the capabilities are the _union_ of the codec and the cpu DAIs.

The SPDIF transmitter codec supports 16, 20 and 24 bits per sample but not
32. Quite simply, that's because the SPDIF format does not allow 32-bits per sample. Therefore, 32_LE is not available for use with audio output, and userspace must convert down to something which the hardware does support.

Quoted 3 lines

"Because I2S can support 32-bit audio" is a poor reason, because you can't pass 32-bit audio via HDMI due to a subframe being limited to 28 bits - up to 24 bits for the sample and 4 bits of control/status information.

OK. So, to resume, if both i2s and spdif are furnished by the audio subsystem, the tda998x must use spdif only (with the spdif codec).

Then, the declaration of the tda998x in the DT will include an optional audio property, say 'audio-input' with the values "i2s" or "spdif" which corresponds to your parameter 'audio_format'.

Also, from your video swap explanation, the DT will contain some video property(ies) TBD.

The remaining question is: do we need more audio parameters?

- the audio_cfg value is defined by i2s/spdif (3 or 4)
- the audio_frame[1] value is always 1 (2 channels)
- audio_sample_rate is useless

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#31 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 17 lines · Jean-Francois Moine
Quoted 14 lines · On Mon, 7 Oct 2013 12:09:02 +0100 Russell King - ARM Linux…
Quoted 4 lines

Here is a small story about i2s/spdif: once, I set the tda998x to use the spdif input, and at this time, I was using the dummy codec. This codec accepts the format 32_LE, as does the audio device, but the output cannot go to spdif. Result: no hdmi sound.

How ASoC works in this regard is that the capabilities are the _union_ of the codec and the cpu DAIs.

The SPDIF transmitter codec supports 16, 20 and 24 bits per sample but not
32. Quite simply, that's because the SPDIF format does not allow 32-bits per sample. Therefore, 32_LE is not available for use with audio output, and userspace must convert down to something which the hardware does support.

Quoted 6 lines
Quoted 3 lines

"Because I2S can support 32-bit audio" is a poor reason, because you can't pass 32-bit audio via HDMI due to a subframe being limited to 28 bits - up to 24 bits for the sample and 4 bits of control/status information.

OK. So, to resume, if both i2s and spdif are furnished by the audio subsystem, the tda998x must use spdif only (with the spdif codec).

This is going off-topic because the TDA998x bindings are a subject for the TDA998x driver, not the Armada driver. This data structure merely exists to provide the required data for the TDA998x in absence of DT information.

To do the job properly - which is what should be done _whenever_ DT bindings are being considered - you have to look at the hardware with an overview of its capabilities, never at the implementation.

So, the TDA998x family needs to be looked at in isolation, and its DT bindings need to be considered on its own merit.

The TDA998x can accept a SPDIF signal on a single pin (on AP6), with or without a clock (on AP5), or it can accept I2S: I2S clock in APCLK, I2S word select on AP0, and up to four I2S streams on AP1..4 and auxillary ("internal test") data in AP7. AP7 should therefore not be used.

The TDA19988 is slightly different, because it doesn't have soo many AP pins. Here, SPDIF can be supplied on either AP1 or AP2 with the optional clock on AP3. I2S is similar to the above but only AP1 and AP2 accept streams.

I think the I2S is a special case - I'm not aware of anything which outputs _four_ synchronised I2S data streams with a common word select. Nevertheless, it's something that needs to be considered when creating DT bindings.

So, we have some quite different capabilities depending on the device. For I2S, we can get away with this:

	tda998x {
		compatible = "nxp,tda19988", "nxp,tda998x";
		i2s-source = <&i2s_source N>;
	};

where N is the number of coherent I2S streams supplied. For the TDA998x, N can be 1 to 4. For TDA19988, N can be 1 or 2 but no more.

For SPDIF, the situation is more complex. The TDA19988 could in theory have two streams connected, and one of those streams can be selected. So, maybe:

	tda998x {
		compatible = "nxp,tda998x";
		spdif-source = <&spdif_source>;
		spdif-has-mclk;
	};

and for the 19988:

	tda19988 {
		compatible = "nxp,tda19988";
		spdif0-source = <&spdif_source0>;
		spdif0-has-mclk;
		spdif1-source = <&spdif_source1>;
		spdif1-has-mclk;
	};
Quoted 2 lines

Also, from your video swap explanation, the DT will contain some video property(ies) TBD.

The TDA998x needs some properties to define how it is connected to the rest of the hardware - which pins are connected to what in terms of the colour channel information. As I hope I've made clear to you, this has no bearing on the settings in the Dove for the SWAPRB bits. This is purely only to do with the TDA998x.

So, this also needs to be presented as properties for the TDA998x driver.

Quoted 3 lines

The remaining question is: do we need more audio parameters?

- the audio_cfg value is defined by i2s/spdif (3 or 4)

This should be discovered from the DT binding information, because which AP pins get used depends on the signals being supplied to it.

Quoted 2 lines

- the audio_frame[1] value is always 1 (2 channels)
- audio_sample_rate is useless

audio_sample_rate comes in if we wish to use a fixed sample rate and have coherent video and audio clocks derived from a common source. That allows fixed CTS and N values to be used based on the audio sample rate being supplied as the clocks have a fixed known relationship (and aren't going to drift.)

However, you are right that this should not be specified in DT - it should come from the audio subsystem. However, that's something which is a very very long way away from being possible (if ever) with Linux since I don't see the DPCM issues ever getting resolved.

#32 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

In reply to Russell King - ARM Linux
Quoted 10 lines · Russell King - ARM Linux
Quoted 9 lines · Jean-Francois Moine
Quoted 1 line · On Mon, 7 Oct 2013 10:44:04 +0100 Russell King - ARM Linux…

On Mon, Oct 07, 2013 at 11:18:07AM +0200, Jean-Francois Moine wrote:

      [snip]
Quoted 4 lines
Quoted 3 lines

It seems we are going backwards: as the Armada based boards will soon move to full DT (mvebu), you are making an exception for the Cubox, so that there should be Cubox specific kernels. I don't like that...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

*Ignored*. You know why.

Sorry. I don't see why. May you explain again?

I don't run DT because DT lacks most of the features I require on the cubox. Therefore I can't develop for DT. Simple.

Jean-François, just as an aside, I really don't think code that can be shared, like tda998x, should encode a DT requirement.. there are plenty of platforms that don't use DT (arm isn't everything, and last I heard aarch64 was going to be ACPI).

Beyond that, it is a driver decision whether or not to support only-DT or DT + other.. and as long as there is a common board which can use the driver but which is not DT, there is probably a compelling reason to still support the non-DT case.

BR,
-R

#33 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 9 lines · On Mon, 7 Oct 2013 10:59:39 -0400 Rob Clark <[email protected]> wrote:

Jean-François, just as an aside, I really don't think code that can be shared, like tda998x, should encode a DT requirement.. there are plenty of platforms that don't use DT (arm isn't everything, and last I heard aarch64 was going to be ACPI).

Beyond that, it is a driver decision whether or not to support only-DT or DT + other.. and as long as there is a common board which can use the driver but which is not DT, there is probably a compelling reason to still support the non-DT case.

Rob,

The Cubox is an open platform, and I use it just like a desktop PC. When its required drivers will be in the mainline, I will do the same as I do with PCs: I will not recompile a specific kernel each time there are kernel bugs or security issues. Instead, I will just upgrade my system from my distributor (Debian), and, in the packages, there will be a generic mvebu kernel as there is already one for Marvell Armada 370/xp, Freescale iMX5x/iMX6 (linux-image-3.10-3-armmp). But, for that, all the Cubox specific stuff must be described in a DT.

Signature · 7 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#34 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 8 lines · Jean-Francois Moine

The Cubox is an open platform, and I use it just like a desktop PC. When its required drivers will be in the mainline, I will do the same as I do with PCs: I will not recompile a specific kernel each time there are kernel bugs or security issues. Instead, I will just upgrade my system from my distributor (Debian), and, in the packages, there will be a generic mvebu kernel as there is already one for Marvell Armada 370/xp, Freescale iMX5x/iMX6 (linux-image-3.10-3-armmp). But, for that, all the Cubox specific stuff must be described in a DT.

Which scenario is better:

1. To have something in mainline which is capable of driving the hardware, but may need some additional work to make it useful for DT based setups.

or

2. To have nothing.

Now, you may prefer to have nothing, but personally, I prefer there to be forward progress. Forward progress means getting some kind of DRM driver into mainline. Yes, it may not work with DT setups yet, but - as per the discussions that have happened _endlessly_ on this topic, it's something that can be resolved at a later date.

We _still_ haven't worked out how to properly deal with the TDA998x driver (or indeed any DRM based outputs) in a DT based setup, and all the time that problem exists, it won't be possible to write a proper stable DT binding for this.

So please, get off your hobby horse about this and allow us to make some modicum of progress.

#35 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 25 lines · On Tue, 8 Oct 2013 10:49:39 +0100 Russell King - ARM Linux…
Quoted 8 lines · Jean-Francois Moine

The Cubox is an open platform, and I use it just like a desktop PC. When its required drivers will be in the mainline, I will do the same as I do with PCs: I will not recompile a specific kernel each time there are kernel bugs or security issues. Instead, I will just upgrade my system from my distributor (Debian), and, in the packages, there will be a generic mvebu kernel as there is already one for Marvell Armada 370/xp, Freescale iMX5x/iMX6 (linux-image-3.10-3-armmp). But, for that, all the Cubox specific stuff must be described in a DT.

Which scenario is better:

1. To have something in mainline which is capable of driving the hardware, but may need some additional work to make it useful for DT based setups.

or

2. To have nothing.

Now, you may prefer to have nothing, but personally, I prefer there to be forward progress. Forward progress means getting some kind of DRM driver into mainline. Yes, it may not work with DT setups yet, but - as per the discussions that have happened _endlessly_ on this topic, it's something that can be resolved at a later date.

Quoted 7 lines

We _still_ haven't worked out how to properly deal with the TDA998x driver (or indeed any DRM based outputs) in a DT based setup, and all the time that problem exists, it won't be possible to write a proper stable DT binding for this.

So please, get off your hobby horse about this and allow us to make some modicum of progress.

You forgot:

3. To have all patches ready for submission and have a working DT driven Cubox kernel.

I will submit a patch to add DT to the tda998x driver as soon as I have checked the new audio properties we talked about yesterday.

Normally, this should have no impact on your Armada drm driver, and, yes, I will add DT to your driver as soon as it will be accepted (sorry to not ack it now: I had no time yet to have a look at it).

Signature · 6 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#36 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

Quoted 33 lines · Jean-Francois Moine
Quoted 30 lines · On Tue, 8 Oct 2013 10:49:39 +0100 Russell King - ARM Linux…
Quoted 8 lines · Jean-Francois Moine

The Cubox is an open platform, and I use it just like a desktop PC. When its required drivers will be in the mainline, I will do the same as I do with PCs: I will not recompile a specific kernel each time there are kernel bugs or security issues. Instead, I will just upgrade my system from my distributor (Debian), and, in the packages, there will be a generic mvebu kernel as there is already one for Marvell Armada 370/xp, Freescale iMX5x/iMX6 (linux-image-3.10-3-armmp). But, for that, all the Cubox specific stuff must be described in a DT.

Which scenario is better:

1. To have something in mainline which is capable of driving the hardware, but may need some additional work to make it useful for DT based setups.

or

2. To have nothing.

Now, you may prefer to have nothing, but personally, I prefer there to be forward progress. Forward progress means getting some kind of DRM driver into mainline. Yes, it may not work with DT setups yet, but - as per the discussions that have happened _endlessly_ on this topic, it's something that can be resolved at a later date.

We _still_ haven't worked out how to properly deal with the TDA998x driver (or indeed any DRM based outputs) in a DT based setup, and all the time that problem exists, it won't be possible to write a proper stable DT binding for this.

Quoted 7 lines
Quoted 2 lines

So please, get off your hobby horse about this and allow us to make some modicum of progress.

You forgot:

3. To have all patches ready for submission and have a working DT driven Cubox kernel.

No need to block this patch on DT support for all platforms that can use this driver. I don't see an issue with removing non-DT support later if it is no longer needed, or adding DT support in a future patch for platforms which can use it. So this patch looks fine to me.

Quoted 10 lines

I will submit a patch to add DT to the tda998x driver as soon as I have checked the new audio properties we talked about yesterday.

Normally, this should have no impact on your Armada drm driver, and, yes, I will add DT to your driver as soon as it will be accepted (sorry to not ack it now: I had no time yet to have a look at it).

--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/

#37 lore raw

Re: [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver

In reply to Jean-Francois Moine
Quoted 15 lines · Jean-Francois Moine
Quoted 9 lines · On Mon, 7 Oct 2013 10:59:39 -0400 Rob Clark <[email protected]> wrote:

Jean-François, just as an aside, I really don't think code that can be shared, like tda998x, should encode a DT requirement.. there are plenty of platforms that don't use DT (arm isn't everything, and last I heard aarch64 was going to be ACPI).

Beyond that, it is a driver decision whether or not to support only-DT or DT + other.. and as long as there is a common board which can use the driver but which is not DT, there is probably a compelling reason to still support the non-DT case.

Rob,

Quoted 8 lines

The Cubox is an open platform, and I use it just like a desktop PC. When its required drivers will be in the mainline, I will do the same as I do with PCs: I will not recompile a specific kernel each time there are kernel bugs or security issues. Instead, I will just upgrade my system from my distributor (Debian), and, in the packages, there will be a generic mvebu kernel as there is already one for Marvell Armada 370/xp, Freescale iMX5x/iMX6 (linux-image-3.10-3-armmp). But, for that, all the Cubox specific stuff must be described in a DT.

sure, I'm not saying *not* to support DT (send patches if need be). I'm just saying that it should be ok to also support non-DT case and that shared components (like tda998x) should also still work in non-DT case.

BR,
-R

Quoted 3 lines

--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/

Tested-by on the v1 series
#38 lore raw
In reply to Russell King - ARM Linux
Quoted 6 lines · Russell King - ARM Linux

The Armada DRM drivers again, along with the TDA998x HDMI output support, and an illustration to show how to add Armada 610 support (and others.)

Rob has looked at this a couple of times since its last posting, and has provided additional useful feedback which has been incorporated. I believe all the major issues have been addressed now.

on Marvell Armada 510, SolidRun CuBox with quick-hack DT support added.

Let's please get this driver mainlined and start working on proper DT support for it. Thanks for driver and the patience to work out all issues!

Sebastian

#39 lore raw
Quoted 8 lines · Sebastian Hesselbarth
Quoted 6 lines · Russell King - ARM Linux

The Armada DRM drivers again, along with the TDA998x HDMI output support, and an illustration to show how to add Armada 610 support (and others.)

Rob has looked at this a couple of times since its last posting, and has provided additional useful feedback which has been incorporated. I believe all the major issues have been addressed now.

Quoted 7 lines

on Marvell Armada 510, SolidRun CuBox with quick-hack DT support added.

Let's please get this driver mainlined and start working on proper DT support for it. Thanks for driver and the patience to work out all issues!

Sebastian,

I've added your tested-by now, and also updated the TDA998x patch to use the HDMI definitions that Jean-Francois pointed out (which is a really small delta, so isn't worth resending the patch set just for that). Thanks.

All the points brought up in previous reviews concerning the physical address exposure, and the location of the DRM helpers have all been addressed, so it is now ready to be merged into mainline. So now the question is how to proceed with it.

However, I see no response from any DRM developers, even though they are around - they've been responding on a different thread about driver model/sysfs abuse by DRM.

I'm going to pull it into my nightly build tree so it can have some testing with non-dove builds, and if there's still no response from DRM people next week, I'll put it in to linux-next via my tree so at least it can get some exposure and integration validation there.

#40 lore raw
Quoted 29 lines · Russell King - ARM Linux
Quoted 8 lines · Sebastian Hesselbarth
Quoted 6 lines · Russell King - ARM Linux

The Armada DRM drivers again, along with the TDA998x HDMI output support, and an illustration to show how to add Armada 610 support (and others.)

Rob has looked at this a couple of times since its last posting, and has provided additional useful feedback which has been incorporated. I believe all the major issues have been addressed now.

Quoted 7 lines

on Marvell Armada 510, SolidRun CuBox with quick-hack DT support added.

Let's please get this driver mainlined and start working on proper DT support for it. Thanks for driver and the patience to work out all issues!

Sebastian,

I've added your tested-by now, and also updated the TDA998x patch to use the HDMI definitions that Jean-Francois pointed out (which is a really small delta, so isn't worth resending the patch set just for that). Thanks.

All the points brought up in previous reviews concerning the physical address exposure, and the location of the DRM helpers have all been addressed, so it is now ready to be merged into mainline. So now the question is how to proceed with it.

Quoted 8 lines

However, I see no response from any DRM developers, even though they are around - they've been responding on a different thread about driver model/sysfs abuse by DRM.

I'm going to pull it into my nightly build tree so it can have some testing with non-dove builds, and if there's still no response from DRM people next week, I'll put it in to linux-next via my tree so at least it can get some exposure and integration validation there.

fyi, I think this is in pretty good shape.. I've reviewed earlier versions, and had an initial look at this version which addresses my concerns, although I still intend to give a closer review of the final version (still on my TODO list, but we have a bit of time before 3.13 merge window.. I should at least get to it by the weekend)

BR,
-R

#41 lore raw

[GIT PULL] Armada DRM support

In reply to Russell King - ARM Linux

David,

Rob Clark has now reviewed this and has given his blessing for it to be pulled for the coming merge window.

This adds support for the Armada 510 display subsystem found on the Marvell Dove devices. This IP is re-used across several different Marvell SoCs with various tweaks, and this driver has been structured to allow the other IPs to re-use the bulk of this code; further work in this area is expected from interested parties.

This has been extensively tested on the SolidRun Cubox platform and appears to work well there.

Please pull this driver for the next merge window. Thanks.

The following changes since commit 15c03dd4859ab16f9212238f29dd315654aa94f6:

Linux 3.12-rc3 (2013-09-29 15:02:38 -0700)

are available in the git repository at:

git://ftp.arm.linux.org.uk/~rmk/linux-cubox.git drm-tda998x-3.12

which is commit: 585b691e2180e1501637050290292f77f5c30c7b

Russell King (5):
DRM: Armada: Add Armada DRM driver
DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors drm/i2c: tda998x: set VIF for full range, underscanned display Merge branches 'drm-3.12' and 'tda998x-3.12' into drm-tda998x-3.12
DRM: Armada: add support for drm tda19988 driver

 drivers/gpu/drm/Kconfig                 |    2 +
 drivers/gpu/drm/Makefile                |    1 +
 drivers/gpu/drm/armada/Kconfig          |   24 +
 drivers/gpu/drm/armada/Makefile         |    7 +
 drivers/gpu/drm/armada/armada_510.c     |   87 +++
 drivers/gpu/drm/armada/armada_crtc.c    | 1098 +++++++++++++++++++++++++++++++
 drivers/gpu/drm/armada/armada_crtc.h    |   83 +++
 drivers/gpu/drm/armada/armada_debugfs.c |  183 +++++
 drivers/gpu/drm/armada/armada_drm.h     |  113 ++++
 drivers/gpu/drm/armada/armada_drv.c     |  422 ++++++++++++
 drivers/gpu/drm/armada/armada_fb.c      |  170 +++++
 drivers/gpu/drm/armada/armada_fb.h      |   24 +
 drivers/gpu/drm/armada/armada_fbdev.c   |  202 ++++++
 drivers/gpu/drm/armada/armada_gem.c     |  611 +++++++++++++++++
 drivers/gpu/drm/armada/armada_gem.h     |   52 ++
 drivers/gpu/drm/armada/armada_hw.h      |  318 +++++++++
 drivers/gpu/drm/armada/armada_ioctlP.h  |   18 +
 drivers/gpu/drm/armada/armada_output.c  |  158 +++++
 drivers/gpu/drm/armada/armada_output.h  |   39 ++
 drivers/gpu/drm/armada/armada_overlay.c |  477 ++++++++++++++
 drivers/gpu/drm/armada/armada_slave.c   |  139 ++++
 drivers/gpu/drm/armada/armada_slave.h   |   26 +
 drivers/gpu/drm/i2c/tda998x_drv.c       |    3 +
 include/drm/drm_crtc.h                  |   17 +
 include/uapi/drm/armada_drm.h           |   45 ++
 25 files changed, 4319 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpu/drm/armada/Kconfig
 create mode 100644 drivers/gpu/drm/armada/Makefile
 create mode 100644 drivers/gpu/drm/armada/armada_510.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.c
 create mode 100644 drivers/gpu/drm/armada/armada_crtc.h
 create mode 100644 drivers/gpu/drm/armada/armada_debugfs.c
 create mode 100644 drivers/gpu/drm/armada/armada_drm.h
 create mode 100644 drivers/gpu/drm/armada/armada_drv.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.c
 create mode 100644 drivers/gpu/drm/armada/armada_fb.h
 create mode 100644 drivers/gpu/drm/armada/armada_fbdev.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.c
 create mode 100644 drivers/gpu/drm/armada/armada_gem.h
 create mode 100644 drivers/gpu/drm/armada/armada_hw.h
 create mode 100644 drivers/gpu/drm/armada/armada_ioctlP.h
 create mode 100644 drivers/gpu/drm/armada/armada_output.c
 create mode 100644 drivers/gpu/drm/armada/armada_output.h
 create mode 100644 drivers/gpu/drm/armada/armada_overlay.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.c
 create mode 100644 drivers/gpu/drm/armada/armada_slave.h
 create mode 100644 include/uapi/drm/armada_drm.h
#42 lore raw

Re: [GIT PULL] Armada DRM support

Quoted 5 lines · Russell King - ARM Linux

David,

Rob Clark has now reviewed this and has given his blessing for it to be pulled for the coming merge window.

Quoted 8 lines

This adds support for the Armada 510 display subsystem found on the Marvell Dove devices. This IP is re-used across several different Marvell SoCs with various tweaks, and this driver has been structured to allow the other IPs to re-use the bulk of this code; further work in this area is expected from interested parties.

This has been extensively tested on the SolidRun Cubox platform and appears to work well there.

David,

The zero day tester found a problem with this building on some non-ARM. Please add this fix to it, which Rob Clark has acked. It's a small patch to add a dependency on ARM.

Thanks.

The following changes since commit 585b691e2180e1501637050290292f77f5c30c7b:

DRM: Armada: add support for drm tda19988 driver (2013-10-18 16:00:33 +0100)

are available in the git repository at:
git://ftp.arm.linux.org.uk/~rmk/linux-cubox.git drm-tda998x-3.12-fixes

Russell King (1):
DRM: Armada: depend on ARM

 drivers/gpu/drm/armada/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)