All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-19 13:19 ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, Alexey Brodkin, Daniel Vetter, David Airlie,
	devicetree, Ian Campbell, Kumar Gala, linux-snps-arc,
	Mark Rutland, Pawel Moll, Rob Herring, Vineet Gupta, Jose Abreu,
	Carlos Palminha

This series add support of ARC PGU display controller.
ARC PGU is a quite simple byte streamer that gets data from the framebuffer
and pushes it to hte connected encoder (DP or HDMI).

It was tested on ARC SDP boards (axs101/103 in particular).

Note following series (v6) that introduces drm_connector_register_all()
is a prerequisite now: https://lkml.org/lkml/2016/4/19/299

Changes v5 -> v6:
 * "arc: Add our own implementation of fb_pgprotect()" was already applied to
   ARC's tree and available in linux-next:
   http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e5e0a65cd20a7a892a87e6bd73bdc3d83726d725

Changes v4 -> v5:
 * Removed encode node from DT bindings example (as suggested by Rob)

Changes v3 -> v4:
 * Main driver author is now set properly (thanks Carlos for all your efforts)
 * Implemented correct hsync and vsync setup (thanks Jose)
 * Dummy call-backs were removed (as suggested by Daniel)
 * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
 * With above in mind we were able to adopt recently introduced
   drm_connector_register_all()/drm_connector_unregister_all()
 * Implemented setup of properties (uncached) for FB user-pages
 * Minor clean-up in DT binding docs and axs10x_mb.dtsi

Changes v2 -> v3:
 * Improved failure path if arcpgu_connector wasn't allocated.
 * Fixed driver building as module.
 * Implemented uncached mapping of user-space FB pages.
 * Again updated DT bindings docs.

Changes v1 -> v2:
 * Clean-up of DT bindings documentation.
 * Added missing "pxlclk" clock in axs10x_mb.dtsi.

Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: devicetree@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: linux-snps-arc@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>

Alexey Brodkin (3):
  drm: Add DT bindings documentation for ARC PGU display controller
  MAINTAINERS: Add maintainer for ARC PGU display controller
  arc: axs10x - add support of ARC PGU

Carlos Palminha (1):
  drm: Add support of ARC PGU display controller

 .../devicetree/bindings/display/snps,arcpgu.txt    |  35 +++
 MAINTAINERS                                        |   6 +
 arch/arc/boot/dts/axs10x_mb.dtsi                   |  61 +++++
 drivers/gpu/drm/Kconfig                            |   2 +
 drivers/gpu/drm/Makefile                           |   1 +
 drivers/gpu/drm/arc/Kconfig                        |  10 +
 drivers/gpu/drm/arc/Makefile                       |   2 +
 drivers/gpu/drm/arc/arcpgu.h                       |  50 ++++
 drivers/gpu/drm/arc/arcpgu_crtc.c                  | 257 +++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c                   | 282 +++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c                  | 201 +++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h                  |  40 +++
 12 files changed, 947 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

-- 
2.5.5

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

