drm: Add support of ARC PGU display controller
Subsystems (6)
v4 cover drm: Add support of ARC PGU display controller
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 that introduces drm_connector_register_all()/drm_connector_unregister_all() is a prerequisite
now: https://lkml.org/lkml/2016/3/23/61
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.
Alexey Brodkin (4):
drm: Add DT bindings documentation for ARC PGU display controller
MAINTAINERS: Add maintainer for ARC PGU display controller
arc: Add our own implementation of fb_pgprotect()
arc: axs10x - add support of ARC PGU
Carlos Palminha (1):
drm: Add support of ARC PGU display controller
.../devicetree/bindings/display/snps,arcpgu.txt | 71 ++++++ MAINTAINERS | 6 + arch/arc/boot/dts/axs10x_mb.dtsi | 61 +++++ arch/arc/include/asm/fb.h | 19 ++ 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 +++ 13 files changed, 1002 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt create mode 100644 arch/arc/include/asm/fb.h 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
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 1/5 drm: Add support of ARC PGU display controller
From: Carlos Palminha <[email protected]>
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.
---
Note following series that introduces drm_connector_register_all()/drm_connector_unregister_all() is a prerequisite
now: https://lkml.org/lkml/2016/3/23/61
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
drivers/gpu/drm/Kconfig +2 -0
@@ -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"
drivers/gpu/drm/Makefile +1 -0
@@ -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/
drivers/gpu/drm/arc/Kconfig new file +10 -0
@@ -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.
drivers/gpu/drm/arc/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o +obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
drivers/gpu/drm/arc/arcpgu.h new file +50 -0
50 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_crtc.c new file +257 -0
257 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_drv.c new file +282 -0
282 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_hdmi.c new file +201 -0
201 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_regs.h new file +40 -0
@@ -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
Signature · 1 line
2.5.0
PATCH v4 2/5 drm: Add DT bindings documentation for ARC PGU display controller
In reply to Alexey BrodkinThis add DT bindings documentation for ARC PGU display controller.
---
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 | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
Documentation/devicetree/bindings/display/snps,arcpgu.txt new file +71 -0
@@ -0,0 +1,71 @@ +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"; + encoder-slave = <&encoder_node>; + + port { + pgu_output: endpoint { + remote-endpoint = <&hdmi_enc_input>; + }; + }; + }; + + /* HDMI encoder on I2C bus */ + i2c@XXXXXXXX { + compatible = "..."; + + encoder_node:hdmi@XX{ + compatible="..."; + + ports { + port@0 { + reg = <0>; + hdmi_enc_input:endpoint { + remote-endpoint = <&pgu_output>; + }; + }; + + port@1 { + reg = <1>; + hdmi_enc_output:endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + } + + hdmi0: connector { + compatible = "hdmi-connector"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_enc_output>; + }; + }; + }; +};
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 3/5 MAINTAINERS: Add maintainer for ARC PGU display controller
In reply to Alexey BrodkinThis updates MAINTEINERS file with information about maintainer of ARC PGU display controller driver.
---
No changes v3 -> v4.
No changes v2 -> v3.
No changes v1 -> v2.
MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
@@ -827,6 +827,12 @@ S: Maintained F: drivers/net/arcnet/ F: include/uapi/linux/if_arcnet.h +ARC PGU DRM DRIVER +M: Alexey Brodkin <[email protected]> +S: Supported +F: drivers/gpu/drm/arc/ +F: Documentation/devicetree/bindings/display/snps,arcpgu.txt + ARM HDLCD DRM DRIVER M: Liviu Dudau <[email protected]> S: Supported
Signature · 1 line
2.5.0
PATCH v4 4/5 arc: Add our own implementation of fb_pgprotect()
In reply to Alexey BrodkinDuring mmaping of frame-buffer pages to user-space fb_protect() is called to set proper page settings.
In case of ARC we need to mark pages that are mmaped to user as uncached because of 2 reasons:
* Huge amount of data if passing through data cache will thrash cache a lot making cache almost useless for other less traffic hungry processes.
* Data written by user in FB will be immediately available for hardware (such as PGU etc) without requirements to flush data cache regularly.
---
Changes v3 -> v4:
* This change was introduced only in v4.
arch/arc/include/asm/fb.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 arch/arc/include/asm/fb.h
arch/arc/include/asm/fb.h new file +19 -0
@@ -0,0 +1,19 @@ +#ifndef _ASM_FB_H_ +#define _ASM_FB_H_ + +#include <linux/fb.h> +#include <linux/fs.h> +#include <asm/page.h> + +static inline void fb_pgprotect (struct file *file,struct vm_area_struct *vma, +unsigned long off) +{ + vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); +} + +static inline int fb_is_primary_device (struct fb_info *info) +{ +return 0 ; +} + +#endif /* _ASM_FB_H_ */
Signature · 1 line
2.5.0
PATCH v4 5/5 arc: axs10x - add support of ARC PGU
In reply to Alexey BrodkinSynopsys 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.
---
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(+)
arch/arc/boot/dts/axs10x_mb.dtsi +61 -0
@@ -34,6 +34,12 @@ clock-frequency = <50000000>; #clock-cells = <0>; }; + + pguclk: pguclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <74440000>; + }; }; ethernet@0x18000 {
@@ -147,6 +153,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>;
@@ -160,6 +197,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>;
@@ -221,5 +268,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>; + }; + }; + }; }; };
Signature · 1 line
2.5.0
kbuild test robot
build botreproduce:
Hi Carlos,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.5 next-20160324]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Alexey-Brodkin/drm-Add-support-of-ARC-PGU-display-controller/20160325-005345 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
drivers/gpu/drm/arc/arcpgu_drv.c: In function 'arcpgu_probe':
>> drivers/gpu/drm/arc/arcpgu_drv.c:232:8: error: implicit declaration of function 'drm_connector_register_all' [-Werror=implicit-function-declaration]
ret = drm_connector_register_all(drm);
^
drivers/gpu/drm/arc/arcpgu_drv.c: In function 'arcpgu_remove':
>> drivers/gpu/drm/arc/arcpgu_drv.c:254:2: error: implicit declaration of function 'drm_connector_unregister_all' [-Werror=implicit-function-declaration]
drm_connector_unregister_all(drm);
^cc1: some warnings being treated as errors
vim +/drm_connector_register_all +232 drivers/gpu/drm/arc/arcpgu_drv.c
226 goto err_unref;
227
228 ret = drm_dev_register(drm, 0);
229 if (ret)
230 goto err_unload;
231
> 232 ret = drm_connector_register_all(drm);
233 if (ret)
234 goto err_unregister;
235
236 return 0;
237
238 err_unregister:
239 drm_dev_unregister(drm);
240
241 err_unload:
242 arcpgu_unload(drm);
243
244 err_unref:
245 drm_dev_unref(drm);
246
247 return ret;
248 }
249
250 static int arcpgu_remove(struct platform_device *pdev)
251 {
252 struct drm_device *drm = platform_get_drvdata(pdev);
253
> 254 drm_connector_unregister_all(drm); 255 drm_dev_unregister(drm);
256 arcpgu_unload(drm);
257 drm_dev_unref(drm);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 53512 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20160325/f1605ccf/attachment-0001.obj>
Hello,
Quoted 18 lines · kbuild test robot
Hi Carlos,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.5 next-20160324]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]url: https://github.com/0day-ci/linux/commits/Alexey-Brodkin/drm-Add-support-of-ARC-PGU-display-controller/20160325
-005345
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: i386-allmodconfig (attached as .config)
reproduce:# save the attached .config to linux build tree make ARCH=i386All errors (new ones prefixed by >>):
230 gotoerr_unload;
231
> 232 ret =drm_connector_register_all(drm);
...
Quoted 2 lines
> 254
drm_connector_unregister_all(drm);
255drm_dev_unregister(drm);
That problem happens because that change relies on another series that yet to be accepted in DRM for 4.7 cycle, see https://lkml.org/lkml/2016/3/23/128
Based on Daniel's comment I would assume soon after 4.6-rc1 will be cut pending prerequisite will be applied to drm-next and that build failure will go away.
-Alexey
Re: [PATCH 2/5 v4] drm: Add DT bindings documentation for ARC PGU display controller
In reply to Alexey BrodkinQuoted 51 lines · Alexey Brodkin
This add DT bindings documentation for ARC PGU display controller.
Signed-off-by Alexey Brodkin <[email protected]>Cc Rob Herring <[email protected]>Cc Pawel Moll <[email protected]>Cc Mark Rutland <[email protected]>Cc Ian Campbell <[email protected]>Cc Kumar Gala <[email protected]>---
Changes v3 -> v4: (addressing Rob's comments)
* Removed "encoder-slave" from required properties
* Removed "0x" from node namesChanges 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 | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txtDocumentation/devicetree/bindings/display/snps,arcpgu.txt new file +18
-0@@ -0,0 +1,71 @@ +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:
Documentation/devicetree/bindings/display/snps,arcpgu.txt line 28
Quoted 10 lines
Documentation/devicetree/bindings/display/snps,arcpgu.txt new file +10
-0+ +/ { + ... + + pgu@XXXXXXXX { + compatible = "snps,arcpgu"; + reg = <0xXXXXXXXX 0x400>; + clocks = <&clock_node>; + clock-names = "pxlclk"; + encoder-slave = <&encoder_node>;
Still in the example...
Otherwise,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel