* Re: [PATCH v2 1/8] dt-bindings: add binding for the Allwinner DE2 CCU
[not found] ` <20170316204748.8596-2-icenowy@aosc.xyz>
@ 2017-03-20 9:55 ` Maxime Ripard
0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2017-03-20 9:55 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Chen-Yu Tsai, Jernej Skrabec, linux-clk, devicetree,
linux-arm-kernel, linux-kernel, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]
On Fri, Mar 17, 2017 at 04:47:41AM +0800, Icenowy Zheng wrote:
> Allwinner "Display Engine 2.0" contains some clock controls in it.
>
> Add them as a clock driver, and make a device tree binding.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
> .../devicetree/bindings/clock/sun8i-de2.txt | 31 ++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/sun8i-de2.txt
>
> diff --git a/Documentation/devicetree/bindings/clock/sun8i-de2.txt b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
> new file mode 100644
> index 000000000000..c19496f037a4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
> @@ -0,0 +1,31 @@
> +Allwinner Display Engine 2.0 Clock Control Binding
> +--------------------------------------------------
> +
> +Required properties :
> +- compatible: must contain one of the following compatibles:
> + - "allwinner,sun8i-a83t-de2-clk"
> + - "allwinner,sun50i-a64-de2-clk"
> + - "allwinner,sun50i-h5-de2-clk"
> +
> +- reg: Must contain the registers base address and length
> +- clocks: phandle to the clocks feeding the display engine subsystem.
> + Three are needed:
> + - "mod": the display engine module clock
> + - "bus": the bus clock for the whole display engine subsystem
> +- clock-names: Must contain the clock names described just above
> +- resets: phandle to the reset control for the display engine subsystem.
> +- #clock-cells : must contain 1
> +- #reset-cells : must contain 1
> +
> +Example:
> +de2_clocks: clock@01000000 {
> + compatible = "allwinner,sun50i-a64-de2-clk";
> + reg = <0x01000000 0x1c>;
Please use the full size of the memory area allocated to that device.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 3/8] dt-bindings: add bindings for DE2 on V3s SoC
[not found] ` <20170316204748.8596-4-icenowy@aosc.xyz>
@ 2017-03-20 9:56 ` Maxime Ripard
0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2017-03-20 9:56 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Chen-Yu Tsai, Jernej Skrabec, linux-clk, devicetree,
linux-arm-kernel, linux-kernel, dri-devel
[-- Attachment #1: Type: text/plain, Size: 3949 bytes --]
On Fri, Mar 17, 2017 at 04:47:43AM +0800, Icenowy Zheng wrote:
> Allwinner V3s SoC have a display engine which have a different pipeline
> with older SoCs.
>
> Add document for it (new compatibles and the new "mixer" part).
>
> The paragraph of TCON is also refactored, for furtherly add TCONs in
> A83T/H3/A64/H5 that have only a channel 1 (used for HDMI or TV Encoder).
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
> .../bindings/display/sunxi/sun4i-drm.txt | 37 +++++++++++++++++++---
> 1 file changed, 33 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> index b82c00449468..2c293247c41d 100644
> --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt
> @@ -31,11 +31,11 @@ Required properties:
> * allwinner,sun6i-a31-tcon
> * allwinner,sun6i-a31s-tcon
> * allwinner,sun8i-a33-tcon
> + * allwinner,sun8i-v3s-tcon
> - reg: base address and size of memory-mapped region
> - interrupts: interrupt associated to this IP
> - - clocks: phandles to the clocks feeding the TCON. Three are needed:
> + - clocks: phandles to the clocks feeding the TCON
> - 'ahb': the interface clocks
> - - 'tcon-ch0': The clock driving the TCON channel 0
> - resets: phandles to the reset controllers driving the encoder
> - "lcd": the reset line for the TCON channel 0
>
> @@ -52,7 +52,12 @@ Required properties:
> second the block connected to the TCON channel 1 (usually the TV
> encoder)
>
> -On SoCs other than the A33, there is one more clock required:
> +On TCONs that have a channel 0 (currently all TCONs supported), there
> +is one more clock required:
> + - 'tcon-ch0': The clock driving the TCON channel 0
> +
> +On TCONs that have a channel 1 (currently all TCONs except the ones in
> +A33 and V3s), there is one more clock required:
> - 'tcon-ch1': The clock driving the TCON channel 1
>
> DRC
> @@ -137,6 +142,26 @@ Required properties:
> Documentation/devicetree/bindings/media/video-interfaces.txt. The
> first port should be the input endpoints, the second one the outputs
>
> +Display Engine 2.0 Mixer
> +------------------------
> +
> +The DE2 mixer have many functionalities, currently only layer blending is
> +supported.
> +
> +Required properties:
> + - compatible: value must be one of:
> + * allwinner,sun8i-v3s-de2-mixer
> + - reg: base address and size of the memory-mapped region.
> + - clocks: phandles to the clocks feeding the frontend and backend
> + * bus: the backend interface clock
> + * ram: the backend DRAM clock
> + - clock-names: the clock names mentioned above
> + - resets: phandles to the reset controllers driving the backend
> +
> +- ports: A ports node with endpoint definitions as defined in
> + Documentation/devicetree/bindings/media/video-interfaces.txt. The
> + first port should be the input endpoints, the second one the output
> +
>
> Display Engine Pipeline
> -----------------------
> @@ -151,9 +176,13 @@ Required properties:
> * allwinner,sun6i-a31-display-engine
> * allwinner,sun6i-a31s-display-engine
> * allwinner,sun8i-a33-display-engine
> + * allwinner,sun8i-v3s-display-engine
>
> - allwinner,pipelines: list of phandle to the display engine
> - frontends available.
> + pipeline entry point. For SoCs with original DE (currently
> + all SoCs supported by display engine except V3s), this
> + phandle should be a display frontend or backend; for SoCs
> + with DE2, this phandle should be a mixer.
In the old ones, this should never be the backend.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines
[not found] ` <20170316204748.8596-5-icenowy@aosc.xyz>
@ 2017-03-20 10:26 ` Maxime Ripard
0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2017-03-20 10:26 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, Chen-Yu Tsai, Jernej Skrabec, linux-clk, devicetree,
linux-arm-kernel, linux-kernel, dri-devel
[-- Attachment #1: Type: text/plain, Size: 7663 bytes --]
Hi,
On Fri, Mar 17, 2017 at 04:47:44AM +0800, Icenowy Zheng wrote:
> Allwinner have a new "Display Engine 2.0" in there new SoCs, which comes
> in a new "Display Engine" (mixers instead of old backends and
> frontends).
>
> Add support for the mixer on Allwinner V3s SoC; it's the simplest one.
>
> Currently a lot of functions are still missing -- more investigations
> are needed to gain enough infomation for them.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
> Changes in v2:
> - Rebase on current linux-next (with Chen-Yu's some refactors)
> - Removed currently broken overlay plane.
>
> drivers/gpu/drm/sun4i/Kconfig | 9 +
> drivers/gpu/drm/sun4i/Makefile | 3 +-
> drivers/gpu/drm/sun4i/sun4i_crtc.c | 14 +-
> drivers/gpu/drm/sun4i/sun4i_crtc.h | 2 +
> drivers/gpu/drm/sun4i/sun4i_drv.c | 1 +
> drivers/gpu/drm/sun4i/sun4i_drv.h | 1 +
> drivers/gpu/drm/sun4i/sun4i_layer.c | 94 +++++++--
> drivers/gpu/drm/sun4i/sun4i_layer.h | 3 +
> drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +-
> drivers/gpu/drm/sun4i/sun8i_mixer.c | 385 ++++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/sun4i/sun8i_mixer.h | 166 ++++++++++++++++
> 11 files changed, 658 insertions(+), 22 deletions(-)
> create mode 100644 drivers/gpu/drm/sun4i/sun8i_mixer.c
> create mode 100644 drivers/gpu/drm/sun4i/sun8i_mixer.h
>
> diff --git a/drivers/gpu/drm/sun4i/Kconfig b/drivers/gpu/drm/sun4i/Kconfig
> index a4b357db8856..0fa989f955e7 100644
> --- a/drivers/gpu/drm/sun4i/Kconfig
> +++ b/drivers/gpu/drm/sun4i/Kconfig
> @@ -12,3 +12,12 @@ config DRM_SUN4I
> Choose this option if you have an Allwinner SoC with a
> Display Engine. If M is selected the module will be called
> sun4i-drm.
> +
> +config DRM_SUN4I_DE2
> + bool "Support Display Engine 2.0"
> + depends on DRM_SUN4I
> + default MACH_SUN8I
> + select SUN8I_DE2_CCU
> + help
> + Choose this option if you have an Allwinner SoC with a
> + "Display Engine 2.0".
> diff --git a/drivers/gpu/drm/sun4i/Makefile b/drivers/gpu/drm/sun4i/Makefile
> index 59b757350a1f..3e7e2b2eb386 100644
> --- a/drivers/gpu/drm/sun4i/Makefile
> +++ b/drivers/gpu/drm/sun4i/Makefile
> @@ -1,5 +1,7 @@
> sun4i-drm-y += sun4i_drv.o
> sun4i-drm-y += sun4i_framebuffer.o
> +sun4i-drm-y += sun4i_backend.o
> +sun4i-drm-$(CONFIG_DRM_SUN4I_DE2) += sun8i_mixer.o
>
> sun4i-tcon-y += sun4i_tcon.o
> sun4i-tcon-y += sun4i_rgb.o
> @@ -8,6 +10,5 @@ sun4i-tcon-y += sun4i_crtc.o
> sun4i-tcon-y += sun4i_layer.o
>
> obj-$(CONFIG_DRM_SUN4I) += sun4i-drm.o sun4i-tcon.o
> -obj-$(CONFIG_DRM_SUN4I) += sun4i_backend.o
> obj-$(CONFIG_DRM_SUN4I) += sun6i_drc.o
> obj-$(CONFIG_DRM_SUN4I) += sun4i_tv.o
> diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c
> index 3c876c3a356a..bf2aa0ffd35c 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
> @@ -26,8 +26,8 @@
> #include <video/videomode.h>
>
> #include "sun4i_backend.h"
> +#include "sun8i_mixer.h"
> #include "sun4i_crtc.h"
> -#include "sun4i_drv.h"
> #include "sun4i_layer.h"
> #include "sun4i_tcon.h"
>
> @@ -56,7 +56,10 @@ static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc,
>
> DRM_DEBUG_DRIVER("Committing plane changes\n");
>
> - sun4i_backend_commit(scrtc->backend);
> + if (scrtc->backend)
> + sun4i_backend_commit(scrtc->backend);
> + else if (scrtc->mixer)
> + sun8i_mixer_commit(scrtc->mixer);
As I told you already, you should be using functions pointers and just
call whatever is stored in that pointer
> if (event) {
> crtc->state->event = NULL;
> @@ -136,6 +139,7 @@ static const struct drm_crtc_funcs sun4i_crtc_funcs = {
>
> struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
> struct sun4i_backend *backend,
> + struct sun8i_mixer *mixer,
> struct sun4i_tcon *tcon)
> {
> struct sun4i_crtc *scrtc;
> @@ -146,10 +150,14 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
> if (!scrtc)
> return ERR_PTR(-ENOMEM);
> scrtc->backend = backend;
> + scrtc->mixer = mixer;
> scrtc->tcon = tcon;
>
> /* Create our layers */
> - scrtc->layers = sun4i_layers_init(drm, scrtc->backend);
> + if (backend)
> + scrtc->layers = sun4i_layers_init(drm, backend);
> + else if (mixer)
> + scrtc->layers = sun8i_layers_init(drm, mixer);
Same thing here.
> if (IS_ERR(scrtc->layers)) {
> dev_err(drm->dev, "Couldn't create the planes\n");
> return NULL;
> diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.h b/drivers/gpu/drm/sun4i/sun4i_crtc.h
> index 230cb8f0d601..5783579e9c3c 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_crtc.h
> +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.h
> @@ -18,6 +18,7 @@ struct sun4i_crtc {
> struct drm_pending_vblank_event *event;
>
> struct sun4i_backend *backend;
> + struct sun8i_mixer *mixer;
> struct sun4i_tcon *tcon;
> struct sun4i_layer **layers;
> };
> @@ -29,6 +30,7 @@ static inline struct sun4i_crtc *drm_crtc_to_sun4i_crtc(struct drm_crtc *crtc)
>
> struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
> struct sun4i_backend *backend,
> + struct sun8i_mixer *mixer,
> struct sun4i_tcon *tcon);
>
> #endif /* _SUN4I_CRTC_H_ */
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
> index 767bbadcc85d..e78b8aaa4019 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
> @@ -304,6 +304,7 @@ static const struct of_device_id sun4i_drv_of_table[] = {
> { .compatible = "allwinner,sun6i-a31-display-engine" },
> { .compatible = "allwinner,sun6i-a31s-display-engine" },
> { .compatible = "allwinner,sun8i-a33-display-engine" },
> + { .compatible = "allwinner,sun8i-v3s-display-engine" },
> { }
> };
> MODULE_DEVICE_TABLE(of, sun4i_drv_of_table);
> diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.h b/drivers/gpu/drm/sun4i/sun4i_drv.h
> index 5df50126ff52..00506b99816a 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_drv.h
> +++ b/drivers/gpu/drm/sun4i/sun4i_drv.h
> @@ -18,6 +18,7 @@
>
> struct sun4i_drv {
> struct sun4i_backend *backend;
> + struct sun8i_mixer *mixer;
I don't think you need to store the mixer pointer both in the CRTC and
the main structure.
> struct sun4i_tcon *tcon;
>
> struct drm_fbdev_cma *fbdev;
> diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
> index f26bde5b9117..356253142c60 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
> @@ -16,49 +16,63 @@
> #include <drm/drmP.h>
>
> #include "sun4i_backend.h"
> +#include "sun8i_mixer.h"
> #include "sun4i_layer.h"
>
> struct sun4i_plane_desc {
> enum drm_plane_type type;
> + /* Pipe is not used in sun8i-mixer */
> u8 pipe;
> const uint32_t *formats;
> uint32_t nformats;
> };
>
> -static int sun4i_backend_layer_atomic_check(struct drm_plane *plane,
> +static int sun4i_layer_atomic_check(struct drm_plane *plane,
> struct drm_plane_state *state)
> {
> return 0;
> }
And there's no reason to share the layers code. The formats supported
are likely to be different, the constraints will be, and there's no
code to share at all, since the registers are not the same.
Just create a new one.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-20 10:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20170316204748.8596-1-icenowy@aosc.xyz>
[not found] ` <20170316204748.8596-2-icenowy@aosc.xyz>
2017-03-20 9:55 ` [PATCH v2 1/8] dt-bindings: add binding for the Allwinner DE2 CCU Maxime Ripard
[not found] ` <20170316204748.8596-4-icenowy@aosc.xyz>
2017-03-20 9:56 ` [PATCH v2 3/8] dt-bindings: add bindings for DE2 on V3s SoC Maxime Ripard
[not found] ` <20170316204748.8596-5-icenowy@aosc.xyz>
2017-03-20 10:26 ` [PATCH v2 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®