* [PATCH 0/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-19 13:19 ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: linux-snps-arc

This series add support of ARC PGU display controller.
ARC PGU is a quite simple byte streamer that gets data from the framebuffer
and pushes it to hte connected encoder (DP or HDMI).

It was tested on ARC SDP boards (axs101/103 in particular).

Note following series (v6) that introduces drm_connector_register_all()
is a prerequisite now: https://lkml.org/lkml/2016/4/19/299

Changes v5 -> v6:
 * "arc: Add our own implementation of fb_pgprotect()" was already applied to
   ARC's tree and available in linux-next:
   http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e5e0a65cd20a7a892a87e6bd73bdc3d83726d725

Changes v4 -> v5:
 * Removed encode node from DT bindings example (as suggested by Rob)

Changes v3 -> v4:
 * Main driver author is now set properly (thanks Carlos for all your efforts)
 * Implemented correct hsync and vsync setup (thanks Jose)
 * Dummy call-backs were removed (as suggested by Daniel)
 * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
 * With above in mind we were able to adopt recently introduced
   drm_connector_register_all()/drm_connector_unregister_all()
 * Implemented setup of properties (uncached) for FB user-pages
 * Minor clean-up in DT binding docs and axs10x_mb.dtsi

Changes v2 -> v3:
 * Improved failure path if arcpgu_connector wasn't allocated.
 * Fixed driver building as module.
 * Implemented uncached mapping of user-space FB pages.
 * Again updated DT bindings docs.

Changes v1 -> v2:
 * Clean-up of DT bindings documentation.
 * Added missing "pxlclk" clock in axs10x_mb.dtsi.

Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: David Airlie <airlied at linux.ie>
Cc: devicetree at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: Ian Campbell <ijc+devicetree at hellion.org.uk>
Cc: Kumar Gala <galak at codeaurora.org>
Cc: linux-snps-arc at lists.infradead.org
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Pawel Moll <pawel.moll at arm.com>
Cc: Rob Herring <robh+dt at kernel.org>
Cc: Vineet Gupta <vgupta at synopsys.com>
Cc: Jose Abreu <joabreu at synopsys.com>
Cc: Carlos Palminha <palminha at synopsys.com>

Alexey Brodkin (3):
  drm: Add DT bindings documentation for ARC PGU display controller
  MAINTAINERS: Add maintainer for ARC PGU display controller
  arc: axs10x - add support of ARC PGU

Carlos Palminha (1):
  drm: Add support of ARC PGU display controller

 .../devicetree/bindings/display/snps,arcpgu.txt    |  35 +++
 MAINTAINERS                                        |   6 +
 arch/arc/boot/dts/axs10x_mb.dtsi                   |  61 +++++
 drivers/gpu/drm/Kconfig                            |   2 +
 drivers/gpu/drm/Makefile                           |   1 +
 drivers/gpu/drm/arc/Kconfig                        |  10 +
 drivers/gpu/drm/arc/Makefile                       |   2 +
 drivers/gpu/drm/arc/arcpgu.h                       |  50 ++++
 drivers/gpu/drm/arc/arcpgu_crtc.c                  | 257 +++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c                   | 282 +++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c                  | 201 +++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h                  |  40 +++
 12 files changed, 947 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

-- 
2.5.5

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

* [PATCH 1/4 v6] drm: Add support of ARC PGU display controller
  2016-04-19 13:19 ` Alexey Brodkin
  (?)
@ 2016-04-19 13:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, Carlos Palminha, Alexey Brodkin, Daniel Vetter,
	David Airlie, linux-snps-arc

From: Carlos Palminha <palminha@synopsys.com>

ARC PGU could be found on some development boards from Synopsys.
This is a simple byte streamer that reads data from a framebuffer
and sends data to the single encoder.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org
---

Note following series (v6) that introduces drm_connector_register_all()
is a prerequisite now: https://lkml.org/lkml/2016/4/19/299

No changes v5 -> v6.

No changes v4 -> v5.

Changes v3 -> v4:
 * The driver author is now set properly (thanks Carlos for all your efforts)
 * Implemented correct hsync and vsync setup (thanks Jose)
 * Dummy call-backs were removed (as suggested by Daniel)
 * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
 * With above in mind we were able to adopt recently introduced
   drm_connector_register_all()/drm_connector_unregister_all()

Changes v2 -> v3:
 * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose).
 * Fixed driver building as module (reported by 0-DAY kernel test infrastruct.)
 * Implemented uncached mapping of user-space FB pages.

No changes v1 -> v2.

 drivers/gpu/drm/Kconfig           |   2 +
 drivers/gpu/drm/Makefile          |   1 +
 drivers/gpu/drm/arc/Kconfig       |  10 ++
 drivers/gpu/drm/arc/Makefile      |   2 +
 drivers/gpu/drm/arc/arcpgu.h      |  50 +++++++
 drivers/gpu/drm/arc/arcpgu_crtc.c | 257 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c  | 282 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c | 201 +++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h |  40 ++++++
 9 files changed, 845 insertions(+)
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f2a74d0..9e4f2f1 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -281,3 +281,5 @@ source "drivers/gpu/drm/imx/Kconfig"
 source "drivers/gpu/drm/vc4/Kconfig"
 
 source "drivers/gpu/drm/etnaviv/Kconfig"
+
+source "drivers/gpu/drm/arc/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 6eb94fc..c338d04 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -78,3 +78,4 @@ obj-y			+= panel/
 obj-y			+= bridge/
 obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
 obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
+obj-$(CONFIG_DRM_ARCPGU)+= arc/
diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig
new file mode 100644
index 0000000..f9a13b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/Kconfig
@@ -0,0 +1,10 @@
+config DRM_ARCPGU
+	tristate "ARC PGU"
+	depends on DRM && OF
+	select DRM_KMS_CMA_HELPER
+	select DRM_KMS_FB_HELPER
+	select DRM_KMS_HELPER
+	help
+	  Choose this option if you have an ARC PGU controller.
+
+	  If M is selected the module will be called arcpgu.
diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile
new file mode 100644
index 0000000..d48fda7
--- /dev/null
+++ b/drivers/gpu/drm/arc/Makefile
@@ -0,0 +1,2 @@
+arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
+obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
new file mode 100644
index 0000000..86574b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu.h
@@ -0,0 +1,50 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARCPGU_H_
+#define _ARCPGU_H_
+
+struct arcpgu_drm_private {
+	void __iomem		*regs;
+	struct clk		*clk;
+	struct drm_fbdev_cma	*fbdev;
+	struct drm_framebuffer	*fb;
+	struct list_head	event_list;
+	struct drm_crtc		crtc;
+	struct drm_plane	*plane;
+};
+
+#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
+
+static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
+				 unsigned int reg, u32 value)
+{
+	iowrite32(value, arcpgu->regs + reg);
+}
+
+static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
+			       unsigned int reg)
+{
+	return ioread32(arcpgu->regs + reg);
+}
+
+int arc_pgu_setup_crtc(struct drm_device *dev);
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
+struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
+	unsigned int preferred_bpp, unsigned int num_crtc,
+	unsigned int max_conn_count);
+
+#endif
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
new file mode 100644
index 0000000..92f8bef
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -0,0 +1,257 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_plane_helper.h>
+#include <linux/clk.h>
+#include <linux/platform_data/simplefb.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+#define ENCODE_PGU_XY(x, y)	((((x) - 1) << 16) | ((y) - 1))
+
+static struct simplefb_format supported_formats[] = {
+	{ "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 },
+	{ "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 },
+};
+
+static void arc_pgu_set_pxl_fmt(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	uint32_t pixel_format = crtc->primary->state->fb->pixel_format;
+	struct simplefb_format *format = NULL;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
+		if (supported_formats[i].fourcc == pixel_format)
+			format = &supported_formats[i];
+	}
+
+	if (WARN_ON(!format))
+		return;
+
+	if (format->fourcc == DRM_FORMAT_RGB888)
+		arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+					   ARCPGU_MODE_RGB888_MASK);
+
+}
+
+static const struct drm_crtc_funcs arc_pgu_crtc_funcs = {
+	.destroy = drm_crtc_cleanup,
+	.set_config = drm_atomic_helper_set_config,
+	.page_flip = drm_atomic_helper_page_flip,
+	.reset = drm_atomic_helper_crtc_reset,
+	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+};
+
+static void arc_pgu_crtc_mode_set_nofb(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *m = &crtc->state->adjusted_mode;
+	u32 val;
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
+		      ENCODE_PGU_XY(m->crtc_htotal, m->crtc_vtotal));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_HSYNC,
+		      ENCODE_PGU_XY(m->crtc_hsync_start - m->crtc_hdisplay,
+				    m->crtc_hsync_end - m->crtc_hdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_VSYNC,
+		      ENCODE_PGU_XY(m->crtc_vsync_start - m->crtc_vdisplay,
+				    m->crtc_vsync_end - m->crtc_vdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_ACTIVE,
+		      ENCODE_PGU_XY(m->crtc_hblank_end - m->crtc_hblank_start,
+				    m->crtc_vblank_end - m->crtc_vblank_start));
+
+	val = arc_pgu_read(arcpgu, ARCPGU_REG_CTRL);
+
+	if (m->flags & DRM_MODE_FLAG_PVSYNC)
+		val |= ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST);
+
+	if (m->flags & DRM_MODE_FLAG_PHSYNC)
+		val |= ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST);
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, val);
+	arc_pgu_write(arcpgu, ARCPGU_REG_STRIDE, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_START_SET, 1);
+
+	arc_pgu_set_pxl_fmt(crtc);
+
+	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
+}
+
+static void arc_pgu_crtc_enable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	clk_prepare_enable(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+		      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+		      ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static void arc_pgu_crtc_disable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	if (!crtc->primary->fb)
+		return;
+
+	clk_disable_unprepare(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
+			      ~ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static int arc_pgu_crtc_atomic_check(struct drm_crtc *crtc,
+				     struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *mode = &state->adjusted_mode;
+	long rate, clk_rate = mode->clock * 1000;
+
+	rate = clk_round_rate(arcpgu->clk, clk_rate);
+	if (rate != clk_rate)
+		return -EINVAL;
+
+	return 0;
+}
+
+static void arc_pgu_crtc_atomic_begin(struct drm_crtc *crtc,
+				      struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	unsigned long flags;
+
+	if (crtc->state->event) {
+		struct drm_pending_vblank_event *event = crtc->state->event;
+
+		crtc->state->event = NULL;
+		event->pipe = drm_crtc_index(crtc);
+
+		WARN_ON(drm_crtc_vblank_get(crtc) != 0);
+
+		spin_lock_irqsave(&crtc->dev->event_lock, flags);
+		list_add_tail(&event->base.link, &arcpgu->event_list);
+		spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+	}
+}
+
+static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = {
+	.mode_set	= drm_helper_crtc_mode_set,
+	.mode_set_base	= drm_helper_crtc_mode_set_base,
+	.mode_set_nofb	= arc_pgu_crtc_mode_set_nofb,
+	.enable		= arc_pgu_crtc_enable,
+	.disable	= arc_pgu_crtc_disable,
+	.prepare	= arc_pgu_crtc_disable,
+	.commit		= arc_pgu_crtc_enable,
+	.atomic_check	= arc_pgu_crtc_atomic_check,
+	.atomic_begin	= arc_pgu_crtc_atomic_begin,
+};
+
+static void arc_pgu_plane_atomic_update(struct drm_plane *plane,
+					struct drm_plane_state *state)
+{
+	struct arcpgu_drm_private *arcpgu;
+	struct drm_gem_cma_object *gem;
+
+	if (!plane->state->crtc || !plane->state->fb)
+		return;
+
+	arcpgu = crtc_to_arcpgu_priv(plane->state->crtc);
+	gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);
+}
+
+static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
+	.prepare_fb = NULL,
+	.cleanup_fb = NULL,
+	.atomic_update = arc_pgu_plane_atomic_update,
+};
+
+static void arc_pgu_plane_destroy(struct drm_plane *plane)
+{
+	drm_plane_helper_disable(plane);
+	drm_plane_cleanup(plane);
+}
+
+static const struct drm_plane_funcs arc_pgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= arc_pgu_plane_destroy,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static struct drm_plane *arc_pgu_plane_init(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *plane = NULL;
+	u32 formats[ARRAY_SIZE(supported_formats)], i;
+	int ret;
+
+	plane = devm_kzalloc(drm->dev, sizeof(*plane), GFP_KERNEL);
+	if (!plane)
+		return ERR_PTR(-ENOMEM);
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++)
+		formats[i] = supported_formats[i].fourcc;
+
+	ret = drm_universal_plane_init(drm, plane, 0xff, &arc_pgu_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ERR_PTR(ret);
+
+	drm_plane_helper_add(plane, &arc_pgu_plane_helper_funcs);
+	arcpgu->plane = plane;
+
+	return plane;
+}
+
+int arc_pgu_setup_crtc(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *primary;
+	int ret;
+
+	primary = arc_pgu_plane_init(drm);
+	if (IS_ERR(primary))
+		return PTR_ERR(primary);
+
+	ret = drm_crtc_init_with_planes(drm, &arcpgu->crtc, primary, NULL,
+					&arc_pgu_crtc_funcs, NULL);
+	if (ret) {
+		arc_pgu_plane_destroy(primary);
+		return ret;
+	}
+
+	drm_crtc_helper_add(&arcpgu->crtc, &arc_pgu_crtc_helper_funcs);
+	return 0;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
new file mode 100644
index 0000000..5b35e5db
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -0,0 +1,282 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/clk.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
+{
+	struct arcpgu_drm_private *arcpgu = dev->dev_private;
+
+	if (arcpgu->fbdev)
+		drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
+}
+
+static int arcpgu_atomic_commit(struct drm_device *dev,
+				    struct drm_atomic_state *state, bool async)
+{
+	return drm_atomic_helper_commit(dev, state, false);
+}
+
+static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
+	.fb_create  = drm_fb_cma_create,
+	.output_poll_changed = arcpgu_fb_output_poll_changed,
+	.atomic_check = drm_atomic_helper_check,
+	.atomic_commit = arcpgu_atomic_commit,
+};
+
+static void arcpgu_setup_mode_config(struct drm_device *drm)
+{
+	drm_mode_config_init(drm);
+	drm->mode_config.min_width = 0;
+	drm->mode_config.min_height = 0;
+	drm->mode_config.max_width = 1920;
+	drm->mode_config.max_height = 1080;
+	drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
+}
+
+int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+	int ret;
+
+	ret = drm_gem_mmap(filp, vma);
+	if (ret)
+		return ret;
+
+	vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+	return 0;
+}
+
+static const struct file_operations arcpgu_drm_ops = {
+	.owner = THIS_MODULE,
+	.open = drm_open,
+	.release = drm_release,
+	.unlocked_ioctl = drm_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl = drm_compat_ioctl,
+#endif
+	.poll = drm_poll,
+	.read = drm_read,
+	.llseek = no_llseek,
+	.mmap = arcpgu_gem_mmap,
+};
+
+static void arcpgu_preclose(struct drm_device *drm, struct drm_file *file)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_pending_vblank_event *e, *t;
+	unsigned long flags;
+
+	spin_lock_irqsave(&drm->event_lock, flags);
+	list_for_each_entry_safe(e, t, &arcpgu->event_list, base.link) {
+		if (e->base.file_priv != file)
+			continue;
+		list_del(&e->base.link);
+		e->base.destroy(&e->base);
+	}
+	spin_unlock_irqrestore(&drm->event_lock, flags);
+}
+
+static void arcpgu_lastclose(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	drm_fbdev_cma_restore_mode(arcpgu->fbdev);
+}
+
+static int arcpgu_load(struct drm_device *drm)
+{
+	struct platform_device *pdev = to_platform_device(drm->dev);
+	struct arcpgu_drm_private *arcpgu;
+	struct device_node *encoder_node;
+	struct resource *res;
+	int ret;
+
+	arcpgu = devm_kzalloc(&pdev->dev, sizeof(*arcpgu), GFP_KERNEL);
+	if (arcpgu == NULL)
+		return -ENOMEM;
+
+	drm->dev_private = arcpgu;
+
+	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
+	if (IS_ERR(arcpgu->clk))
+		return PTR_ERR(arcpgu->clk);
+
+	INIT_LIST_HEAD(&arcpgu->event_list);
+
+	arcpgu_setup_mode_config(drm);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(arcpgu->regs)) {
+		dev_err(drm->dev, "Could not remap IO mem\n");
+		return PTR_ERR(arcpgu->regs);
+	}
+
+	dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
+		 arc_pgu_read(arcpgu, ARCPGU_REG_ID));
+
+	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
+		return -ENODEV;
+
+	if (arc_pgu_setup_crtc(drm) < 0)
+		return -ENODEV;
+
+	/* find the encoder node and initialize it */
+	encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
+	if (!encoder_node) {
+		dev_err(drm->dev, "failed to get an encoder slave node\n");
+		return -ENODEV;
+	}
+
+	ret = arcpgu_drm_hdmi_init(drm, encoder_node);
+	if (ret < 0)
+		return ret;
+
+	drm_mode_config_reset(drm);
+	drm_kms_helper_poll_init(drm);
+
+	arcpgu->fbdev = drm_fbdev_cma_init(drm, 16,
+					      drm->mode_config.num_crtc,
+					      drm->mode_config.num_connector);
+	if (IS_ERR(arcpgu->fbdev)) {
+		ret = PTR_ERR(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+		return -ENODEV;
+	}
+
+	platform_set_drvdata(pdev, arcpgu);
+	return 0;
+}
+
+int arcpgu_unload(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	if (arcpgu->fbdev) {
+		drm_fbdev_cma_fini(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+	}
+	drm_kms_helper_poll_fini(drm);
+	drm_vblank_cleanup(drm);
+	drm_mode_config_cleanup(drm);
+
+	return 0;
+}
+
+static struct drm_driver arcpgu_drm_driver = {
+	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
+			   DRIVER_ATOMIC,
+	.preclose = arcpgu_preclose,
+	.lastclose = arcpgu_lastclose,
+	.name = "drm-arcpgu",
+	.desc = "ARC PGU Controller",
+	.date = "20160219",
+	.major = 1,
+	.minor = 0,
+	.patchlevel = 0,
+	.fops = &arcpgu_drm_ops,
+	.dumb_create = drm_gem_cma_dumb_create,
+	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
+	.dumb_destroy = drm_gem_dumb_destroy,
+	.get_vblank_counter = drm_vblank_no_hw_counter,
+	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
+	.gem_free_object = drm_gem_cma_free_object,
+	.gem_vm_ops = &drm_gem_cma_vm_ops,
+	.gem_prime_export = drm_gem_prime_export,
+	.gem_prime_import = drm_gem_prime_import,
+	.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
+	.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
+	.gem_prime_vmap = drm_gem_cma_prime_vmap,
+	.gem_prime_vunmap = drm_gem_cma_prime_vunmap,
+	.gem_prime_mmap = drm_gem_cma_prime_mmap,
+};
+
+static int arcpgu_probe(struct platform_device *pdev)
+{
+	struct drm_device *drm;
+	int ret;
+
+	drm = drm_dev_alloc(&arcpgu_drm_driver, &pdev->dev);
+	if (!drm)
+		return -ENOMEM;
+
+	ret = arcpgu_load(drm);
+	if (ret)
+		goto err_unref;
+
+	ret = drm_dev_register(drm, 0);
+	if (ret)
+		goto err_unload;
+
+	ret = drm_connector_register_all(drm);
+	if (ret)
+		goto err_unregister;
+
+	return 0;
+
+err_unregister:
+	drm_dev_unregister(drm);
+
+err_unload:
+	arcpgu_unload(drm);
+
+err_unref:
+	drm_dev_unref(drm);
+
+	return ret;
+}
+
+static int arcpgu_remove(struct platform_device *pdev)
+{
+	struct drm_device *drm = platform_get_drvdata(pdev);
+
+	drm_connector_unregister_all(drm);
+	drm_dev_unregister(drm);
+	arcpgu_unload(drm);
+	drm_dev_unref(drm);
+
+	return 0;
+}
+
+static const struct of_device_id arcpgu_of_table[] = {
+	{.compatible = "snps,arcpgu"},
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, arcpgu_of_table);
+
+static struct platform_driver arcpgu_platform_driver = {
+	.probe = arcpgu_probe,
+	.remove = arcpgu_remove,
+	.driver = {
+		   .name = "arcpgu",
+		   .of_match_table = arcpgu_of_table,
+		   },
+};
+
+module_platform_driver(arcpgu_platform_driver);
+
+MODULE_AUTHOR("Carlos Palminha <palminha@synopsys.com>");
+MODULE_DESCRIPTION("ARC PGU DRM driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c
new file mode 100644
index 0000000..08b6bae
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c
@@ -0,0 +1,201 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_encoder_slave.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+
+struct arcpgu_drm_connector {
+	struct drm_connector connector;
+	struct drm_encoder_slave *encoder_slave;
+};
+
+static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
+{
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_get_modes: cannot find slave encoder for connector\n");
+		return 0;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs->get_modes == NULL)
+		return 0;
+
+	return sfuncs->get_modes(&slave->base, connector);
+}
+
+struct drm_encoder *
+arcpgu_drm_connector_best_encoder(struct drm_connector *connector)
+{
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_best_encoder: cannot find slave encoder for connector\n");
+		return NULL;
+	}
+
+	return &slave->base;
+}
+
+static enum drm_connector_status
+arcpgu_drm_connector_detect(struct drm_connector *connector, bool force)
+{
+	enum drm_connector_status status = connector_status_unknown;
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_detect: cannot find slave encoder for connector\n");
+		return status;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs && sfuncs->detect)
+		return sfuncs->detect(&slave->base, connector);
+
+	dev_err(connector->dev->dev, "connector_detect: could not detect slave funcs\n");
+	return status;
+}
+
+static void arcpgu_drm_connector_destroy(struct drm_connector *connector)
+{
+	drm_connector_unregister(connector);
+	drm_connector_cleanup(connector);
+}
+
+static const struct drm_connector_helper_funcs
+arcpgu_drm_connector_helper_funcs = {
+	.get_modes = arcpgu_drm_connector_get_modes,
+	.best_encoder = arcpgu_drm_connector_best_encoder,
+};
+
+static const struct drm_connector_funcs arcpgu_drm_connector_funcs = {
+	.dpms = drm_helper_connector_dpms,
+	.reset = drm_atomic_helper_connector_reset,
+	.detect = arcpgu_drm_connector_detect,
+	.fill_modes = drm_helper_probe_single_connector_modes,
+	.destroy = arcpgu_drm_connector_destroy,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+};
+
+static struct drm_encoder_helper_funcs arcpgu_drm_encoder_helper_funcs = {
+	.dpms = drm_i2c_encoder_dpms,
+	.mode_fixup = drm_i2c_encoder_mode_fixup,
+	.mode_set = drm_i2c_encoder_mode_set,
+	.prepare = drm_i2c_encoder_prepare,
+	.commit = drm_i2c_encoder_commit,
+	.detect = drm_i2c_encoder_detect,
+};
+
+static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
+{
+	struct arcpgu_drm_connector *arcpgu_connector;
+	struct drm_i2c_encoder_driver *driver;
+	struct drm_encoder_slave *encoder;
+	struct drm_connector *connector;
+	struct i2c_client *i2c_slave;
+	int ret;
+
+	encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
+	if (encoder == NULL)
+		return -ENOMEM;
+
+	i2c_slave = of_find_i2c_device_by_node(np);
+	if (!i2c_slave || !i2c_get_clientdata(i2c_slave)) {
+		dev_err(drm->dev, "failed to find i2c slave encoder\n");
+		return -EPROBE_DEFER;
+	}
+
+	if (i2c_slave->dev.driver == NULL) {
+		dev_err(drm->dev, "failed to find i2c slave driver\n");
+		return -EPROBE_DEFER;
+	}
+
+	driver =
+	    to_drm_i2c_encoder_driver(to_i2c_driver(i2c_slave->dev.driver));
+	ret = driver->encoder_init(i2c_slave, drm, encoder);
+	if (ret) {
+		dev_err(drm->dev, "failed to initialize i2c encoder slave\n");
+		return ret;
+	}
+
+	encoder->base.possible_crtcs = 1;
+	encoder->base.possible_clones = 0;
+	ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
+			       DRM_MODE_ENCODER_TMDS, NULL);
+	if (ret)
+		return ret;
+
+	drm_encoder_helper_add(&encoder->base,
+			       &arcpgu_drm_encoder_helper_funcs);
+
+	arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector),
+					GFP_KERNEL);
+	if (!arcpgu_connector) {
+		ret = -ENOMEM;
+		goto error_encoder_cleanup;
+	}
+
+	connector = &arcpgu_connector->connector;
+	drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
+	ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,
+			DRM_MODE_CONNECTOR_HDMIA);
+	if (ret < 0) {
+		dev_err(drm->dev, "failed to initialize drm connector\n");
+		goto error_encoder_cleanup;
+	}
+
+	ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
+	if (ret < 0) {
+		dev_err(drm->dev, "could not attach connector to encoder\n");
+		drm_connector_unregister(connector);
+		goto error_connector_cleanup;
+	}
+
+	arcpgu_connector->encoder_slave = encoder;
+
+	return 0;
+
+error_connector_cleanup:
+	drm_connector_cleanup(connector);
+
+error_encoder_cleanup:
+	drm_encoder_cleanup(&encoder->base);
+	return ret;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_regs.h b/drivers/gpu/drm/arc/arcpgu_regs.h
new file mode 100644
index 0000000..95a13a8
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_regs.h
@@ -0,0 +1,40 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARC_PGU_REGS_H_
+#define _ARC_PGU_REGS_H_
+
+#define ARCPGU_REG_CTRL		0x00
+#define ARCPGU_REG_STAT		0x04
+#define ARCPGU_REG_FMT		0x10
+#define ARCPGU_REG_HSYNC	0x14
+#define ARCPGU_REG_VSYNC	0x18
+#define ARCPGU_REG_ACTIVE	0x1c
+#define ARCPGU_REG_BUF0_ADDR	0x40
+#define ARCPGU_REG_STRIDE	0x50
+#define ARCPGU_REG_START_SET	0x84
+
+#define ARCPGU_REG_ID		0x3FC
+
+#define ARCPGU_CTRL_ENABLE_MASK	0x02
+#define ARCPGU_CTRL_VS_POL_MASK	0x1
+#define ARCPGU_CTRL_VS_POL_OFST	0x3
+#define ARCPGU_CTRL_HS_POL_MASK	0x1
+#define ARCPGU_CTRL_HS_POL_OFST	0x4
+#define ARCPGU_MODE_RGB888_MASK	0x04
+#define ARCPGU_STAT_BUSY_MASK	0x02
+
+#endif
-- 
2.5.5

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

* [PATCH 1/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: linux-snps-arc

From: Carlos Palminha <palminha@synopsys.com>

ARC PGU could be found on some development boards from Synopsys.
This is a simple byte streamer that reads data from a framebuffer
and sends data to the single encoder.

Signed-off-by: Carlos Palminha <palminha at synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: David Airlie <airlied at linux.ie>
Cc: dri-devel at lists.freedesktop.org
Cc: linux-snps-arc at lists.infradead.org
---

Note following series (v6) that introduces drm_connector_register_all()
is a prerequisite now: https://lkml.org/lkml/2016/4/19/299

No changes v5 -> v6.

No changes v4 -> v5.

Changes v3 -> v4:
 * The driver author is now set properly (thanks Carlos for all your efforts)
 * Implemented correct hsync and vsync setup (thanks Jose)
 * Dummy call-backs were removed (as suggested by Daniel)
 * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
 * With above in mind we were able to adopt recently introduced
   drm_connector_register_all()/drm_connector_unregister_all()

Changes v2 -> v3:
 * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose).
 * Fixed driver building as module (reported by 0-DAY kernel test infrastruct.)
 * Implemented uncached mapping of user-space FB pages.

No changes v1 -> v2.

 drivers/gpu/drm/Kconfig           |   2 +
 drivers/gpu/drm/Makefile          |   1 +
 drivers/gpu/drm/arc/Kconfig       |  10 ++
 drivers/gpu/drm/arc/Makefile      |   2 +
 drivers/gpu/drm/arc/arcpgu.h      |  50 +++++++
 drivers/gpu/drm/arc/arcpgu_crtc.c | 257 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c  | 282 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c | 201 +++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h |  40 ++++++
 9 files changed, 845 insertions(+)
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f2a74d0..9e4f2f1 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -281,3 +281,5 @@ source "drivers/gpu/drm/imx/Kconfig"
 source "drivers/gpu/drm/vc4/Kconfig"
 
 source "drivers/gpu/drm/etnaviv/Kconfig"
+
+source "drivers/gpu/drm/arc/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 6eb94fc..c338d04 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -78,3 +78,4 @@ obj-y			+= panel/
 obj-y			+= bridge/
 obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
 obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
+obj-$(CONFIG_DRM_ARCPGU)+= arc/
diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig
new file mode 100644
index 0000000..f9a13b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/Kconfig
@@ -0,0 +1,10 @@
+config DRM_ARCPGU
+	tristate "ARC PGU"
+	depends on DRM && OF
+	select DRM_KMS_CMA_HELPER
+	select DRM_KMS_FB_HELPER
+	select DRM_KMS_HELPER
+	help
+	  Choose this option if you have an ARC PGU controller.
+
+	  If M is selected the module will be called arcpgu.
diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile
new file mode 100644
index 0000000..d48fda7
--- /dev/null
+++ b/drivers/gpu/drm/arc/Makefile
@@ -0,0 +1,2 @@
+arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
+obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
new file mode 100644
index 0000000..86574b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu.h
@@ -0,0 +1,50 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARCPGU_H_
+#define _ARCPGU_H_
+
+struct arcpgu_drm_private {
+	void __iomem		*regs;
+	struct clk		*clk;
+	struct drm_fbdev_cma	*fbdev;
+	struct drm_framebuffer	*fb;
+	struct list_head	event_list;
+	struct drm_crtc		crtc;
+	struct drm_plane	*plane;
+};
+
+#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
+
+static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
+				 unsigned int reg, u32 value)
+{
+	iowrite32(value, arcpgu->regs + reg);
+}
+
+static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
+			       unsigned int reg)
+{
+	return ioread32(arcpgu->regs + reg);
+}
+
+int arc_pgu_setup_crtc(struct drm_device *dev);
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
+struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
+	unsigned int preferred_bpp, unsigned int num_crtc,
+	unsigned int max_conn_count);
+
+#endif
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
new file mode 100644
index 0000000..92f8bef
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -0,0 +1,257 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_plane_helper.h>
+#include <linux/clk.h>
+#include <linux/platform_data/simplefb.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+#define ENCODE_PGU_XY(x, y)	((((x) - 1) << 16) | ((y) - 1))
+
+static struct simplefb_format supported_formats[] = {
+	{ "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 },
+	{ "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 },
+};
+
+static void arc_pgu_set_pxl_fmt(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	uint32_t pixel_format = crtc->primary->state->fb->pixel_format;
+	struct simplefb_format *format = NULL;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
+		if (supported_formats[i].fourcc == pixel_format)
+			format = &supported_formats[i];
+	}
+
+	if (WARN_ON(!format))
+		return;
+
+	if (format->fourcc == DRM_FORMAT_RGB888)
+		arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+					   ARCPGU_MODE_RGB888_MASK);
+
+}
+
+static const struct drm_crtc_funcs arc_pgu_crtc_funcs = {
+	.destroy = drm_crtc_cleanup,
+	.set_config = drm_atomic_helper_set_config,
+	.page_flip = drm_atomic_helper_page_flip,
+	.reset = drm_atomic_helper_crtc_reset,
+	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+};
+
+static void arc_pgu_crtc_mode_set_nofb(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *m = &crtc->state->adjusted_mode;
+	u32 val;
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
+		      ENCODE_PGU_XY(m->crtc_htotal, m->crtc_vtotal));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_HSYNC,
+		      ENCODE_PGU_XY(m->crtc_hsync_start - m->crtc_hdisplay,
+				    m->crtc_hsync_end - m->crtc_hdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_VSYNC,
+		      ENCODE_PGU_XY(m->crtc_vsync_start - m->crtc_vdisplay,
+				    m->crtc_vsync_end - m->crtc_vdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_ACTIVE,
+		      ENCODE_PGU_XY(m->crtc_hblank_end - m->crtc_hblank_start,
+				    m->crtc_vblank_end - m->crtc_vblank_start));
+
+	val = arc_pgu_read(arcpgu, ARCPGU_REG_CTRL);
+
+	if (m->flags & DRM_MODE_FLAG_PVSYNC)
+		val |= ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST);
+
+	if (m->flags & DRM_MODE_FLAG_PHSYNC)
+		val |= ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST);
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, val);
+	arc_pgu_write(arcpgu, ARCPGU_REG_STRIDE, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_START_SET, 1);
+
+	arc_pgu_set_pxl_fmt(crtc);
+
+	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
+}
+
+static void arc_pgu_crtc_enable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	clk_prepare_enable(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+		      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+		      ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static void arc_pgu_crtc_disable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	if (!crtc->primary->fb)
+		return;
+
+	clk_disable_unprepare(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
+			      ~ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static int arc_pgu_crtc_atomic_check(struct drm_crtc *crtc,
+				     struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *mode = &state->adjusted_mode;
+	long rate, clk_rate = mode->clock * 1000;
+
+	rate = clk_round_rate(arcpgu->clk, clk_rate);
+	if (rate != clk_rate)
+		return -EINVAL;
+
+	return 0;
+}
+
+static void arc_pgu_crtc_atomic_begin(struct drm_crtc *crtc,
+				      struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	unsigned long flags;
+
+	if (crtc->state->event) {
+		struct drm_pending_vblank_event *event = crtc->state->event;
+
+		crtc->state->event = NULL;
+		event->pipe = drm_crtc_index(crtc);
+
+		WARN_ON(drm_crtc_vblank_get(crtc) != 0);
+
+		spin_lock_irqsave(&crtc->dev->event_lock, flags);
+		list_add_tail(&event->base.link, &arcpgu->event_list);
+		spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+	}
+}
+
+static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = {
+	.mode_set	= drm_helper_crtc_mode_set,
+	.mode_set_base	= drm_helper_crtc_mode_set_base,
+	.mode_set_nofb	= arc_pgu_crtc_mode_set_nofb,
+	.enable		= arc_pgu_crtc_enable,
+	.disable	= arc_pgu_crtc_disable,
+	.prepare	= arc_pgu_crtc_disable,
+	.commit		= arc_pgu_crtc_enable,
+	.atomic_check	= arc_pgu_crtc_atomic_check,
+	.atomic_begin	= arc_pgu_crtc_atomic_begin,
+};
+
+static void arc_pgu_plane_atomic_update(struct drm_plane *plane,
+					struct drm_plane_state *state)
+{
+	struct arcpgu_drm_private *arcpgu;
+	struct drm_gem_cma_object *gem;
+
+	if (!plane->state->crtc || !plane->state->fb)
+		return;
+
+	arcpgu = crtc_to_arcpgu_priv(plane->state->crtc);
+	gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);
+}
+
+static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
+	.prepare_fb = NULL,
+	.cleanup_fb = NULL,
+	.atomic_update = arc_pgu_plane_atomic_update,
+};
+
+static void arc_pgu_plane_destroy(struct drm_plane *plane)
+{
+	drm_plane_helper_disable(plane);
+	drm_plane_cleanup(plane);
+}
+
+static const struct drm_plane_funcs arc_pgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= arc_pgu_plane_destroy,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static struct drm_plane *arc_pgu_plane_init(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *plane = NULL;
+	u32 formats[ARRAY_SIZE(supported_formats)], i;
+	int ret;
+
+	plane = devm_kzalloc(drm->dev, sizeof(*plane), GFP_KERNEL);
+	if (!plane)
+		return ERR_PTR(-ENOMEM);
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++)
+		formats[i] = supported_formats[i].fourcc;
+
+	ret = drm_universal_plane_init(drm, plane, 0xff, &arc_pgu_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ERR_PTR(ret);
+
+	drm_plane_helper_add(plane, &arc_pgu_plane_helper_funcs);
+	arcpgu->plane = plane;
+
+	return plane;
+}
+
+int arc_pgu_setup_crtc(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *primary;
+	int ret;
+
+	primary = arc_pgu_plane_init(drm);
+	if (IS_ERR(primary))
+		return PTR_ERR(primary);
+
+	ret = drm_crtc_init_with_planes(drm, &arcpgu->crtc, primary, NULL,
+					&arc_pgu_crtc_funcs, NULL);
+	if (ret) {
+		arc_pgu_plane_destroy(primary);
+		return ret;
+	}
+
+	drm_crtc_helper_add(&arcpgu->crtc, &arc_pgu_crtc_helper_funcs);
+	return 0;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
new file mode 100644
index 0000000..5b35e5db
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -0,0 +1,282 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/clk.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
+{
+	struct arcpgu_drm_private *arcpgu = dev->dev_private;
+
+	if (arcpgu->fbdev)
+		drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
+}
+
+static int arcpgu_atomic_commit(struct drm_device *dev,
+				    struct drm_atomic_state *state, bool async)
+{
+	return drm_atomic_helper_commit(dev, state, false);
+}
+
+static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
+	.fb_create  = drm_fb_cma_create,
+	.output_poll_changed = arcpgu_fb_output_poll_changed,
+	.atomic_check = drm_atomic_helper_check,
+	.atomic_commit = arcpgu_atomic_commit,
+};
+
+static void arcpgu_setup_mode_config(struct drm_device *drm)
+{
+	drm_mode_config_init(drm);
+	drm->mode_config.min_width = 0;
+	drm->mode_config.min_height = 0;
+	drm->mode_config.max_width = 1920;
+	drm->mode_config.max_height = 1080;
+	drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
+}
+
+int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+	int ret;
+
+	ret = drm_gem_mmap(filp, vma);
+	if (ret)
+		return ret;
+
+	vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+	return 0;
+}
+
+static const struct file_operations arcpgu_drm_ops = {
+	.owner = THIS_MODULE,
+	.open = drm_open,
+	.release = drm_release,
+	.unlocked_ioctl = drm_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl = drm_compat_ioctl,
+#endif
+	.poll = drm_poll,
+	.read = drm_read,
+	.llseek = no_llseek,
+	.mmap = arcpgu_gem_mmap,
+};
+
+static void arcpgu_preclose(struct drm_device *drm, struct drm_file *file)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_pending_vblank_event *e, *t;
+	unsigned long flags;
+
+	spin_lock_irqsave(&drm->event_lock, flags);
+	list_for_each_entry_safe(e, t, &arcpgu->event_list, base.link) {
+		if (e->base.file_priv != file)
+			continue;
+		list_del(&e->base.link);
+		e->base.destroy(&e->base);
+	}
+	spin_unlock_irqrestore(&drm->event_lock, flags);
+}
+
+static void arcpgu_lastclose(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	drm_fbdev_cma_restore_mode(arcpgu->fbdev);
+}
+
+static int arcpgu_load(struct drm_device *drm)
+{
+	struct platform_device *pdev = to_platform_device(drm->dev);
+	struct arcpgu_drm_private *arcpgu;
+	struct device_node *encoder_node;
+	struct resource *res;
+	int ret;
+
+	arcpgu = devm_kzalloc(&pdev->dev, sizeof(*arcpgu), GFP_KERNEL);
+	if (arcpgu == NULL)
+		return -ENOMEM;
+
+	drm->dev_private = arcpgu;
+
+	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
+	if (IS_ERR(arcpgu->clk))
+		return PTR_ERR(arcpgu->clk);
+
+	INIT_LIST_HEAD(&arcpgu->event_list);
+
+	arcpgu_setup_mode_config(drm);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(arcpgu->regs)) {
+		dev_err(drm->dev, "Could not remap IO mem\n");
+		return PTR_ERR(arcpgu->regs);
+	}
+
+	dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
+		 arc_pgu_read(arcpgu, ARCPGU_REG_ID));
+
+	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
+		return -ENODEV;
+
+	if (arc_pgu_setup_crtc(drm) < 0)
+		return -ENODEV;
+
+	/* find the encoder node and initialize it */
+	encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
+	if (!encoder_node) {
+		dev_err(drm->dev, "failed to get an encoder slave node\n");
+		return -ENODEV;
+	}
+
+	ret = arcpgu_drm_hdmi_init(drm, encoder_node);
+	if (ret < 0)
+		return ret;
+
+	drm_mode_config_reset(drm);
+	drm_kms_helper_poll_init(drm);
+
+	arcpgu->fbdev = drm_fbdev_cma_init(drm, 16,
+					      drm->mode_config.num_crtc,
+					      drm->mode_config.num_connector);
+	if (IS_ERR(arcpgu->fbdev)) {
+		ret = PTR_ERR(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+		return -ENODEV;
+	}
+
+	platform_set_drvdata(pdev, arcpgu);
+	return 0;
+}
+
+int arcpgu_unload(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	if (arcpgu->fbdev) {
+		drm_fbdev_cma_fini(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+	}
+	drm_kms_helper_poll_fini(drm);
+	drm_vblank_cleanup(drm);
+	drm_mode_config_cleanup(drm);
+
+	return 0;
+}
+
+static struct drm_driver arcpgu_drm_driver = {
+	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
+			   DRIVER_ATOMIC,
+	.preclose = arcpgu_preclose,
+	.lastclose = arcpgu_lastclose,
+	.name = "drm-arcpgu",
+	.desc = "ARC PGU Controller",
+	.date = "20160219",
+	.major = 1,
+	.minor = 0,
+	.patchlevel = 0,
+	.fops = &arcpgu_drm_ops,
+	.dumb_create = drm_gem_cma_dumb_create,
+	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
+	.dumb_destroy = drm_gem_dumb_destroy,
+	.get_vblank_counter = drm_vblank_no_hw_counter,
+	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
+	.gem_free_object = drm_gem_cma_free_object,
+	.gem_vm_ops = &drm_gem_cma_vm_ops,
+	.gem_prime_export = drm_gem_prime_export,
+	.gem_prime_import = drm_gem_prime_import,
+	.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
+	.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
+	.gem_prime_vmap = drm_gem_cma_prime_vmap,
+	.gem_prime_vunmap = drm_gem_cma_prime_vunmap,
+	.gem_prime_mmap = drm_gem_cma_prime_mmap,
+};
+
+static int arcpgu_probe(struct platform_device *pdev)
+{
+	struct drm_device *drm;
+	int ret;
+
+	drm = drm_dev_alloc(&arcpgu_drm_driver, &pdev->dev);
+	if (!drm)
+		return -ENOMEM;
+
+	ret = arcpgu_load(drm);
+	if (ret)
+		goto err_unref;
+
+	ret = drm_dev_register(drm, 0);
+	if (ret)
+		goto err_unload;
+
+	ret = drm_connector_register_all(drm);
+	if (ret)
+		goto err_unregister;
+
+	return 0;
+
+err_unregister:
+	drm_dev_unregister(drm);
+
+err_unload:
+	arcpgu_unload(drm);
+
+err_unref:
+	drm_dev_unref(drm);
+
+	return ret;
+}
+
+static int arcpgu_remove(struct platform_device *pdev)
+{
+	struct drm_device *drm = platform_get_drvdata(pdev);
+
+	drm_connector_unregister_all(drm);
+	drm_dev_unregister(drm);
+	arcpgu_unload(drm);
+	drm_dev_unref(drm);
+
+	return 0;
+}
+
+static const struct of_device_id arcpgu_of_table[] = {
+	{.compatible = "snps,arcpgu"},
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, arcpgu_of_table);
+
+static struct platform_driver arcpgu_platform_driver = {
+	.probe = arcpgu_probe,
+	.remove = arcpgu_remove,
+	.driver = {
+		   .name = "arcpgu",
+		   .of_match_table = arcpgu_of_table,
+		   },
+};
+
+module_platform_driver(arcpgu_platform_driver);
+
+MODULE_AUTHOR("Carlos Palminha <palminha at synopsys.com>");
+MODULE_DESCRIPTION("ARC PGU DRM driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c
new file mode 100644
index 0000000..08b6bae
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c
@@ -0,0 +1,201 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_encoder_slave.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+
+struct arcpgu_drm_connector {
+	struct drm_connector connector;
+	struct drm_encoder_slave *encoder_slave;
+};
+
+static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
+{
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_get_modes: cannot find slave encoder for connector\n");
+		return 0;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs->get_modes == NULL)
+		return 0;
+
+	return sfuncs->get_modes(&slave->base, connector);
+}
+
+struct drm_encoder *
+arcpgu_drm_connector_best_encoder(struct drm_connector *connector)
+{
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_best_encoder: cannot find slave encoder for connector\n");
+		return NULL;
+	}
+
+	return &slave->base;
+}
+
+static enum drm_connector_status
+arcpgu_drm_connector_detect(struct drm_connector *connector, bool force)
+{
+	enum drm_connector_status status = connector_status_unknown;
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_detect: cannot find slave encoder for connector\n");
+		return status;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs && sfuncs->detect)
+		return sfuncs->detect(&slave->base, connector);
+
+	dev_err(connector->dev->dev, "connector_detect: could not detect slave funcs\n");
+	return status;
+}
+
+static void arcpgu_drm_connector_destroy(struct drm_connector *connector)
+{
+	drm_connector_unregister(connector);
+	drm_connector_cleanup(connector);
+}
+
+static const struct drm_connector_helper_funcs
+arcpgu_drm_connector_helper_funcs = {
+	.get_modes = arcpgu_drm_connector_get_modes,
+	.best_encoder = arcpgu_drm_connector_best_encoder,
+};
+
+static const struct drm_connector_funcs arcpgu_drm_connector_funcs = {
+	.dpms = drm_helper_connector_dpms,
+	.reset = drm_atomic_helper_connector_reset,
+	.detect = arcpgu_drm_connector_detect,
+	.fill_modes = drm_helper_probe_single_connector_modes,
+	.destroy = arcpgu_drm_connector_destroy,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+};
+
+static struct drm_encoder_helper_funcs arcpgu_drm_encoder_helper_funcs = {
+	.dpms = drm_i2c_encoder_dpms,
+	.mode_fixup = drm_i2c_encoder_mode_fixup,
+	.mode_set = drm_i2c_encoder_mode_set,
+	.prepare = drm_i2c_encoder_prepare,
+	.commit = drm_i2c_encoder_commit,
+	.detect = drm_i2c_encoder_detect,
+};
+
+static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
+{
+	struct arcpgu_drm_connector *arcpgu_connector;
+	struct drm_i2c_encoder_driver *driver;
+	struct drm_encoder_slave *encoder;
+	struct drm_connector *connector;
+	struct i2c_client *i2c_slave;
+	int ret;
+
+	encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
+	if (encoder == NULL)
+		return -ENOMEM;
+
+	i2c_slave = of_find_i2c_device_by_node(np);
+	if (!i2c_slave || !i2c_get_clientdata(i2c_slave)) {
+		dev_err(drm->dev, "failed to find i2c slave encoder\n");
+		return -EPROBE_DEFER;
+	}
+
+	if (i2c_slave->dev.driver == NULL) {
+		dev_err(drm->dev, "failed to find i2c slave driver\n");
+		return -EPROBE_DEFER;
+	}
+
+	driver =
+	    to_drm_i2c_encoder_driver(to_i2c_driver(i2c_slave->dev.driver));
+	ret = driver->encoder_init(i2c_slave, drm, encoder);
+	if (ret) {
+		dev_err(drm->dev, "failed to initialize i2c encoder slave\n");
+		return ret;
+	}
+
+	encoder->base.possible_crtcs = 1;
+	encoder->base.possible_clones = 0;
+	ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
+			       DRM_MODE_ENCODER_TMDS, NULL);
+	if (ret)
+		return ret;
+
+	drm_encoder_helper_add(&encoder->base,
+			       &arcpgu_drm_encoder_helper_funcs);
+
+	arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector),
+					GFP_KERNEL);
+	if (!arcpgu_connector) {
+		ret = -ENOMEM;
+		goto error_encoder_cleanup;
+	}
+
+	connector = &arcpgu_connector->connector;
+	drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
+	ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,
+			DRM_MODE_CONNECTOR_HDMIA);
+	if (ret < 0) {
+		dev_err(drm->dev, "failed to initialize drm connector\n");
+		goto error_encoder_cleanup;
+	}
+
+	ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
+	if (ret < 0) {
+		dev_err(drm->dev, "could not attach connector to encoder\n");
+		drm_connector_unregister(connector);
+		goto error_connector_cleanup;
+	}
+
+	arcpgu_connector->encoder_slave = encoder;
+
+	return 0;
+
+error_connector_cleanup:
+	drm_connector_cleanup(connector);
+
+error_encoder_cleanup:
+	drm_encoder_cleanup(&encoder->base);
+	return ret;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_regs.h b/drivers/gpu/drm/arc/arcpgu_regs.h
new file mode 100644
index 0000000..95a13a8
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_regs.h
@@ -0,0 +1,40 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARC_PGU_REGS_H_
+#define _ARC_PGU_REGS_H_
+
+#define ARCPGU_REG_CTRL		0x00
+#define ARCPGU_REG_STAT		0x04
+#define ARCPGU_REG_FMT		0x10
+#define ARCPGU_REG_HSYNC	0x14
+#define ARCPGU_REG_VSYNC	0x18
+#define ARCPGU_REG_ACTIVE	0x1c
+#define ARCPGU_REG_BUF0_ADDR	0x40
+#define ARCPGU_REG_STRIDE	0x50
+#define ARCPGU_REG_START_SET	0x84
+
+#define ARCPGU_REG_ID		0x3FC
+
+#define ARCPGU_CTRL_ENABLE_MASK	0x02
+#define ARCPGU_CTRL_VS_POL_MASK	0x1
+#define ARCPGU_CTRL_VS_POL_OFST	0x3
+#define ARCPGU_CTRL_HS_POL_MASK	0x1
+#define ARCPGU_CTRL_HS_POL_OFST	0x4
+#define ARCPGU_MODE_RGB888_MASK	0x04
+#define ARCPGU_STAT_BUSY_MASK	0x02
+
+#endif
-- 
2.5.5

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

* [PATCH 1/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel
  Cc: David Airlie, Alexey Brodkin, linux-kernel, Carlos Palminha,
	Daniel Vetter, linux-snps-arc

From: Carlos Palminha <palminha@synopsys.com>

ARC PGU could be found on some development boards from Synopsys.
This is a simple byte streamer that reads data from a framebuffer
and sends data to the single encoder.

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org
---

Note following series (v6) that introduces drm_connector_register_all()
is a prerequisite now: https://lkml.org/lkml/2016/4/19/299

No changes v5 -> v6.

No changes v4 -> v5.

Changes v3 -> v4:
 * The driver author is now set properly (thanks Carlos for all your efforts)
 * Implemented correct hsync and vsync setup (thanks Jose)
 * Dummy call-backs were removed (as suggested by Daniel)
 * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
 * With above in mind we were able to adopt recently introduced
   drm_connector_register_all()/drm_connector_unregister_all()

Changes v2 -> v3:
 * Improved failure path if arcpgu_connector wasn't allocated (thanks Jose).
 * Fixed driver building as module (reported by 0-DAY kernel test infrastruct.)
 * Implemented uncached mapping of user-space FB pages.

No changes v1 -> v2.

 drivers/gpu/drm/Kconfig           |   2 +
 drivers/gpu/drm/Makefile          |   1 +
 drivers/gpu/drm/arc/Kconfig       |  10 ++
 drivers/gpu/drm/arc/Makefile      |   2 +
 drivers/gpu/drm/arc/arcpgu.h      |  50 +++++++
 drivers/gpu/drm/arc/arcpgu_crtc.c | 257 ++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c  | 282 ++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c | 201 +++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h |  40 ++++++
 9 files changed, 845 insertions(+)
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f2a74d0..9e4f2f1 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -281,3 +281,5 @@ source "drivers/gpu/drm/imx/Kconfig"
 source "drivers/gpu/drm/vc4/Kconfig"
 
 source "drivers/gpu/drm/etnaviv/Kconfig"
+
+source "drivers/gpu/drm/arc/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 6eb94fc..c338d04 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -78,3 +78,4 @@ obj-y			+= panel/
 obj-y			+= bridge/
 obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
 obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
+obj-$(CONFIG_DRM_ARCPGU)+= arc/
diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig
new file mode 100644
index 0000000..f9a13b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/Kconfig
@@ -0,0 +1,10 @@
+config DRM_ARCPGU
+	tristate "ARC PGU"
+	depends on DRM && OF
+	select DRM_KMS_CMA_HELPER
+	select DRM_KMS_FB_HELPER
+	select DRM_KMS_HELPER
+	help
+	  Choose this option if you have an ARC PGU controller.
+
+	  If M is selected the module will be called arcpgu.
diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile
new file mode 100644
index 0000000..d48fda7
--- /dev/null
+++ b/drivers/gpu/drm/arc/Makefile
@@ -0,0 +1,2 @@
+arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
+obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
new file mode 100644
index 0000000..86574b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu.h
@@ -0,0 +1,50 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARCPGU_H_
+#define _ARCPGU_H_
+
+struct arcpgu_drm_private {
+	void __iomem		*regs;
+	struct clk		*clk;
+	struct drm_fbdev_cma	*fbdev;
+	struct drm_framebuffer	*fb;
+	struct list_head	event_list;
+	struct drm_crtc		crtc;
+	struct drm_plane	*plane;
+};
+
+#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
+
+static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
+				 unsigned int reg, u32 value)
+{
+	iowrite32(value, arcpgu->regs + reg);
+}
+
+static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
+			       unsigned int reg)
+{
+	return ioread32(arcpgu->regs + reg);
+}
+
+int arc_pgu_setup_crtc(struct drm_device *dev);
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
+struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
+	unsigned int preferred_bpp, unsigned int num_crtc,
+	unsigned int max_conn_count);
+
+#endif
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
new file mode 100644
index 0000000..92f8bef
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -0,0 +1,257 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_plane_helper.h>
+#include <linux/clk.h>
+#include <linux/platform_data/simplefb.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+#define ENCODE_PGU_XY(x, y)	((((x) - 1) << 16) | ((y) - 1))
+
+static struct simplefb_format supported_formats[] = {
+	{ "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 },
+	{ "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 },
+};
+
+static void arc_pgu_set_pxl_fmt(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	uint32_t pixel_format = crtc->primary->state->fb->pixel_format;
+	struct simplefb_format *format = NULL;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
+		if (supported_formats[i].fourcc == pixel_format)
+			format = &supported_formats[i];
+	}
+
+	if (WARN_ON(!format))
+		return;
+
+	if (format->fourcc == DRM_FORMAT_RGB888)
+		arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+					   ARCPGU_MODE_RGB888_MASK);
+
+}
+
+static const struct drm_crtc_funcs arc_pgu_crtc_funcs = {
+	.destroy = drm_crtc_cleanup,
+	.set_config = drm_atomic_helper_set_config,
+	.page_flip = drm_atomic_helper_page_flip,
+	.reset = drm_atomic_helper_crtc_reset,
+	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+};
+
+static void arc_pgu_crtc_mode_set_nofb(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *m = &crtc->state->adjusted_mode;
+	u32 val;
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_FMT,
+		      ENCODE_PGU_XY(m->crtc_htotal, m->crtc_vtotal));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_HSYNC,
+		      ENCODE_PGU_XY(m->crtc_hsync_start - m->crtc_hdisplay,
+				    m->crtc_hsync_end - m->crtc_hdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_VSYNC,
+		      ENCODE_PGU_XY(m->crtc_vsync_start - m->crtc_vdisplay,
+				    m->crtc_vsync_end - m->crtc_vdisplay));
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_ACTIVE,
+		      ENCODE_PGU_XY(m->crtc_hblank_end - m->crtc_hblank_start,
+				    m->crtc_vblank_end - m->crtc_vblank_start));
+
+	val = arc_pgu_read(arcpgu, ARCPGU_REG_CTRL);
+
+	if (m->flags & DRM_MODE_FLAG_PVSYNC)
+		val |= ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_VS_POL_MASK << ARCPGU_CTRL_VS_POL_OFST);
+
+	if (m->flags & DRM_MODE_FLAG_PHSYNC)
+		val |= ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST;
+	else
+		val &= ~(ARCPGU_CTRL_HS_POL_MASK << ARCPGU_CTRL_HS_POL_OFST);
+
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL, val);
+	arc_pgu_write(arcpgu, ARCPGU_REG_STRIDE, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_START_SET, 1);
+
+	arc_pgu_set_pxl_fmt(crtc);
+
+	clk_set_rate(arcpgu->clk, m->crtc_clock * 1000);
+}
+
+static void arc_pgu_crtc_enable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	clk_prepare_enable(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+		      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) |
+		      ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static void arc_pgu_crtc_disable(struct drm_crtc *crtc)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+
+	if (!crtc->primary->fb)
+		return;
+
+	clk_disable_unprepare(arcpgu->clk);
+	arc_pgu_write(arcpgu, ARCPGU_REG_CTRL,
+			      arc_pgu_read(arcpgu, ARCPGU_REG_CTRL) &
+			      ~ARCPGU_CTRL_ENABLE_MASK);
+}
+
+static int arc_pgu_crtc_atomic_check(struct drm_crtc *crtc,
+				     struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	struct drm_display_mode *mode = &state->adjusted_mode;
+	long rate, clk_rate = mode->clock * 1000;
+
+	rate = clk_round_rate(arcpgu->clk, clk_rate);
+	if (rate != clk_rate)
+		return -EINVAL;
+
+	return 0;
+}
+
+static void arc_pgu_crtc_atomic_begin(struct drm_crtc *crtc,
+				      struct drm_crtc_state *state)
+{
+	struct arcpgu_drm_private *arcpgu = crtc_to_arcpgu_priv(crtc);
+	unsigned long flags;
+
+	if (crtc->state->event) {
+		struct drm_pending_vblank_event *event = crtc->state->event;
+
+		crtc->state->event = NULL;
+		event->pipe = drm_crtc_index(crtc);
+
+		WARN_ON(drm_crtc_vblank_get(crtc) != 0);
+
+		spin_lock_irqsave(&crtc->dev->event_lock, flags);
+		list_add_tail(&event->base.link, &arcpgu->event_list);
+		spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
+	}
+}
+
+static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = {
+	.mode_set	= drm_helper_crtc_mode_set,
+	.mode_set_base	= drm_helper_crtc_mode_set_base,
+	.mode_set_nofb	= arc_pgu_crtc_mode_set_nofb,
+	.enable		= arc_pgu_crtc_enable,
+	.disable	= arc_pgu_crtc_disable,
+	.prepare	= arc_pgu_crtc_disable,
+	.commit		= arc_pgu_crtc_enable,
+	.atomic_check	= arc_pgu_crtc_atomic_check,
+	.atomic_begin	= arc_pgu_crtc_atomic_begin,
+};
+
+static void arc_pgu_plane_atomic_update(struct drm_plane *plane,
+					struct drm_plane_state *state)
+{
+	struct arcpgu_drm_private *arcpgu;
+	struct drm_gem_cma_object *gem;
+
+	if (!plane->state->crtc || !plane->state->fb)
+		return;
+
+	arcpgu = crtc_to_arcpgu_priv(plane->state->crtc);
+	gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0);
+	arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr);
+}
+
+static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
+	.prepare_fb = NULL,
+	.cleanup_fb = NULL,
+	.atomic_update = arc_pgu_plane_atomic_update,
+};
+
+static void arc_pgu_plane_destroy(struct drm_plane *plane)
+{
+	drm_plane_helper_disable(plane);
+	drm_plane_cleanup(plane);
+}
+
+static const struct drm_plane_funcs arc_pgu_plane_funcs = {
+	.update_plane		= drm_atomic_helper_update_plane,
+	.disable_plane		= drm_atomic_helper_disable_plane,
+	.destroy		= arc_pgu_plane_destroy,
+	.reset			= drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
+};
+
+static struct drm_plane *arc_pgu_plane_init(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *plane = NULL;
+	u32 formats[ARRAY_SIZE(supported_formats)], i;
+	int ret;
+
+	plane = devm_kzalloc(drm->dev, sizeof(*plane), GFP_KERNEL);
+	if (!plane)
+		return ERR_PTR(-ENOMEM);
+
+	for (i = 0; i < ARRAY_SIZE(supported_formats); i++)
+		formats[i] = supported_formats[i].fourcc;
+
+	ret = drm_universal_plane_init(drm, plane, 0xff, &arc_pgu_plane_funcs,
+				       formats, ARRAY_SIZE(formats),
+				       DRM_PLANE_TYPE_PRIMARY, NULL);
+	if (ret)
+		return ERR_PTR(ret);
+
+	drm_plane_helper_add(plane, &arc_pgu_plane_helper_funcs);
+	arcpgu->plane = plane;
+
+	return plane;
+}
+
+int arc_pgu_setup_crtc(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_plane *primary;
+	int ret;
+
+	primary = arc_pgu_plane_init(drm);
+	if (IS_ERR(primary))
+		return PTR_ERR(primary);
+
+	ret = drm_crtc_init_with_planes(drm, &arcpgu->crtc, primary, NULL,
+					&arc_pgu_crtc_funcs, NULL);
+	if (ret) {
+		arc_pgu_plane_destroy(primary);
+		return ret;
+	}
+
+	drm_crtc_helper_add(&arcpgu->crtc, &arc_pgu_crtc_helper_funcs);
+	return 0;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
new file mode 100644
index 0000000..5b35e5db
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -0,0 +1,282 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/clk.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+#include "arcpgu_regs.h"
+
+static void arcpgu_fb_output_poll_changed(struct drm_device *dev)
+{
+	struct arcpgu_drm_private *arcpgu = dev->dev_private;
+
+	if (arcpgu->fbdev)
+		drm_fbdev_cma_hotplug_event(arcpgu->fbdev);
+}
+
+static int arcpgu_atomic_commit(struct drm_device *dev,
+				    struct drm_atomic_state *state, bool async)
+{
+	return drm_atomic_helper_commit(dev, state, false);
+}
+
+static struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = {
+	.fb_create  = drm_fb_cma_create,
+	.output_poll_changed = arcpgu_fb_output_poll_changed,
+	.atomic_check = drm_atomic_helper_check,
+	.atomic_commit = arcpgu_atomic_commit,
+};
+
+static void arcpgu_setup_mode_config(struct drm_device *drm)
+{
+	drm_mode_config_init(drm);
+	drm->mode_config.min_width = 0;
+	drm->mode_config.min_height = 0;
+	drm->mode_config.max_width = 1920;
+	drm->mode_config.max_height = 1080;
+	drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs;
+}
+
+int arcpgu_gem_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+	int ret;
+
+	ret = drm_gem_mmap(filp, vma);
+	if (ret)
+		return ret;
+
+	vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
+	return 0;
+}
+
+static const struct file_operations arcpgu_drm_ops = {
+	.owner = THIS_MODULE,
+	.open = drm_open,
+	.release = drm_release,
+	.unlocked_ioctl = drm_ioctl,
+#ifdef CONFIG_COMPAT
+	.compat_ioctl = drm_compat_ioctl,
+#endif
+	.poll = drm_poll,
+	.read = drm_read,
+	.llseek = no_llseek,
+	.mmap = arcpgu_gem_mmap,
+};
+
+static void arcpgu_preclose(struct drm_device *drm, struct drm_file *file)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+	struct drm_pending_vblank_event *e, *t;
+	unsigned long flags;
+
+	spin_lock_irqsave(&drm->event_lock, flags);
+	list_for_each_entry_safe(e, t, &arcpgu->event_list, base.link) {
+		if (e->base.file_priv != file)
+			continue;
+		list_del(&e->base.link);
+		e->base.destroy(&e->base);
+	}
+	spin_unlock_irqrestore(&drm->event_lock, flags);
+}
+
+static void arcpgu_lastclose(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	drm_fbdev_cma_restore_mode(arcpgu->fbdev);
+}
+
+static int arcpgu_load(struct drm_device *drm)
+{
+	struct platform_device *pdev = to_platform_device(drm->dev);
+	struct arcpgu_drm_private *arcpgu;
+	struct device_node *encoder_node;
+	struct resource *res;
+	int ret;
+
+	arcpgu = devm_kzalloc(&pdev->dev, sizeof(*arcpgu), GFP_KERNEL);
+	if (arcpgu == NULL)
+		return -ENOMEM;
+
+	drm->dev_private = arcpgu;
+
+	arcpgu->clk = devm_clk_get(drm->dev, "pxlclk");
+	if (IS_ERR(arcpgu->clk))
+		return PTR_ERR(arcpgu->clk);
+
+	INIT_LIST_HEAD(&arcpgu->event_list);
+
+	arcpgu_setup_mode_config(drm);
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	arcpgu->regs = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(arcpgu->regs)) {
+		dev_err(drm->dev, "Could not remap IO mem\n");
+		return PTR_ERR(arcpgu->regs);
+	}
+
+	dev_info(drm->dev, "arc_pgu ID: 0x%x\n",
+		 arc_pgu_read(arcpgu, ARCPGU_REG_ID));
+
+	if (dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)))
+		return -ENODEV;
+
+	if (arc_pgu_setup_crtc(drm) < 0)
+		return -ENODEV;
+
+	/* find the encoder node and initialize it */
+	encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
+	if (!encoder_node) {
+		dev_err(drm->dev, "failed to get an encoder slave node\n");
+		return -ENODEV;
+	}
+
+	ret = arcpgu_drm_hdmi_init(drm, encoder_node);
+	if (ret < 0)
+		return ret;
+
+	drm_mode_config_reset(drm);
+	drm_kms_helper_poll_init(drm);
+
+	arcpgu->fbdev = drm_fbdev_cma_init(drm, 16,
+					      drm->mode_config.num_crtc,
+					      drm->mode_config.num_connector);
+	if (IS_ERR(arcpgu->fbdev)) {
+		ret = PTR_ERR(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+		return -ENODEV;
+	}
+
+	platform_set_drvdata(pdev, arcpgu);
+	return 0;
+}
+
+int arcpgu_unload(struct drm_device *drm)
+{
+	struct arcpgu_drm_private *arcpgu = drm->dev_private;
+
+	if (arcpgu->fbdev) {
+		drm_fbdev_cma_fini(arcpgu->fbdev);
+		arcpgu->fbdev = NULL;
+	}
+	drm_kms_helper_poll_fini(drm);
+	drm_vblank_cleanup(drm);
+	drm_mode_config_cleanup(drm);
+
+	return 0;
+}
+
+static struct drm_driver arcpgu_drm_driver = {
+	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
+			   DRIVER_ATOMIC,
+	.preclose = arcpgu_preclose,
+	.lastclose = arcpgu_lastclose,
+	.name = "drm-arcpgu",
+	.desc = "ARC PGU Controller",
+	.date = "20160219",
+	.major = 1,
+	.minor = 0,
+	.patchlevel = 0,
+	.fops = &arcpgu_drm_ops,
+	.dumb_create = drm_gem_cma_dumb_create,
+	.dumb_map_offset = drm_gem_cma_dumb_map_offset,
+	.dumb_destroy = drm_gem_dumb_destroy,
+	.get_vblank_counter = drm_vblank_no_hw_counter,
+	.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+	.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
+	.gem_free_object = drm_gem_cma_free_object,
+	.gem_vm_ops = &drm_gem_cma_vm_ops,
+	.gem_prime_export = drm_gem_prime_export,
+	.gem_prime_import = drm_gem_prime_import,
+	.gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
+	.gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
+	.gem_prime_vmap = drm_gem_cma_prime_vmap,
+	.gem_prime_vunmap = drm_gem_cma_prime_vunmap,
+	.gem_prime_mmap = drm_gem_cma_prime_mmap,
+};
+
+static int arcpgu_probe(struct platform_device *pdev)
+{
+	struct drm_device *drm;
+	int ret;
+
+	drm = drm_dev_alloc(&arcpgu_drm_driver, &pdev->dev);
+	if (!drm)
+		return -ENOMEM;
+
+	ret = arcpgu_load(drm);
+	if (ret)
+		goto err_unref;
+
+	ret = drm_dev_register(drm, 0);
+	if (ret)
+		goto err_unload;
+
+	ret = drm_connector_register_all(drm);
+	if (ret)
+		goto err_unregister;
+
+	return 0;
+
+err_unregister:
+	drm_dev_unregister(drm);
+
+err_unload:
+	arcpgu_unload(drm);
+
+err_unref:
+	drm_dev_unref(drm);
+
+	return ret;
+}
+
+static int arcpgu_remove(struct platform_device *pdev)
+{
+	struct drm_device *drm = platform_get_drvdata(pdev);
+
+	drm_connector_unregister_all(drm);
+	drm_dev_unregister(drm);
+	arcpgu_unload(drm);
+	drm_dev_unref(drm);
+
+	return 0;
+}
+
+static const struct of_device_id arcpgu_of_table[] = {
+	{.compatible = "snps,arcpgu"},
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, arcpgu_of_table);
+
+static struct platform_driver arcpgu_platform_driver = {
+	.probe = arcpgu_probe,
+	.remove = arcpgu_remove,
+	.driver = {
+		   .name = "arcpgu",
+		   .of_match_table = arcpgu_of_table,
+		   },
+};
+
+module_platform_driver(arcpgu_platform_driver);
+
+MODULE_AUTHOR("Carlos Palminha <palminha@synopsys.com>");
+MODULE_DESCRIPTION("ARC PGU DRM driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c
new file mode 100644
index 0000000..08b6bae
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c
@@ -0,0 +1,201 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_encoder_slave.h>
+#include <drm/drm_atomic_helper.h>
+
+#include "arcpgu.h"
+
+struct arcpgu_drm_connector {
+	struct drm_connector connector;
+	struct drm_encoder_slave *encoder_slave;
+};
+
+static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
+{
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_get_modes: cannot find slave encoder for connector\n");
+		return 0;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs->get_modes == NULL)
+		return 0;
+
+	return sfuncs->get_modes(&slave->base, connector);
+}
+
+struct drm_encoder *
+arcpgu_drm_connector_best_encoder(struct drm_connector *connector)
+{
+	struct drm_encoder_slave *slave;
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_best_encoder: cannot find slave encoder for connector\n");
+		return NULL;
+	}
+
+	return &slave->base;
+}
+
+static enum drm_connector_status
+arcpgu_drm_connector_detect(struct drm_connector *connector, bool force)
+{
+	enum drm_connector_status status = connector_status_unknown;
+	const struct drm_encoder_slave_funcs *sfuncs;
+	struct drm_encoder_slave *slave;
+
+	struct arcpgu_drm_connector *con =
+		container_of(connector, struct arcpgu_drm_connector, connector);
+
+	slave = con->encoder_slave;
+	if (slave == NULL) {
+		dev_err(connector->dev->dev,
+			"connector_detect: cannot find slave encoder for connector\n");
+		return status;
+	}
+
+	sfuncs = slave->slave_funcs;
+	if (sfuncs && sfuncs->detect)
+		return sfuncs->detect(&slave->base, connector);
+
+	dev_err(connector->dev->dev, "connector_detect: could not detect slave funcs\n");
+	return status;
+}
+
+static void arcpgu_drm_connector_destroy(struct drm_connector *connector)
+{
+	drm_connector_unregister(connector);
+	drm_connector_cleanup(connector);
+}
+
+static const struct drm_connector_helper_funcs
+arcpgu_drm_connector_helper_funcs = {
+	.get_modes = arcpgu_drm_connector_get_modes,
+	.best_encoder = arcpgu_drm_connector_best_encoder,
+};
+
+static const struct drm_connector_funcs arcpgu_drm_connector_funcs = {
+	.dpms = drm_helper_connector_dpms,
+	.reset = drm_atomic_helper_connector_reset,
+	.detect = arcpgu_drm_connector_detect,
+	.fill_modes = drm_helper_probe_single_connector_modes,
+	.destroy = arcpgu_drm_connector_destroy,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+};
+
+static struct drm_encoder_helper_funcs arcpgu_drm_encoder_helper_funcs = {
+	.dpms = drm_i2c_encoder_dpms,
+	.mode_fixup = drm_i2c_encoder_mode_fixup,
+	.mode_set = drm_i2c_encoder_mode_set,
+	.prepare = drm_i2c_encoder_prepare,
+	.commit = drm_i2c_encoder_commit,
+	.detect = drm_i2c_encoder_detect,
+};
+
+static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
+int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
+{
+	struct arcpgu_drm_connector *arcpgu_connector;
+	struct drm_i2c_encoder_driver *driver;
+	struct drm_encoder_slave *encoder;
+	struct drm_connector *connector;
+	struct i2c_client *i2c_slave;
+	int ret;
+
+	encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
+	if (encoder == NULL)
+		return -ENOMEM;
+
+	i2c_slave = of_find_i2c_device_by_node(np);
+	if (!i2c_slave || !i2c_get_clientdata(i2c_slave)) {
+		dev_err(drm->dev, "failed to find i2c slave encoder\n");
+		return -EPROBE_DEFER;
+	}
+
+	if (i2c_slave->dev.driver == NULL) {
+		dev_err(drm->dev, "failed to find i2c slave driver\n");
+		return -EPROBE_DEFER;
+	}
+
+	driver =
+	    to_drm_i2c_encoder_driver(to_i2c_driver(i2c_slave->dev.driver));
+	ret = driver->encoder_init(i2c_slave, drm, encoder);
+	if (ret) {
+		dev_err(drm->dev, "failed to initialize i2c encoder slave\n");
+		return ret;
+	}
+
+	encoder->base.possible_crtcs = 1;
+	encoder->base.possible_clones = 0;
+	ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
+			       DRM_MODE_ENCODER_TMDS, NULL);
+	if (ret)
+		return ret;
+
+	drm_encoder_helper_add(&encoder->base,
+			       &arcpgu_drm_encoder_helper_funcs);
+
+	arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector),
+					GFP_KERNEL);
+	if (!arcpgu_connector) {
+		ret = -ENOMEM;
+		goto error_encoder_cleanup;
+	}
+
+	connector = &arcpgu_connector->connector;
+	drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
+	ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,
+			DRM_MODE_CONNECTOR_HDMIA);
+	if (ret < 0) {
+		dev_err(drm->dev, "failed to initialize drm connector\n");
+		goto error_encoder_cleanup;
+	}
+
+	ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
+	if (ret < 0) {
+		dev_err(drm->dev, "could not attach connector to encoder\n");
+		drm_connector_unregister(connector);
+		goto error_connector_cleanup;
+	}
+
+	arcpgu_connector->encoder_slave = encoder;
+
+	return 0;
+
+error_connector_cleanup:
+	drm_connector_cleanup(connector);
+
+error_encoder_cleanup:
+	drm_encoder_cleanup(&encoder->base);
+	return ret;
+}
diff --git a/drivers/gpu/drm/arc/arcpgu_regs.h b/drivers/gpu/drm/arc/arcpgu_regs.h
new file mode 100644
index 0000000..95a13a8
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_regs.h
@@ -0,0 +1,40 @@
+/*
+ * ARC PGU DRM driver.
+ *
+ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef _ARC_PGU_REGS_H_
+#define _ARC_PGU_REGS_H_
+
+#define ARCPGU_REG_CTRL		0x00
+#define ARCPGU_REG_STAT		0x04
+#define ARCPGU_REG_FMT		0x10
+#define ARCPGU_REG_HSYNC	0x14
+#define ARCPGU_REG_VSYNC	0x18
+#define ARCPGU_REG_ACTIVE	0x1c
+#define ARCPGU_REG_BUF0_ADDR	0x40
+#define ARCPGU_REG_STRIDE	0x50
+#define ARCPGU_REG_START_SET	0x84
+
+#define ARCPGU_REG_ID		0x3FC
+
+#define ARCPGU_CTRL_ENABLE_MASK	0x02
+#define ARCPGU_CTRL_VS_POL_MASK	0x1
+#define ARCPGU_CTRL_VS_POL_OFST	0x3
+#define ARCPGU_CTRL_HS_POL_MASK	0x1
+#define ARCPGU_CTRL_HS_POL_OFST	0x4
+#define ARCPGU_MODE_RGB888_MASK	0x04
+#define ARCPGU_STAT_BUSY_MASK	0x02
+
+#endif
-- 
2.5.5

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

* [PATCH 2/4 v6] drm: Add DT bindings documentation for ARC PGU display controller
  2016-04-19 13:19 ` Alexey Brodkin
@ 2016-04-19 13:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, Alexey Brodkin, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, devicetree, linux-snps-arc

This add DT bindings documentation for ARC PGU display controller.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Acked-by: Rob Herring <robh@kernel.org>
---

No changes v5 -> v6.

Changes v4 -> v5: (addressing Rob's comment)
 * Added Rob's acked-by
 * Remove "encoder-slave" from the example as well.
   Now only "pgu" node is mentioned in the example.

Changes v3 -> v4: (addressing Rob's comments)
 * Removed "encoder-slave" from required properties
 * Removed "0x" from node names

Changes v2 -> v3:
 * Reverted back to initial larger version of example
   with minor fixes (thanks Rob for spotting those).

Changes v1 -> v2:
 * Removed everything except PGU node itself.

 .../devicetree/bindings/display/snps,arcpgu.txt    | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt

diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
new file mode 100644
index 0000000..c5c7dfd
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
@@ -0,0 +1,35 @@
+ARC PGU
+
+This is a display controller found on several development boards produced
+by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
+framebuffer and sends it to a single digital encoder (usually HDMI).
+
+Required properties:
+  - compatible: "snps,arcpgu"
+  - reg: Physical base address and length of the controller's registers.
+  - clocks: A list of phandle + clock-specifier pairs, one for each
+    entry in 'clock-names'.
+  - clock-names: A list of clock names. For ARC PGU it should contain:
+      - "pxlclk" for the clock feeding the output PLL of the controller.
+
+Required sub-nodes:
+  - port: The PGU connection to an encoder chip.
+
+Example:
+
+/ {
+	...
+
+	pgu@XXXXXXXX {
+		compatible = "snps,arcpgu";
+		reg = <0xXXXXXXXX 0x400>;
+		clocks = <&clock_node>;
+		clock-names = "pxlclk";
+
+		port {
+			pgu_output: endpoint {
+				remote-endpoint = <&hdmi_enc_input>;
+			};
+		};
+	};
+};
-- 
2.5.5

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

* [PATCH 2/4 v6] drm: Add DT bindings documentation for ARC PGU display controller
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: linux-snps-arc

This add DT bindings documentation for ARC PGU display controller.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Pawel Moll <pawel.moll at arm.com>
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Ian Campbell <ijc+devicetree at hellion.org.uk>
Cc: Kumar Gala <galak at codeaurora.org>
Cc: devicetree at vger.kernel.org
Cc: linux-snps-arc at lists.infradead.org
Acked-by: Rob Herring <robh at kernel.org>
---

No changes v5 -> v6.

Changes v4 -> v5: (addressing Rob's comment)
 * Added Rob's acked-by
 * Remove "encoder-slave" from the example as well.
   Now only "pgu" node is mentioned in the example.

Changes v3 -> v4: (addressing Rob's comments)
 * Removed "encoder-slave" from required properties
 * Removed "0x" from node names

Changes v2 -> v3:
 * Reverted back to initial larger version of example
   with minor fixes (thanks Rob for spotting those).

Changes v1 -> v2:
 * Removed everything except PGU node itself.

 .../devicetree/bindings/display/snps,arcpgu.txt    | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt

diff --git a/Documentation/devicetree/bindings/display/snps,arcpgu.txt b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
new file mode 100644
index 0000000..c5c7dfd
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/snps,arcpgu.txt
@@ -0,0 +1,35 @@
+ARC PGU
+
+This is a display controller found on several development boards produced
+by Synopsys. The ARC PGU is an RGB streamer that reads the data from a
+framebuffer and sends it to a single digital encoder (usually HDMI).
+
+Required properties:
+  - compatible: "snps,arcpgu"
+  - reg: Physical base address and length of the controller's registers.
+  - clocks: A list of phandle + clock-specifier pairs, one for each
+    entry in 'clock-names'.
+  - clock-names: A list of clock names. For ARC PGU it should contain:
+      - "pxlclk" for the clock feeding the output PLL of the controller.
+
+Required sub-nodes:
+  - port: The PGU connection to an encoder chip.
+
+Example:
+
+/ {
+	...
+
+	pgu at XXXXXXXX {
+		compatible = "snps,arcpgu";
+		reg = <0xXXXXXXXX 0x400>;
+		clocks = <&clock_node>;
+		clock-names = "pxlclk";
+
+		port {
+			pgu_output: endpoint {
+				remote-endpoint = <&hdmi_enc_input>;
+			};
+		};
+	};
+};
-- 
2.5.5

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

* [PATCH 3/4 v6] MAINTAINERS: Add maintainer for ARC PGU display controller
  2016-04-19 13:19 ` Alexey Brodkin
  (?)
@ 2016-04-19 13:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, Alexey Brodkin, linux-snps-arc

This updates MAINTEINERS file with information about maintainer of
ARC PGU display controller driver.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
---

No changes v5 -> v6.

No changes v4 -> v5.

No changes v3 -> v4.

No changes v2 -> v3.

No changes v1 -> v2.

 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1c32f8a..c5d1e6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -847,6 +847,12 @@ S:	Maintained
 F:	drivers/net/arcnet/
 F:	include/uapi/linux/if_arcnet.h
 
+ARC PGU DRM DRIVER
+M:	Alexey Brodkin <abrodkin@synopsys.com>
+S:	Supported
+F:	drivers/gpu/drm/arc/
+F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
+
 ARM HDLCD DRM DRIVER
 M:	Liviu Dudau <liviu.dudau@arm.com>
 S:	Supported
-- 
2.5.5

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

* [PATCH 3/4 v6] MAINTAINERS: Add maintainer for ARC PGU display controller
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: linux-snps-arc

This updates MAINTEINERS file with information about maintainer of
ARC PGU display controller driver.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: linux-snps-arc at lists.infradead.org
---

No changes v5 -> v6.

No changes v4 -> v5.

No changes v3 -> v4.

No changes v2 -> v3.

No changes v1 -> v2.

 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1c32f8a..c5d1e6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -847,6 +847,12 @@ S:	Maintained
 F:	drivers/net/arcnet/
 F:	include/uapi/linux/if_arcnet.h
 
+ARC PGU DRM DRIVER
+M:	Alexey Brodkin <abrodkin at synopsys.com>
+S:	Supported
+F:	drivers/gpu/drm/arc/
+F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
+
 ARM HDLCD DRM DRIVER
 M:	Liviu Dudau <liviu.dudau at arm.com>
 S:	Supported
-- 
2.5.5

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

* [PATCH 3/4 v6] MAINTAINERS: Add maintainer for ARC PGU display controller
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-snps-arc, Alexey Brodkin, linux-kernel

This updates MAINTEINERS file with information about maintainer of
ARC PGU display controller driver.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
---

No changes v5 -> v6.

No changes v4 -> v5.

No changes v3 -> v4.

No changes v2 -> v3.

No changes v1 -> v2.

 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1c32f8a..c5d1e6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -847,6 +847,12 @@ S:	Maintained
 F:	drivers/net/arcnet/
 F:	include/uapi/linux/if_arcnet.h
 
+ARC PGU DRM DRIVER
+M:	Alexey Brodkin <abrodkin@synopsys.com>
+S:	Supported
+F:	drivers/gpu/drm/arc/
+F:	Documentation/devicetree/bindings/display/snps,arcpgu.txt
+
 ARM HDLCD DRM DRIVER
 M:	Liviu Dudau <liviu.dudau@arm.com>
 S:	Supported
-- 
2.5.5

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

* [PATCH 4/4 v6] arc: axs10x - add support of ARC PGU
  2016-04-19 13:19 ` Alexey Brodkin
@ 2016-04-19 13:19   ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: dri-devel
  Cc: linux-kernel, Alexey Brodkin, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala, Vineet Gupta, devicetree,
	linux-snps-arc

Synopsys DesignWare ARC SDP boards sport ARC SDP display
controller attached to ADV7511 HDMI encoder.

That change adds desctiption of both ARC PGU and ADV7511 in
ARC SDP'd base-board Device Tree.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: devicetree@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
---

No changes v5 -> v6.

No changes v4 -> v5.

Changes v3 -> v4:
 * Removed "0x" from node names (as suggested by Rob)

No changes v2 -> v3.

Changes v1 -> v2:
 * Added missing "pxlclk" clock in axs10x_mb.dtsi

 arch/arc/boot/dts/axs10x_mb.dtsi | 61 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index ab5d570..823f15c 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -34,6 +34,12 @@
 				clock-frequency = <50000000>;
 				#clock-cells = <0>;
 			};
+
+			pguclk: pguclk {
+				#clock-cells = <0>;
+				compatible = "fixed-clock";
+				clock-frequency = <74440000>;
+			};
 		};
 
 		ethernet@0x18000 {
@@ -155,6 +161,37 @@
 			clocks = <&i2cclk>;
 			interrupts = <16>;
 
+			adv7511:adv7511@39{
+				compatible="adi,adv7511";
+				reg = <0x39>;
+				interrupts = <23>;
+				adi,input-depth = <8>;
+				adi,input-colorspace = "rgb";
+				adi,input-clock = "1x";
+				adi,clock-delay = <0x03>;
+
+				ports {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					/* RGB/YUV input */
+					port@0 {
+						reg = <0>;
+						adv7511_input:endpoint {
+						remote-endpoint = <&pgu_output>;
+						};
+					};
+
+					/* HDMI output */
+					port@1 {
+						reg = <1>;
+						adv7511_output: endpoint {
+							remote-endpoint = <&hdmi_connector_in>;
+						};
+					};
+				};
+			};
+
 			eeprom@0x54{
 				compatible = "24c01";
 				reg = <0x54>;
@@ -168,6 +205,16 @@
 			};
 		};
 
+		hdmi0: connector {
+			compatible = "hdmi-connector";
+			type = "a";
+			port {
+				hdmi_connector_in: endpoint {
+					remote-endpoint = <&adv7511_output>;
+				};
+			};
+		};
+
 		gpio0:gpio@13000 {
 			compatible = "snps,dw-apb-gpio";
 			reg = <0x13000 0x1000>;
@@ -229,5 +276,19 @@
 				reg = <2>;
 			};
 		};
+
+		pgu@17000 {
+			compatible = "snps,arcpgu";
+			reg = <0x17000 0x400>;
+			encoder-slave = <&adv7511>;
+			clocks = <&pguclk>;
+			clock-names = "pxlclk";
+
+			port {
+				pgu_output: endpoint {
+					remote-endpoint = <&adv7511_input>;
+				};
+			};
+		};
 	};
 };
-- 
2.5.5

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

* [PATCH 4/4 v6] arc: axs10x - add support of ARC PGU
@ 2016-04-19 13:19   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-19 13:19 UTC (permalink / raw)
  To: linux-snps-arc

Synopsys DesignWare ARC SDP boards sport ARC SDP display
controller attached to ADV7511 HDMI encoder.

That change adds desctiption of both ARC PGU and ADV7511 in
ARC SDP'd base-board Device Tree.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Rob Herring <robh+dt at kernel.org>
Cc: Pawel Moll <pawel.moll at arm.com>
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Ian Campbell <ijc+devicetree at hellion.org.uk>
Cc: Kumar Gala <galak at codeaurora.org>
Cc: Vineet Gupta <vgupta at synopsys.com>
Cc: devicetree at vger.kernel.org
Cc: linux-snps-arc at lists.infradead.org
---

No changes v5 -> v6.

No changes v4 -> v5.

Changes v3 -> v4:
 * Removed "0x" from node names (as suggested by Rob)

No changes v2 -> v3.

Changes v1 -> v2:
 * Added missing "pxlclk" clock in axs10x_mb.dtsi

 arch/arc/boot/dts/axs10x_mb.dtsi | 61 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
index ab5d570..823f15c 100644
--- a/arch/arc/boot/dts/axs10x_mb.dtsi
+++ b/arch/arc/boot/dts/axs10x_mb.dtsi
@@ -34,6 +34,12 @@
 				clock-frequency = <50000000>;
 				#clock-cells = <0>;
 			};
