Intel FPGA Video and Image Processing Suite
Subsystems (5)
v12 cover Intel FPGA Video and Image Processing Suite
From: Ong, Hean Loong <[email protected]>
The FPGA FrameBuffer Soft IP could be seen as the GPU and the DRM driver patch here is allocating memory for information to be streamed from the ARM/Linux to the display port.
Basically the driver just wraps the information such as the pixels to be drawn by the Sodt IP FrameBuffer 2.
The piece of hardware in discussion is the SoC FPGA where Linux runs on the ARM chip and the FGPA is driven by its NIOS soft core with its own proprietary firmware.
For example the application from the ARM Linux would have to write information on the /dev/fb0 with the information stored in the SDRAM to be fetched by the Framebuffer 2 Soft IP and displayed on the Display Port Monitor.
Ong Hean Loong (1):
ARM:socfpga-defconfig Intel FPGA Video and Image Processing Suite
Ong, Hean Loong (2):
ARM:dt-bindings:display Intel FPGA Video and Image Processing Suite ARM:drm ivip Intel FPGA Video and Image Processing Suite
.../devicetree/bindings/display/altr,vip-fb2.txt | 63 +++++++ arch/arm/configs/socfpga_defconfig | 5 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/ivip/Kconfig | 14 ++ drivers/gpu/drm/ivip/Makefile | 7 + drivers/gpu/drm/ivip/intel_vip_conn.c | 91 ++++++++++ drivers/gpu/drm/ivip/intel_vip_core.c | 189 ++++++++++++++++++++ drivers/gpu/drm/ivip/intel_vip_drv.h | 73 ++++++++ drivers/gpu/drm/ivip/intel_vip_of.c | 181 +++++++++++++++++++ 10 files changed, 626 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/altr,vip-fb2.txt create mode 100644 drivers/gpu/drm/ivip/Kconfig create mode 100644 drivers/gpu/drm/ivip/Makefile create mode 100644 drivers/gpu/drm/ivip/intel_vip_conn.c create mode 100644 drivers/gpu/drm/ivip/intel_vip_core.c create mode 100644 drivers/gpu/drm/ivip/intel_vip_drv.h create mode 100644 drivers/gpu/drm/ivip/intel_vip_of.c
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v12 1/3 ARM:dt-bindings:display Intel FPGA Video and Image Processing Suite
From: Ong, Hean Loong <[email protected]>
Device tree binding for Intel FPGA Video and Image Processing Suite. The bindings would set the max width, max height,
bits per pixel and memory port width.
The device tree binding only supports the Intel
Arria10 devkit and its variants. Vendor name retained as altr.
V12:
Wrap comments and fix commit message
V11:
No change
V10:
No change
V9:
Remove Display port node
V8:
*Add port to Display port decoder
V7:
*Fix OF graph for better description
*Add description for encoder
V6:
*Description have not describe DT device in general
V5:
*remove bindings for bits per symbol as it has only one value which is 8
V4:
*fix properties that does not describe the values
V3:
*OF graph not in accordance to graph.txt
V2:
*Remove Linux driver description
V1:
*Missing vendor prefix
--- .../devicetree/bindings/display/altr,vip-fb2.txt | 63 ++++++++++++++++++++ 1 files changed, 63 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/altr,vip-fb2.txt
Documentation/devicetree/bindings/display/altr,vip-fb2.txt new file +63 -0
@@ -0,0 +1,63 @@ +Intel Video and Image Processing(VIP) Frame Buffer II bindings + +Supported hardware: Intel FPGA SoC Arria10 and above with display port IP + +The Video Frame Buffer II in Video Image Processing (VIP) suite is an IP core +that interfaces between system memory and Avalon-ST video ports. The IP core +can be configured to support the memory reader (from memory to Avalon-ST) +and/or memory writer (from Avalon-ST to memory) interfaces. + +More information the FPGA video IP component can be acquired from +https://www.altera.com/content/dam/altera-www/global/en_US/pdfs\ +/literature/ug/ug_vip.pdf + +DT-Bindings: +============= +Required properties: +---------------------------- +- compatible: "altr,vip-frame-buffer-2.0" +- reg: Physical base address and length of the framebuffer controller's + registers. +- altr,max-width: The maximum width of the framebuffer in pixels. +- altr,max-height: The maximum height of the framebuffer in pixels. +- altr,mem-port-width = the bus width of the avalon master port + on the frame reader + +Optional sub-nodes: +- ports: The connection to the encoder + +Connections between the Frame Buffer II and other video IP cores in the system +are modelled using the OF graph DT bindings. The Frame Buffer II node has up +to two OF graph ports. When the memory writer interface is enabled, port 0 +maps to the Avalon-ST Input (din) port. When the memory reader interface is +enabled, port 1 maps to the Avalon-ST Output (dout) port. + +The encoder is built into the FPGA HW design and therefore would not +be accessible from the DDR. + + Port 0 Port1 +--------------------------------------------------------- +ARRIA10 AVALON_ST (DIN) AVALON_ST (DOUT) + +Required Properties Example: +---------------------------- + +framebuffer@100000280 { + compatible = "altr,vip-frame-buffer-2.0"; + reg = <0x00000001 0x00000280 0x00000040>; + altr,max-width = <1280>; + altr,max-height = <720>; + altr,mem-port-width = <128>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + fb_output: endpoint { + remote-endpoint = <&dp_encoder_input>; + }; + }; + }; +};
Signature · 1 line
1.7.1
PATCH v12 2/3 ARM:socfpga-defconfig Intel FPGA Video and Image Processing Suite
In reply to Hean-Loong, OngFrom: Ong Hean Loong <[email protected]>
Intel FPGA Video and Image Processing Suite Frame Buffer II driver config for Arria 10 devkit and its variants
--- arch/arm/configs/socfpga_defconfig | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/configs/socfpga_defconfig +5 -0
@@ -112,6 +112,11 @@ CONFIG_MFD_ALTERA_A10SR=y CONFIG_MFD_STMPE=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_DRM=m +CONFIG_DRM_IVIP=m +CONFIG_DRM_IVIP_OF=m +CONFIG_FB=y +CONFIG_FB_SIMPLE=y CONFIG_USB=y CONFIG_USB_STORAGE=y CONFIG_USB_DWC2=y
Signature · 6 lines
1.7.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v12 3/3 ARM:drm ivip Intel FPGA Video and Image Processing Suite
In reply to Hean-Loong, OngFrom: Ong, Hean Loong <[email protected]>
--- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/ivip/Kconfig | 14 +++ drivers/gpu/drm/ivip/Makefile | 7 ++ drivers/gpu/drm/ivip/intel_vip_conn.c | 91 ++++++++++++++++ drivers/gpu/drm/ivip/intel_vip_core.c | 189 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/ivip/intel_vip_drv.h | 73 +++++++++++++ drivers/gpu/drm/ivip/intel_vip_of.c | 181 +++++++++++++++++++++++++++++++ 8 files changed, 558 insertions(+), 0 deletions(-) create mode 100644 drivers/gpu/drm/ivip/Kconfig create mode 100644 drivers/gpu/drm/ivip/Makefile create mode 100644 drivers/gpu/drm/ivip/intel_vip_conn.c create mode 100644 drivers/gpu/drm/ivip/intel_vip_core.c create mode 100644 drivers/gpu/drm/ivip/intel_vip_drv.h create mode 100644 drivers/gpu/drm/ivip/intel_vip_of.c
drivers/gpu/drm/Kconfig +2 -0
@@ -235,6 +235,8 @@ source "drivers/gpu/drm/nouveau/Kconfig" source "drivers/gpu/drm/i915/Kconfig" +source "drivers/gpu/drm/ivip/Kconfig" + config DRM_VGEM tristate "Virtual GEM provider" depends on DRM
drivers/gpu/drm/Makefile +1 -0
@@ -63,6 +63,7 @@ obj-$(CONFIG_DRM_AMDGPU)+= amd/amdgpu/ obj-$(CONFIG_DRM_MGA) += mga/ obj-$(CONFIG_DRM_I810) += i810/ obj-$(CONFIG_DRM_I915) += i915/ +obj-$(CONFIG_DRM_IVIP) += ivip/ obj-$(CONFIG_DRM_MGAG200) += mgag200/ obj-$(CONFIG_DRM_V3D) += v3d/ obj-$(CONFIG_DRM_VC4) += vc4/
drivers/gpu/drm/ivip/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +config DRM_IVIP + tristate "Intel FGPA Video and Image Processing" + depends on DRM && OF + select DRM_GEM_CMA_HELPER + select DRM_KMS_HELPER + select DRM_KMS_FB_HELPER + select DRM_KMS_CMA_HELPER + help + Choose this option if you have an Intel FPGA Arria 10 system + and above with an Intel Display Port IP. This does not support + legacy Intel FPGA Cyclone V display port. Currently only single + frame buffer is supported. Note that ACPI and X_86 architecture + is not supported for Arria10. If M is selected the module will be + called ivip.
drivers/gpu/drm/ivip/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for the drm device driver. This driver provides support for the +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. + +obj-$(CONFIG_DRM_IVIP) += ivip.o +ivip-objs := intel_vip_of.o intel_vip_core.o \ + intel_vip_conn.o
drivers/gpu/drm/ivip/intel_vip_conn.c new file +91 -0
91 lines not on this page · raw message
drivers/gpu/drm/ivip/intel_vip_core.c new file +189 -0
189 lines not on this page · raw message
drivers/gpu/drm/ivip/intel_vip_drv.h new file +73 -0
73 lines not on this page · raw message
drivers/gpu/drm/ivip/intel_vip_of.c new file +181 -0
181 lines not on this page · raw message
Signature · 6 lines
1.7.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCHv12 3/3] ARM:drm ivip Intel FPGA Video and Image Processing Suite
Hi Hean-Loong, Ong
Patch looks good to me, but there is a few trivial things I spotted while browsing the code. See below.
Sam
drivers/gpu/drm/ivip/Makefile line 7
Quoted 9 lines
+++ b/drivers/gpu/drm/ivip/Makefile
drivers/gpu/drm/ivip/Makefile new file +7
-0@@ -0,0 +1,7 @@ +# +# Makefile for the drm device driver. This driver provides support for the +# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. + +obj-$(CONFIG_DRM_IVIP) += ivip.o +ivip-objs := intel_vip_of.o intel_vip_core.o \ + intel_vip_conn.o
You could use:
ivip-y := intel_vip_of.o intel_vip_core.o
ivip-y += intel_vip_conn.o
Using "ivip-y" is the recommend syntax today.
And using "+=" you get rid of the ugly "\" to continue a line. (Some people prefer "\" in makefiles, but there are not needed)
Quoted 13 lines
+++
b/drivers/gpu/drm/ivip/intel_vip_core.cdrivers/gpu/drm/ivip/intel_vip_core.c new file +11
-0@@ -0,0 +1,189 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2019 Intel Corporation. +* +* intel_vip_core.c -- Intel Video and Image Processing(VIP) +* Frame Buffer II driver +* +* This driver supports the Intel VIP Frame Reader component. +* More info on the hardware can be found in the Intel Video +* and Image Processing Suite User Guide at this address +* http://www.altera.com/literature/ug/ug_vip.pdf.
drivers/gpu/drm/ivip/intel_vip_core.c line 21
Quoted 10 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +10
-0+* +* Authors: +* Walter Goossens <[email protected]> +* Thomas Chou <[email protected]> +* Chris Rauer <[email protected]> +* Ong, Hean-Loong <[email protected]> +* +*/ + +#include <drm/drmP.h>
Please do not use drmP.h in new drivers, we try to get rid of this file.
drivers/gpu/drm/ivip/intel_vip_core.c line 30
Quoted 9 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +9
-0+#include <drm/drm_atomic.h> +#include <drm/drm_atomic_helper.h> +#include <drm/drm_crtc_helper.h> +#include <drm/drm_fb_helper.h> +#include <drm/drm_fb_cma_helper.h> +#include <drm/drm_gem_cma_helper.h> +#include <drm/drm_plane_helper.h> +#include <drm/drm_simple_kms_helper.h> +#include <drm/drm_gem_framebuffer_helper.h>
Sort the list of include files.
(Looks like this was properly done before, and only one file is out of palce)
drivers/gpu/drm/ivip/intel_vip_core.c line 46
Quoted 3 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +3
-0+static void intelvipfb_enable (struct drm_simple_display_pipe *pipe, +struct drm_crtc_state *crtc_state,struct drm_plane_state * + plane_state)
Fix indent. The parameters on second line and following should be aligned below the opening paranthesis.
Use tab(s) + spaces to align properly.
drivers/gpu/drm/ivip/intel_vip_core.c line 93
Quoted 2 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +2
-0+void intelvipfb_display_pipe_update (struct drm_simple_display_pipe *pipe, +struct drm_plane_state *old_state)
Align parameter
Quoted 13 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +13
-0+} +EXPORT_SYMBOL (intelvipfb_display_pipe_update); + +static struct drm_simple_display_pipe_funcs fbpriv_funcs = { + .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb, + .update = intelvipfb_display_pipe_update, + .enable = intelvipfb_enable, + .disable = intelvipfb_disable, +}; + + +int intelvipfb_probe (struct device *dev) +{
drivers/gpu/drm/ivip/intel_vip_core.c line 132
Quoted 10 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +10
-0+int retval; +struct drm_device *drm; +struct intelvipfb_priv *fbpriv =dev_get_drvdata (dev); + +struct drm_connector *connector; +u32 formats[] = {DRM_FORMAT_XRGB8888 }; + + drm = fbpriv->drm; + + drm->dev_private = fbpriv;
It would be simpler to just pass fbpriv as a parameter. There is only one user of intelvipfb_probe() so no need to avoid it.
Also it would be more logical to set drm = fbpriv->drm; where memory are allocated.
Quoted 5 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +5
-0+ +intelvipfb_setup_mode_config (drm); + + connector =intelvipfb_conn_setup (drm); +if (!connector) {
drivers/gpu/drm/ivip/intel_vip_core.c line 147
Quoted 10 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +10
-0+dev_err (drm->dev,"Connector setup failed\n" ); + goto err_mode_config; + } + + retval =drm_simple_display_pipe_init (drm, + &fbpriv->pipe, + &fbpriv_funcs, + formats, +ARRAY_SIZE (formats), +NULL , connector);
Consider indent, where subsequent parameters are aligned right after the opening '('.
Quoted 29 lines
drivers/gpu/drm/ivip/intel_vip_core.c new file +22
-0+ +if (retval <0 ) { +dev_err (drm->dev,"Cannot setup simple display pipe\n" ); + goto err_mode_config; + } + +drm_mode_config_reset (drm); + +drm_dev_register (drm,0 ); + +drm_fbdev_generic_setup (drm,32 ); + +dev_info (drm->dev,"ivip: Successfully created fb\n" ); + +return retval; + +err_mode_config: + +drm_mode_config_cleanup (drm); +return -ENODEV ; +} +drivers/gpu/drm/ivip/intel_vip_of.c new file +0
-0
drivers/gpu/drm/ivip/intel_vip_of.c line 6
Quoted 6 lines
drivers/gpu/drm/ivip/intel_vip_of.c new file +6
-0@@ -0,0 +1,181 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2019 Intel Corporation. +* +* intel_vip_of.c -- Intel Video and Image Processing(VIP) +* Frame Buffer II driver
The need for this file confuses me.
It does not include only "of" related stuff, but also generic device driver stuff.
Maybe merge with intel_vip_core.c?
And rename that file to intel_vip_drv.c?
drivers/gpu/drm/ivip/intel_vip_of.c line 17
Quoted 11 lines
drivers/gpu/drm/ivip/intel_vip_of.c new file +11
-0+* +* This driver supports the Intel VIP Frame Reader component. +* More info on the hardware can be found in the Intel Video +* and Image Processing Suite User Guide at this address +* http://www.altera.com/literature/ug/ug_vip.pdf. +* +* Authors: +* Ong, Hean-Loong <[email protected]> +* +*/ +#include <drm/drmP.h>
Drop use of drmP.h
drivers/gpu/drm/ivip/intel_vip_of.c line 124
Quoted 13 lines
drivers/gpu/drm/ivip/intel_vip_of.c new file +13
-0+static int intelvipfb_of_probe (struct platform_device *pdev) +{ +int retval; +struct resource *reg_res; +struct intelvipfb_priv *fbpriv; +struct device *dev = &pdev->dev; +struct drm_device *drm; + + fbpriv =devm_kzalloc (dev,sizeof (*fbpriv),GFP_KERNEL ); +if (!fbpriv) +return -ENOMEM ; + +/*setup DRM */
Space before "setup"
drivers/gpu/drm/ivip/intel_vip_of.c line 167
Quoted 4 lines
drivers/gpu/drm/ivip/intel_vip_of.c new file +4
-0+ +static const struct of_device_id intelvipfb_of_match[] = { + { .compatible ="altr,vip-frame-buffer-2.0" }, + {},
Maybe add "/* sentinel */" comment?
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel