Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51dacf20 authored by Carlos Palminha's avatar Carlos Palminha Committed by Alexey Brodkin
Browse files

drm: Add support of ARC PGU display controller



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: default avatarCarlos Palminha <palminha@synopsys.com>
Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-snps-arc@lists.infradead.org
parent 027b3f8b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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/
+10 −0
Original line number Diff line number Diff line
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.
+2 −0
Original line number Diff line number Diff line
arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
+50 −0
Original line number Diff line number Diff line
/*
 * 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
Loading