+
+			pguclk: pguclk {
+				#clock-cells = <0>;
+				compatible = "fixed-clock";
+				clock-frequency = <74440000>;
+			};
 		};
 
 		ethernet at 0x18000 {
@@ -155,6 +161,37 @@
 			clocks = <&i2cclk>;
 			interrupts = <16>;
 
+			adv7511:adv7511 at 39{
+				compatible="adi,adv7511";
+				reg = <0x39>;
+				interrupts = <23>;
+				adi,input-depth = <8>;
+				adi,input-colorspace = "rgb";
+				adi,input-clock = "1x";
+				adi,clock-delay = <0x03>;
+
+				ports {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					/* RGB/YUV input */
+					port at 0 {
+						reg = <0>;
+						adv7511_input:endpoint {
+						remote-endpoint = <&pgu_output>;
+						};
+					};
+
+					/* HDMI output */
+					port at 1 {
+						reg = <1>;
+						adv7511_output: endpoint {
+							remote-endpoint = <&hdmi_connector_in>;
+						};
+					};
+				};
+			};
+
 			eeprom at 0x54{
 				compatible = "24c01";
 				reg = <0x54>;
@@ -168,6 +205,16 @@
 			};
 		};
 
+		hdmi0: connector {
+			compatible = "hdmi-connector";
+			type = "a";
+			port {
+				hdmi_connector_in: endpoint {
+					remote-endpoint = <&adv7511_output>;
+				};
+			};
+		};
+
 		gpio0:gpio at 13000 {
 			compatible = "snps,dw-apb-gpio";
 			reg = <0x13000 0x1000>;
@@ -229,5 +276,19 @@
 				reg = <2>;
 			};
 		};
+
+		pgu at 17000 {
+			compatible = "snps,arcpgu";
+			reg = <0x17000 0x400>;
+			encoder-slave = <&adv7511>;
+			clocks = <&pguclk>;
+			clock-names = "pxlclk";
+
+			port {
+				pgu_output: endpoint {
+					remote-endpoint = <&adv7511_input>;
+				};
+			};
+		};
 	};
 };
-- 
2.5.5

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

* Re: [PATCH 0/4 v6] drm: Add support of ARC PGU display controller
  2016-04-19 13:19 ` Alexey Brodkin
  (?)
@ 2016-04-22 14:53   ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-22 14:53 UTC (permalink / raw)
  To: airlied
  Cc: linux-kernel, robh+dt, pawel.moll, Carlos Palminha, devicetree,
	Jose Abreu, linux-snps-arc, daniel, mark.rutland, galak,
	ijc+devicetree, dri-devel, Vineet Gupta

Hi David,

On Tue, 2016-04-19 at 16:19 +0300, Alexey Brodkin wrote:
> This series add support of ARC PGU display controller.
> ARC PGU is a quite simple byte streamer that gets data from the framebuffer
> and pushes it to hte connected encoder (DP or HDMI).
> 
> It was tested on ARC SDP boards (axs101/103 in particular).
> 
> Note following series (v6) that introduces drm_connector_register_all()
> is a prerequisite now: https://lkml.org/lkml/2016/4/19/299
> 
> Changes v5 -> v6:
>  * "arc: Add our own implementation of fb_pgprotect()" was already applied to
>    ARC's tree and available in linux-next:
>    http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e5e0a65cd20a7a892a87e6bd73bdc3d83726d725
> 
> Changes v4 -> v5:
>  * Removed encode node from DT bindings example (as suggested by Rob)
> 
> Changes v3 -> v4:
>  * Main driver author is now set properly (thanks Carlos for all your efforts)
>  * Implemented correct hsync and vsync setup (thanks Jose)
>  * Dummy call-backs were removed (as suggested by Daniel)
>  * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
>  * With above in mind we were able to adopt recently introduced
>    drm_connector_register_all()/drm_connector_unregister_all()
>  * Implemented setup of properties (uncached) for FB user-pages
>  * Minor clean-up in DT binding docs and axs10x_mb.dtsi
> 
> Changes v2 -> v3:
>  * Improved failure path if arcpgu_connector wasn't allocated.
>  * Fixed driver building as module.
>  * Implemented uncached mapping of user-space FB pages.
>  * Again updated DT bindings docs.
> 
> Changes v1 -> v2:
>  * Clean-up of DT bindings documentation.
>  * Added missing "pxlclk" clock in axs10x_mb.dtsi.

That's my first submission of a DRM driver and I'm wondering
which tree/branch should I use as a reference to rebase my
patches and send you a pull request?

Especially given there's a prerequisite which is still only in
linux-next: http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=54d2c2da0946368b96b63e6daed7920f3
681243e

Regards,
Alexey

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

* Re: [PATCH 0/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-22 14:53   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-22 14:53 UTC (permalink / raw)
  To: airlied
  Cc: linux-kernel, robh+dt, pawel.moll, Carlos Palminha, devicetree,
	Jose Abreu, linux-snps-arc, daniel, mark.rutland, galak,
	ijc+devicetree, dri-devel, Vineet Gupta

Hi David,

On Tue, 2016-04-19 at 16:19 +0300, Alexey Brodkin wrote:
> This series add support of ARC PGU display controller.
> ARC PGU is a quite simple byte streamer that gets data from the framebuffer
> and pushes it to hte connected encoder (DP or HDMI).
> 
> It was tested on ARC SDP boards (axs101/103 in particular).
> 
> Note following series (v6) that introduces drm_connector_register_all()
> is a prerequisite now: https://lkml.org/lkml/2016/4/19/299
> 
> Changes v5 -> v6:
>  * "arc: Add our own implementation of fb_pgprotect()" was already applied to
>    ARC's tree and available in linux-next:
>    http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e5e0a65cd20a7a892a87e6bd73bdc3d83726d725
> 
> Changes v4 -> v5:
>  * Removed encode node from DT bindings example (as suggested by Rob)
> 
> Changes v3 -> v4:
>  * Main driver author is now set properly (thanks Carlos for all your efforts)
>  * Implemented correct hsync and vsync setup (thanks Jose)
>  * Dummy call-backs were removed (as suggested by Daniel)
>  * Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
>  * With above in mind we were able to adopt recently introduced
>    drm_connector_register_all()/drm_connector_unregister_all()
>  * Implemented setup of properties (uncached) for FB user-pages
>  * Minor clean-up in DT binding docs and axs10x_mb.dtsi
> 
> Changes v2 -> v3:
>  * Improved failure path if arcpgu_connector wasn't allocated.
>  * Fixed driver building as module.
>  * Implemented uncached mapping of user-space FB pages.
>  * Again updated DT bindings docs.
> 
> Changes v1 -> v2:
>  * Clean-up of DT bindings documentation.
>  * Added missing "pxlclk" clock in axs10x_mb.dtsi.

That's my first submission of a DRM driver and I'm wondering
which tree/branch should I use as a reference to rebase my
patches and send you a pull request?

Especially given there's a prerequisite which is still only in
linux-next: http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=54d2c2da0946368b96b63e6daed7920f3
681243e

Regards,
Alexey

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

* [PATCH 0/4 v6] drm: Add support of ARC PGU display controller
@ 2016-04-22 14:53   ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-22 14:53 UTC (permalink / raw)
  To: linux-snps-arc

Hi David,

On Tue, 2016-04-19@16:19 +0300, Alexey Brodkin wrote:
> This series add support of ARC PGU display controller.
> ARC PGU is a quite simple byte streamer that gets data from the framebuffer
> and pushes it to hte connected encoder (DP or HDMI).
> 
> It was tested on ARC SDP boards (axs101/103 in particular).
> 
> Note following series (v6) that introduces drm_connector_register_all()
> is a prerequisite now: https://lkml.org/lkml/2016/4/19/299
> 
> Changes v5 -> v6:
> ?* "arc: Add our own implementation of fb_pgprotect()" was already applied to
> ???ARC's tree and available in linux-next:
> ???http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=e5e0a65cd20a7a892a87e6bd73bdc3d83726d725
> 
> Changes v4 -> v5:
> ?* Removed encode node from DT bindings example (as suggested by Rob)
> 
> Changes v3 -> v4:
> ?* Main driver author is now set properly (thanks Carlos for all your efforts)
> ?* Implemented correct hsync and vsync setup (thanks Jose)
> ?* Dummy call-backs were removed (as suggested by Daniel)
> ?* Obsolete load()/unload() call-backs were removed (as suggested by Daniel)
> ?* With above in mind we were able to adopt recently introduced
> ???drm_connector_register_all()/drm_connector_unregister_all()
> ?* Implemented setup of properties (uncached) for FB user-pages
> ?* Minor clean-up in DT binding docs and axs10x_mb.dtsi
> 
> Changes v2 -> v3:
> ?* Improved failure path if arcpgu_connector wasn't allocated.
> ?* Fixed driver building as module.
> ?* Implemented uncached mapping of user-space FB pages.
> ?* Again updated DT bindings docs.
> 
> Changes v1 -> v2:
> ?* Clean-up of DT bindings documentation.
> ?* Added missing "pxlclk" clock in axs10x_mb.dtsi.

That's my first submission of a DRM driver and I'm wondering
which tree/branch should I use as a reference to rebase my
patches and send you a pull request?

Especially given there's a prerequisite which is still only in
linux-next:?http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=54d2c2da0946368b96b63e6daed7920f3
681243e

Regards,
Alexey

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

* [GIT PULL] drm: Add support of ARC PGU display controller
  2016-04-22 14:53   ` Alexey Brodkin
  (?)
@ 2016-04-26 15:28     ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-26 15:28 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, daniel, linux-snps-arc, airlied

Hi Dave,

This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

Those sources are from v6 series floated to mailing list here
https://lists.freedesktop.org/archives/dri-devel/2016-April/105156.html

and based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit 027b3f8ba9277410c3191d72d1ed2c6146d8a668:

  drm/modes: stop handling framebuffer special (2016-04-22 10:47:16 +1000)

are available in the git repository at:

  https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-v6

for you to fetch changes up to b8c1eca1e089e8f4247b19b73955c875bf7b18ae:

  arc: axs10x - add support of ARC PGU (2016-04-26 18:26:54 +0300)

----------------------------------------------------------------
Alexey Brodkin (3):
      drm: Add DT bindings documentation for ARC PGU display controller
      MAINTAINERS: Add maintainer for ARC PGU display controller
      arc: axs10x - add support of ARC PGU

Carlos Palminha (1):
      drm: Add support of ARC PGU display controller

 Documentation/devicetree/bindings/display/snps,arcpgu.txt |  35 +++++++
 MAINTAINERS                                               |   6 ++
 arch/arc/boot/dts/axs10x_mb.dtsi                          |  61 ++++++++++++
 drivers/gpu/drm/Kconfig                                   |   2 +
 drivers/gpu/drm/Makefile                                  |   1 +
 drivers/gpu/drm/arc/Kconfig                               |  10 ++
 drivers/gpu/drm/arc/Makefile                              |   2 +
 drivers/gpu/drm/arc/arcpgu.h                              |  50 ++++++++++
 drivers/gpu/drm/arc/arcpgu_crtc.c                         | 257 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c                          | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c                         | 201 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h                         |  40 ++++++++
 12 files changed, 947 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

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

* [GIT PULL] drm: Add support of ARC PGU display controller
@ 2016-04-26 15:28     ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-26 15:28 UTC (permalink / raw)
  To: linux-snps-arc

Hi Dave,

This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

Those sources are from v6 series floated to mailing list here
https://lists.freedesktop.org/archives/dri-devel/2016-April/105156.html

and based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit 027b3f8ba9277410c3191d72d1ed2c6146d8a668:

? drm/modes: stop handling framebuffer special (2016-04-22 10:47:16 +1000)

are available in the git repository at:

? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-v6

for you to fetch changes up to b8c1eca1e089e8f4247b19b73955c875bf7b18ae:

? arc: axs10x - add support of ARC PGU (2016-04-26 18:26:54 +0300)

----------------------------------------------------------------
Alexey Brodkin (3):
??????drm: Add DT bindings documentation for ARC PGU display controller
??????MAINTAINERS: Add maintainer for ARC PGU display controller
??????arc: axs10x - add support of ARC PGU

Carlos Palminha (1):
??????drm: Add support of ARC PGU display controller

?Documentation/devicetree/bindings/display/snps,arcpgu.txt |??35 +++++++
?MAINTAINERS???????????????????????????????????????????????|???6 ++
?arch/arc/boot/dts/axs10x_mb.dtsi??????????????????????????|??61 ++++++++++++
?drivers/gpu/drm/Kconfig???????????????????????????????????|???2 +
?drivers/gpu/drm/Makefile??????????????????????????????????|???1 +
?drivers/gpu/drm/arc/Kconfig???????????????????????????????|??10 ++
?drivers/gpu/drm/arc/Makefile??????????????????????????????|???2 +
?drivers/gpu/drm/arc/arcpgu.h??????????????????????????????|??50 ++++++++++
?drivers/gpu/drm/arc/arcpgu_crtc.c?????????????????????????| 257 +++++++++++++++++++++++++++++++++++++++++++++++
?drivers/gpu/drm/arc/arcpgu_drv.c??????????????????????????| 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++
?drivers/gpu/drm/arc/arcpgu_hdmi.c?????????????????????????| 201 +++++++++++++++++++++++++++++++++++++
?drivers/gpu/drm/arc/arcpgu_regs.h?????????????????????????|??40 ++++++++
?12 files changed, 947 insertions(+)
?create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
?create mode 100644 drivers/gpu/drm/arc/Kconfig
?create mode 100644 drivers/gpu/drm/arc/Makefile
?create mode 100644 drivers/gpu/drm/arc/arcpgu.h
?create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
?create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
?create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
?create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

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

* [GIT PULL] drm: Add support of ARC PGU display controller
@ 2016-04-26 15:28     ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-26 15:28 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, daniel, linux-snps-arc, airlied

Hi Dave,

This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

Those sources are from v6 series floated to mailing list here
https://lists.freedesktop.org/archives/dri-devel/2016-April/105156.html

and based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit 027b3f8ba9277410c3191d72d1ed2c6146d8a668:

  drm/modes: stop handling framebuffer special (2016-04-22 10:47:16 +1000)

are available in the git repository at:

  https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-v6

for you to fetch changes up to b8c1eca1e089e8f4247b19b73955c875bf7b18ae:

  arc: axs10x - add support of ARC PGU (2016-04-26 18:26:54 +0300)

----------------------------------------------------------------
Alexey Brodkin (3):
      drm: Add DT bindings documentation for ARC PGU display controller
      MAINTAINERS: Add maintainer for ARC PGU display controller
      arc: axs10x - add support of ARC PGU

Carlos Palminha (1):
      drm: Add support of ARC PGU display controller

 Documentation/devicetree/bindings/display/snps,arcpgu.txt |  35 +++++++
 MAINTAINERS                                               |   6 ++
 arch/arc/boot/dts/axs10x_mb.dtsi                          |  61 ++++++++++++
 drivers/gpu/drm/Kconfig                                   |   2 +
 drivers/gpu/drm/Makefile                                  |   1 +
 drivers/gpu/drm/arc/Kconfig                               |  10 ++
 drivers/gpu/drm/arc/Makefile                              |   2 +
 drivers/gpu/drm/arc/arcpgu.h                              |  50 ++++++++++
 drivers/gpu/drm/arc/arcpgu_crtc.c                         | 257 +++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_drv.c                          | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_hdmi.c                         | 201 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/arc/arcpgu_regs.h                         |  40 ++++++++
 12 files changed, 947 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
 create mode 100644 drivers/gpu/drm/arc/Kconfig
 create mode 100644 drivers/gpu/drm/arc/Makefile
 create mode 100644 drivers/gpu/drm/arc/arcpgu.h
 create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c
 create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h

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

* Re: [GIT PULL] drm: Add support of ARC PGU display controller
  2016-04-26 15:28     ` Alexey Brodkin
  (?)
@ 2016-04-26 23:40       ` Dave Airlie
  -1 siblings, 0 replies; 39+ messages in thread
From: Dave Airlie @ 2016-04-26 23:40 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: airlied, dri-devel, linux-kernel, daniel, linux-snps-arc, airlied

On 27 April 2016 at 01:28, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
> Hi Dave,
>
> This is DRM driver for ARC PGU - simple bitstreamer used on
> Synopsys ARC SDP boards (both AXS101 and AXS103).

Hi Alexey,

I've pulled this tree into drm-next now, it seems to at least build here,

Thanks,
Dave.

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

* [GIT PULL] drm: Add support of ARC PGU display controller
@ 2016-04-26 23:40       ` Dave Airlie
  0 siblings, 0 replies; 39+ messages in thread
From: Dave Airlie @ 2016-04-26 23:40 UTC (permalink / raw)
  To: linux-snps-arc

On 27 April 2016@01:28, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
> Hi Dave,
>
> This is DRM driver for ARC PGU - simple bitstreamer used on
> Synopsys ARC SDP boards (both AXS101 and AXS103).

Hi Alexey,

I've pulled this tree into drm-next now, it seems to at least build here,

Thanks,
Dave.

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

* Re: [GIT PULL] drm: Add support of ARC PGU display controller
@ 2016-04-26 23:40       ` Dave Airlie
  0 siblings, 0 replies; 39+ messages in thread
From: Dave Airlie @ 2016-04-26 23:40 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: linux-kernel, dri-devel, airlied, linux-snps-arc

On 27 April 2016 at 01:28, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
> Hi Dave,
>
> This is DRM driver for ARC PGU - simple bitstreamer used on
> Synopsys ARC SDP boards (both AXS101 and AXS103).

Hi Alexey,

I've pulled this tree into drm-next now, it seems to at least build here,

Thanks,
Dave.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-04-26 15:28     ` Alexey Brodkin
  (?)
@ 2016-04-29 11:36       ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-29 11:36 UTC (permalink / raw)
  To: airlied; +Cc: daniel, linux-kernel, dri-devel, airlied, linux-snps-arc

Hi Dave,

Please pull this mini-series that allows ARC PGU to use
dedicated memory location as framebuffer backing storage.

v2 of that series was reviewed here
https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html

It is based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:

  Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)

are available in the git repository at:

  https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates

for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:

  ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)

----------------------------------------------------------------
Alexey Brodkin (2):
      drm/arcpgu: use dedicated memory area for frame buffer
      ARC: [axs10x] Specify reserved memory for frame buffer

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-04-29 11:36       ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-29 11:36 UTC (permalink / raw)
  To: linux-snps-arc

Hi Dave,

Please pull this mini-series that allows ARC PGU to use
dedicated memory location as framebuffer backing storage.

v2 of that series was reviewed here
https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html

It is based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:

? Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)

are available in the git repository at:

? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates

for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:

? ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)

----------------------------------------------------------------
Alexey Brodkin (2):
??????drm/arcpgu: use dedicated memory area for frame buffer
??????ARC: [axs10x] Specify reserved memory for frame buffer

?arch/arc/boot/dts/axc001.dtsi?????| 22 ++++++++++++++++++++--
?arch/arc/boot/dts/axc003.dtsi?????| 14 ++++++++++++++
?arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
?arch/arc/boot/dts/axs10x_mb.dtsi??|??2 +-
?drivers/gpu/drm/arc/arcpgu_drv.c??|??6 ++++++
?5 files changed, 55 insertions(+), 3 deletions(-)

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-04-29 11:36       ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-04-29 11:36 UTC (permalink / raw)
  To: airlied; +Cc: daniel, linux-kernel, dri-devel, airlied, linux-snps-arc

Hi Dave,

Please pull this mini-series that allows ARC PGU to use
dedicated memory location as framebuffer backing storage.

v2 of that series was reviewed here
https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html

It is based on top of today's drm-next branch.

Best regards,
Alexey

The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:

  Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)

are available in the git repository at:

  https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates

for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:

  ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)

----------------------------------------------------------------
Alexey Brodkin (2):
      drm/arcpgu: use dedicated memory area for frame buffer
      ARC: [axs10x] Specify reserved memory for frame buffer

 arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
 arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
 arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
 arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
 drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
 5 files changed, 55 insertions(+), 3 deletions(-)

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-04-29 11:36       ` Alexey Brodkin
  (?)
@ 2016-05-10  9:51         ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-10  9:51 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, daniel, airlied, linux-snps-arc

Hi Dave,

On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> Please pull this mini-series that allows ARC PGU to use
> dedicated memory location as framebuffer backing storage.
> 
> v2 of that series was reviewed here
> https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> 
> It is based on top of today's drm-next branch.
> 
> Best regards,
> Alexey
> 
> The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> 
>   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> 
> are available in the git repository at:
> 
>   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> 
> for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> 
>   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> 
> ----------------------------------------------------------------
> Alexey Brodkin (2):
>       drm/arcpgu: use dedicated memory area for frame buffer
>       ARC: [axs10x] Specify reserved memory for frame buffer
> 
>  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
>  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
>  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
>  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
>  5 files changed, 55 insertions(+), 3 deletions(-)

Could you please take a look at this pull request?

-Alexey

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-10  9:51         ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-10  9:51 UTC (permalink / raw)
  To: linux-snps-arc

Hi Dave,

On Fri, 2016-04-29@11:36 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> Please pull this mini-series that allows ARC PGU to use
> dedicated memory location as framebuffer backing storage.
> 
> v2 of that series was reviewed here
> https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> 
> It is based on top of today's drm-next branch.
> 
> Best regards,
> Alexey
> 
> The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> 
> ? Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> 
> are available in the git repository at:
> 
> ? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> 
> for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> 
> ? ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> 
> ----------------------------------------------------------------
> Alexey Brodkin (2):
> ??????drm/arcpgu: use dedicated memory area for frame buffer
> ??????ARC: [axs10x] Specify reserved memory for frame buffer
> 
> ?arch/arc/boot/dts/axc001.dtsi?????| 22 ++++++++++++++++++++--
> ?arch/arc/boot/dts/axc003.dtsi?????| 14 ++++++++++++++
> ?arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> ?arch/arc/boot/dts/axs10x_mb.dtsi??|??2 +-
> ?drivers/gpu/drm/arc/arcpgu_drv.c??|??6 ++++++
> ?5 files changed, 55 insertions(+), 3 deletions(-)

Could you please take a look at this pull request?

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-10  9:51         ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-10  9:51 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, daniel, airlied, linux-snps-arc

Hi Dave,

On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> Please pull this mini-series that allows ARC PGU to use
> dedicated memory location as framebuffer backing storage.
> 
> v2 of that series was reviewed here
> https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> 
> It is based on top of today's drm-next branch.
> 
> Best regards,
> Alexey
> 
> The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> 
>   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> 
> are available in the git repository at:
> 
>   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> 
> for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> 
>   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> 
> ----------------------------------------------------------------
> Alexey Brodkin (2):
>       drm/arcpgu: use dedicated memory area for frame buffer
>       ARC: [axs10x] Specify reserved memory for frame buffer
> 
>  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
>  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
>  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
>  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
>  5 files changed, 55 insertions(+), 3 deletions(-)

Could you please take a look at this pull request?

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-05-10  9:51         ` Alexey Brodkin
  (?)
@ 2016-05-16  8:22           ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-16  8:22 UTC (permalink / raw)
  To: airlied, daniel, airlied
  Cc: dri-devel, linux-kernel, Vineet Gupta, linux-snps-arc

Hi Dave,

On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > Please pull this mini-series that allows ARC PGU to use
> > dedicated memory location as framebuffer backing storage.
> > 
> > v2 of that series was reviewed here
> > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > 
> > It is based on top of today's drm-next branch.
> > 
> > Best regards,
> > Alexey
> > 
> > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > 
> >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > 
> > are available in the git repository at:
> > 
> >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > 
> > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > 
> >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > 
> > ----------------------------------------------------------------
> > Alexey Brodkin (2):
> >       drm/arcpgu: use dedicated memory area for frame buffer
> >       ARC: [axs10x] Specify reserved memory for frame buffer
> > 
> >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> >  5 files changed, 55 insertions(+), 3 deletions(-)
> Could you please take a look at this pull request?

Another polite reminder.

-Alexey

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-16  8:22           ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-16  8:22 UTC (permalink / raw)
  To: linux-snps-arc

Hi Dave,

On Tue, 2016-05-10@09:51 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Fri, 2016-04-29@11:36 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > Please pull this mini-series that allows ARC PGU to use
> > dedicated memory location as framebuffer backing storage.
> > 
> > v2 of that series was reviewed here
> > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > 
> > It is based on top of today's drm-next branch.
> > 
> > Best regards,
> > Alexey
> > 
> > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > 
> > ? Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > 
> > are available in the git repository at:
> > 
> > ? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > 
> > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > 
> > ? ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > 
> > ----------------------------------------------------------------
> > Alexey Brodkin (2):
> > ??????drm/arcpgu: use dedicated memory area for frame buffer
> > ??????ARC: [axs10x] Specify reserved memory for frame buffer
> > 
> > ?arch/arc/boot/dts/axc001.dtsi?????| 22 ++++++++++++++++++++--
> > ?arch/arc/boot/dts/axc003.dtsi?????| 14 ++++++++++++++
> > ?arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > ?arch/arc/boot/dts/axs10x_mb.dtsi??|??2 +-
> > ?drivers/gpu/drm/arc/arcpgu_drv.c??|??6 ++++++
> > ?5 files changed, 55 insertions(+), 3 deletions(-)
> Could you please take a look at this pull request?

Another polite reminder.

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-16  8:22           ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-16  8:22 UTC (permalink / raw)
  To: airlied, daniel, airlied
  Cc: dri-devel, linux-kernel, Vineet Gupta, linux-snps-arc

Hi Dave,

On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > Please pull this mini-series that allows ARC PGU to use
> > dedicated memory location as framebuffer backing storage.
> > 
> > v2 of that series was reviewed here
> > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > 
> > It is based on top of today's drm-next branch.
> > 
> > Best regards,
> > Alexey
> > 
> > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > 
> >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > 
> > are available in the git repository at:
> > 
> >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > 
> > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > 
> >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > 
> > ----------------------------------------------------------------
> > Alexey Brodkin (2):
> >       drm/arcpgu: use dedicated memory area for frame buffer
> >       ARC: [axs10x] Specify reserved memory for frame buffer
> > 
> >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> >  5 files changed, 55 insertions(+), 3 deletions(-)
> Could you please take a look at this pull request?

Another polite reminder.

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-05-16  8:22           ` Alexey Brodkin
  (?)
@ 2016-05-23 10:31             ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 10:31 UTC (permalink / raw)
  To: airlied, daniel, Vineet Gupta, airlied
  Cc: dri-devel, linux-kernel, linux-snps-arc

Hi Dave,

On Mon, 2016-05-16 at 08:22 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > > 
> > > 
> > > Hi Dave,
> > > 
> > > Please pull this mini-series that allows ARC PGU to use
> > > dedicated memory location as framebuffer backing storage.
> > > 
> > > v2 of that series was reviewed here
> > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > 
> > > It is based on top of today's drm-next branch.
> > > 
> > > Best regards,
> > > Alexey
> > > 
> > > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > 
> > >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > > 
> > > are available in the git repository at:
> > > 
> > >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > > 
> > > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > 
> > >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > > 
> > > ----------------------------------------------------------------
> > > Alexey Brodkin (2):
> > >       drm/arcpgu: use dedicated memory area for frame buffer
> > >       ARC: [axs10x] Specify reserved memory for frame buffer
> > > 
> > >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> > >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> > >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> > >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> > >  5 files changed, 55 insertions(+), 3 deletions(-)
> > Could you please take a look at this pull request?
> Another polite reminder.

Could you please pull this one?
Indeed it was created quite some time ago so if required I may
rebase it on top of whatever current you'd like.

Alternatively you may just apply the first patch from the series
(could be found here https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
and the second patch will be picked up by ARC maintainer (Vineet Gupta).

-Alexey

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 10:31             ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 10:31 UTC (permalink / raw)
  To: linux-snps-arc

Hi Dave,

On Mon, 2016-05-16@08:22 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Tue, 2016-05-10@09:51 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > On Fri, 2016-04-29@11:36 +0000, Alexey Brodkin wrote:
> > > 
> > > 
> > > Hi Dave,
> > > 
> > > Please pull this mini-series that allows ARC PGU to use
> > > dedicated memory location as framebuffer backing storage.
> > > 
> > > v2 of that series was reviewed here
> > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > 
> > > It is based on top of today's drm-next branch.
> > > 
> > > Best regards,
> > > Alexey
> > > 
> > > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > 
> > > ? Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > > 
> > > are available in the git repository at:
> > > 
> > > ? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > > 
> > > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > 
> > > ? ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > > 
> > > ----------------------------------------------------------------
> > > Alexey Brodkin (2):
> > > ??????drm/arcpgu: use dedicated memory area for frame buffer
> > > ??????ARC: [axs10x] Specify reserved memory for frame buffer
> > > 
> > > ?arch/arc/boot/dts/axc001.dtsi?????| 22 ++++++++++++++++++++--
> > > ?arch/arc/boot/dts/axc003.dtsi?????| 14 ++++++++++++++
> > > ?arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > > ?arch/arc/boot/dts/axs10x_mb.dtsi??|??2 +-
> > > ?drivers/gpu/drm/arc/arcpgu_drv.c??|??6 ++++++
> > > ?5 files changed, 55 insertions(+), 3 deletions(-)
> > Could you please take a look at this pull request?
> Another polite reminder.

Could you please pull this one?
Indeed it was created quite some time ago so if required I may
rebase it on top of whatever current you'd like.

Alternatively you may just apply the first patch from the series
(could be found here?https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
and the second patch will be picked up by ARC maintainer (Vineet Gupta).

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 10:31             ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 10:31 UTC (permalink / raw)
  To: airlied, daniel, Vineet Gupta, airlied
  Cc: dri-devel, linux-kernel, linux-snps-arc

Hi Dave,

On Mon, 2016-05-16 at 08:22 +0000, Alexey Brodkin wrote:
> Hi Dave,
> 
> On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> > 
> > Hi Dave,
> > 
> > On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > > 
> > > 
> > > Hi Dave,
> > > 
> > > Please pull this mini-series that allows ARC PGU to use
> > > dedicated memory location as framebuffer backing storage.
> > > 
> > > v2 of that series was reviewed here
> > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > 
> > > It is based on top of today's drm-next branch.
> > > 
> > > Best regards,
> > > Alexey
> > > 
> > > The following changes since commit b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > 
> > >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu into drm-next (2016-04-29 14:57:51 +1000)
> > > 
> > > are available in the git repository at:
> > > 
> > >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git topic-arcpgu-updates
> > > 
> > > for you to fetch changes up to cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > 
> > >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29 14:34:13 +0300)
> > > 
> > > ----------------------------------------------------------------
> > > Alexey Brodkin (2):
> > >       drm/arcpgu: use dedicated memory area for frame buffer
> > >       ARC: [axs10x] Specify reserved memory for frame buffer
> > > 
> > >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> > >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> > >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> > >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> > >  5 files changed, 55 insertions(+), 3 deletions(-)
> > Could you please take a look at this pull request?
> Another polite reminder.

Could you please pull this one?
Indeed it was created quite some time ago so if required I may
rebase it on top of whatever current you'd like.

Alternatively you may just apply the first patch from the series
(could be found here https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
and the second patch will be picked up by ARC maintainer (Vineet Gupta).

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-05-23 10:31             ` Alexey Brodkin
  (?)
@ 2016-05-23 19:23               ` David Airlie
  -1 siblings, 0 replies; 39+ messages in thread
From: David Airlie @ 2016-05-23 19:23 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: daniel, Vineet Gupta, airlied, dri-devel, linux-kernel, linux-snps-arc




----- Original Message -----
> From: "Alexey Brodkin" <Alexey.Brodkin@synopsys.com>
> To: airlied@redhat.com, daniel@ffwll.ch, "Vineet Gupta" <Vineet.Gupta1@synopsys.com>, airlied@linux.ie
> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org
> Sent: Monday, 23 May, 2016 8:31:41 PM
> Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> 
> Hi Dave,
> 
> On Mon, 2016-05-16 at 08:22 +0000, Alexey Brodkin wrote:
> > Hi Dave,
> > 
> > On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> > > 
> > > Hi Dave,
> > > 
> > > On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > > > 
> > > > 
> > > > Hi Dave,
> > > > 
> > > > Please pull this mini-series that allows ARC PGU to use
> > > > dedicated memory location as framebuffer backing storage.
> > > > 
> > > > v2 of that series was reviewed here
> > > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > > 
> > > > It is based on top of today's drm-next branch.
> > > > 
> > > > Best regards,
> > > > Alexey
> > > > 
> > > > The following changes since commit
> > > > b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > > 
> > > >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu
> > > >   into drm-next (2016-04-29 14:57:51 +1000)
> > > > 
> > > > are available in the git repository at:
> > > > 
> > > >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git
> > > >   topic-arcpgu-updates
> > > > 
> > > > for you to fetch changes up to
> > > > cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > > 
> > > >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29
> > > >   14:34:13 +0300)
> > > > 
> > > > ----------------------------------------------------------------
> > > > Alexey Brodkin (2):
> > > >       drm/arcpgu: use dedicated memory area for frame buffer
> > > >       ARC: [axs10x] Specify reserved memory for frame buffer
> > > > 
> > > >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> > > >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> > > >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > > >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> > > >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> > > >  5 files changed, 55 insertions(+), 3 deletions(-)
> > > Could you please take a look at this pull request?
> > Another polite reminder.
> 
> Could you please pull this one?
> Indeed it was created quite some time ago so if required I may
> rebase it on top of whatever current you'd like.
> 
> Alternatively you may just apply the first patch from the series
> (could be found here
>  https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> and the second patch will be picked up by ARC maintainer (Vineet Gupta).

I thought I did pull this, please check drm-next.


Dave.

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 19:23               ` David Airlie
  0 siblings, 0 replies; 39+ messages in thread
From: David Airlie @ 2016-05-23 19:23 UTC (permalink / raw)
  To: linux-snps-arc




----- Original Message -----
> From: "Alexey Brodkin" <Alexey.Brodkin at synopsys.com>
> To: airlied at redhat.com, daniel at ffwll.ch, "Vineet Gupta" <Vineet.Gupta1 at synopsys.com>, airlied at linux.ie
> Cc: dri-devel at lists.freedesktop.org, linux-kernel at vger.kernel.org, linux-snps-arc at lists.infradead.org
> Sent: Monday, 23 May, 2016 8:31:41 PM
> Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> 
> Hi Dave,
> 
> On Mon, 2016-05-16@08:22 +0000, Alexey Brodkin wrote:
> > Hi Dave,
> > 
> > On Tue, 2016-05-10@09:51 +0000, Alexey Brodkin wrote:
> > > 
> > > Hi Dave,
> > > 
> > > On Fri, 2016-04-29@11:36 +0000, Alexey Brodkin wrote:
> > > > 
> > > > 
> > > > Hi Dave,
> > > > 
> > > > Please pull this mini-series that allows ARC PGU to use
> > > > dedicated memory location as framebuffer backing storage.
> > > > 
> > > > v2 of that series was reviewed here
> > > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > > 
> > > > It is based on top of today's drm-next branch.
> > > > 
> > > > Best regards,
> > > > Alexey
> > > > 
> > > > The following changes since commit
> > > > b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > > 
> > > > ? Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu
> > > > ? into drm-next (2016-04-29 14:57:51 +1000)
> > > > 
> > > > are available in the git repository at:
> > > > 
> > > > ? https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git
> > > > ? topic-arcpgu-updates
> > > > 
> > > > for you to fetch changes up to
> > > > cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > > 
> > > > ? ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29
> > > > ? 14:34:13 +0300)
> > > > 
> > > > ----------------------------------------------------------------
> > > > Alexey Brodkin (2):
> > > > ??????drm/arcpgu: use dedicated memory area for frame buffer
> > > > ??????ARC: [axs10x] Specify reserved memory for frame buffer
> > > > 
> > > > ?arch/arc/boot/dts/axc001.dtsi?????| 22 ++++++++++++++++++++--
> > > > ?arch/arc/boot/dts/axc003.dtsi?????| 14 ++++++++++++++
> > > > ?arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > > > ?arch/arc/boot/dts/axs10x_mb.dtsi??|??2 +-
> > > > ?drivers/gpu/drm/arc/arcpgu_drv.c??|??6 ++++++
> > > > ?5 files changed, 55 insertions(+), 3 deletions(-)
> > > Could you please take a look at this pull request?
> > Another polite reminder.
> 
> Could you please pull this one?
> Indeed it was created quite some time ago so if required I may
> rebase it on top of whatever current you'd like.
> 
> Alternatively you may just apply the first patch from the series
> (could be found here
> ?https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> and the second patch will be picked up by ARC maintainer (Vineet Gupta).

I thought I did pull this, please check drm-next.


Dave.

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 19:23               ` David Airlie
  0 siblings, 0 replies; 39+ messages in thread
From: David Airlie @ 2016-05-23 19:23 UTC (permalink / raw)
  To: Alexey Brodkin; +Cc: Vineet Gupta, linux-kernel, dri-devel, linux-snps-arc




----- Original Message -----
> From: "Alexey Brodkin" <Alexey.Brodkin@synopsys.com>
> To: airlied@redhat.com, daniel@ffwll.ch, "Vineet Gupta" <Vineet.Gupta1@synopsys.com>, airlied@linux.ie
> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org
> Sent: Monday, 23 May, 2016 8:31:41 PM
> Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> 
> Hi Dave,
> 
> On Mon, 2016-05-16 at 08:22 +0000, Alexey Brodkin wrote:
> > Hi Dave,
> > 
> > On Tue, 2016-05-10 at 09:51 +0000, Alexey Brodkin wrote:
> > > 
> > > Hi Dave,
> > > 
> > > On Fri, 2016-04-29 at 11:36 +0000, Alexey Brodkin wrote:
> > > > 
> > > > 
> > > > Hi Dave,
> > > > 
> > > > Please pull this mini-series that allows ARC PGU to use
> > > > dedicated memory location as framebuffer backing storage.
> > > > 
> > > > v2 of that series was reviewed here
> > > > https://lists.freedesktop.org/archives/dri-devel/2016-April/106279.html
> > > > 
> > > > It is based on top of today's drm-next branch.
> > > > 
> > > > Best regards,
> > > > Alexey
> > > > 
> > > > The following changes since commit
> > > > b89359bdf0f1e95a4c5f92300594ba9dde323fc4:
> > > > 
> > > >   Merge branch 'for-next' of http://git.agner.ch/git/linux-drm-fsl-dcu
> > > >   into drm-next (2016-04-29 14:57:51 +1000)
> > > > 
> > > > are available in the git repository at:
> > > > 
> > > >   https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git
> > > >   topic-arcpgu-updates
> > > > 
> > > > for you to fetch changes up to
> > > > cb2ad5e5339c5122166265cea579cc6a356d46de:
> > > > 
> > > >   ARC: [axs10x] Specify reserved memory for frame buffer (2016-04-29
> > > >   14:34:13 +0300)
> > > > 
> > > > ----------------------------------------------------------------
> > > > Alexey Brodkin (2):
> > > >       drm/arcpgu: use dedicated memory area for frame buffer
> > > >       ARC: [axs10x] Specify reserved memory for frame buffer
> > > > 
> > > >  arch/arc/boot/dts/axc001.dtsi     | 22 ++++++++++++++++++++--
> > > >  arch/arc/boot/dts/axc003.dtsi     | 14 ++++++++++++++
> > > >  arch/arc/boot/dts/axc003_idu.dtsi | 14 ++++++++++++++
> > > >  arch/arc/boot/dts/axs10x_mb.dtsi  |  2 +-
> > > >  drivers/gpu/drm/arc/arcpgu_drv.c  |  6 ++++++
> > > >  5 files changed, 55 insertions(+), 3 deletions(-)
> > > Could you please take a look at this pull request?
> > Another polite reminder.
> 
> Could you please pull this one?
> Indeed it was created quite some time ago so if required I may
> rebase it on top of whatever current you'd like.
> 
> Alternatively you may just apply the first patch from the series
> (could be found here
>  https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> and the second patch will be picked up by ARC maintainer (Vineet Gupta).

I thought I did pull this, please check drm-next.


Dave.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
  2016-05-23 19:23               ` David Airlie
  (?)
@ 2016-05-23 20:02                 ` Alexey Brodkin
  -1 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 20:02 UTC (permalink / raw)
  To: airlied
  Cc: daniel, Vineet.Gupta1, linux-kernel, dri-devel, airlied, linux-snps-arc

Hi David,

On Mon, 2016-05-23 at 15:23 -0400, David Airlie wrote:
> 
> 
> ----- Original Message -----
> > 
> > From: "Alexey Brodkin" <Alexey.Brodkin@synopsys.com>
> > To: airlied@redhat.com, daniel@ffwll.ch, "Vineet Gupta" <Vineet.Gupta1@synopsys.com>, airlied@linux.ie
> > Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org
> > Sent: Monday, 23 May, 2016 8:31:41 PM
> > Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> > 
> > Alternatively you may just apply the first patch from the series
> > (could be found here
> >  https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> > and the second patch will be picked up by ARC maintainer (Vineet Gupta).
> I thought I did pull this, please check drm-next.

Oops. Indeed it's in linux-next.
Sorry for that noise. Will double-check linux-next next time before bugging people.

-Alexey

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

* [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 20:02                 ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 20:02 UTC (permalink / raw)
  To: linux-snps-arc

Hi David,

On Mon, 2016-05-23@15:23 -0400, David Airlie wrote:
> 
> 
> ----- Original Message -----
> > 
> > From: "Alexey Brodkin" <Alexey.Brodkin at synopsys.com>
> > To: airlied at redhat.com, daniel at ffwll.ch, "Vineet Gupta" <Vineet.Gupta1 at synopsys.com>, airlied at linux.ie
> > Cc: dri-devel at lists.freedesktop.org, linux-kernel at vger.kernel.org, linux-snps-arc at lists.infradead.org
> > Sent: Monday, 23 May, 2016 8:31:41 PM
> > Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> > 
> > Alternatively you may just apply the first patch from the series
> > (could be found here
> > ?https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> > and the second patch will be picked up by ARC maintainer (Vineet Gupta).
> I thought I did pull this, please check drm-next.

Oops. Indeed it's in linux-next.
Sorry for that noise. Will double-check linux-next next time before bugging people.

-Alexey

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

* Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
@ 2016-05-23 20:02                 ` Alexey Brodkin
  0 siblings, 0 replies; 39+ messages in thread
From: Alexey Brodkin @ 2016-05-23 20:02 UTC (permalink / raw)
  To: airlied
  Cc: daniel, Vineet.Gupta1, linux-kernel, dri-devel, airlied, linux-snps-arc

Hi David,

On Mon, 2016-05-23 at 15:23 -0400, David Airlie wrote:
> 
> 
> ----- Original Message -----
> > 
> > From: "Alexey Brodkin" <Alexey.Brodkin@synopsys.com>
> > To: airlied@redhat.com, daniel@ffwll.ch, "Vineet Gupta" <Vineet.Gupta1@synopsys.com>, airlied@linux.ie
> > Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org
> > Sent: Monday, 23 May, 2016 8:31:41 PM
> > Subject: Re: [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer
> > 
> > Alternatively you may just apply the first patch from the series
> > (could be found here
> >  https://lists.freedesktop.org/archives/dri-devel/2016-April/106280.html)
> > and the second patch will be picked up by ARC maintainer (Vineet Gupta).
> I thought I did pull this, please check drm-next.

Oops. Indeed it's in linux-next.
Sorry for that noise. Will double-check linux-next next time before bugging people.

-Alexey

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

end of thread, other threads:[~2016-05-23 20:02 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 13:19 [PATCH 0/4 v6] drm: Add support of ARC PGU display controller Alexey Brodkin
2016-04-19 13:19 ` Alexey Brodkin
2016-04-19 13:19 ` [PATCH 1/4 " Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-19 13:19 ` [PATCH 2/4 v6] drm: Add DT bindings documentation for " Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-19 13:19 ` [PATCH 3/4 v6] MAINTAINERS: Add maintainer " Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-19 13:19 ` [PATCH 4/4 v6] arc: axs10x - add support of ARC PGU Alexey Brodkin
2016-04-19 13:19   ` Alexey Brodkin
2016-04-22 14:53 ` [PATCH 0/4 v6] drm: Add support of ARC PGU display controller Alexey Brodkin
2016-04-22 14:53   ` Alexey Brodkin
2016-04-22 14:53   ` Alexey Brodkin
2016-04-26 15:28   ` [GIT PULL] " Alexey Brodkin
2016-04-26 15:28     ` Alexey Brodkin
2016-04-26 15:28     ` Alexey Brodkin
2016-04-26 23:40     ` Dave Airlie
2016-04-26 23:40       ` Dave Airlie
2016-04-26 23:40       ` Dave Airlie
2016-04-29 11:36     ` [GIT PULL] drm/arcpgu: use dedicated memory area for frame buffer Alexey Brodkin
2016-04-29 11:36       ` Alexey Brodkin
2016-04-29 11:36       ` Alexey Brodkin
2016-05-10  9:51       ` Alexey Brodkin
2016-05-10  9:51         ` Alexey Brodkin
2016-05-10  9:51         ` Alexey Brodkin
2016-05-16  8:22         ` Alexey Brodkin
2016-05-16  8:22           ` Alexey Brodkin
2016-05-16  8:22           ` Alexey Brodkin
2016-05-23 10:31           ` Alexey Brodkin
2016-05-23 10:31             ` Alexey Brodkin
2016-05-23 10:31             ` Alexey Brodkin
2016-05-23 19:23             ` David Airlie
2016-05-23 19:23               ` David Airlie
2016-05-23 19:23               ` David Airlie
2016-05-23 20:02               ` Alexey Brodkin
2016-05-23 20:02                 ` Alexey Brodkin
2016-05-23 20:02                 ` Alexey Brodkin

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