* [PATCH 1/2] drm/exynos: add global macro for the default primary plane
@ 2015-09-04 22:05 Gustavo Padovan
2015-09-04 22:05 ` [PATCH 2/2] drm/exynos: add cursor plane support Gustavo Padovan
2015-10-12 13:18 ` [PATCH 1/2] drm/exynos: add global macro for the default primary plane Inki Dae
0 siblings, 2 replies; 4+ messages in thread
From: Gustavo Padovan @ 2015-09-04 22:05 UTC (permalink / raw)
To: linux-samsung-soc
Cc: dri-devel, inki.dae, jy0922.shim, tjakobi, Gustavo Padovan
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Define DEFAULT_WIN as zero to help set the primary plane on all CRTCs.
Some CRTCs were defining a variable to store the default window, but that
is not necessary as the default (primary) window is always the window zero.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 6 ++----
drivers/gpu/drm/exynos/exynos7_drm_decon.c | 5 ++---
drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 ++---
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 ++----
drivers/gpu/drm/exynos/exynos_mixer.c | 7 +++----
6 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 988df06..2f393b1 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -33,7 +33,6 @@ struct decon_context {
struct exynos_drm_plane planes[WINDOWS_NR];
void __iomem *addr;
struct clk *clks[6];
- unsigned int default_win;
unsigned long irq_flags;
int pipe;
@@ -451,7 +450,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
ctx->pipe = priv->pipe++;
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
+ type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
DRM_PLANE_TYPE_OVERLAY;
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, decon_formats,
@@ -460,7 +459,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
return ret;
}
- exynos_plane = &ctx->planes[ctx->default_win];
+ exynos_plane = &ctx->planes[DEFAULT_WIN];
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
&decon_crtc_ops, ctx);
@@ -557,7 +556,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
if (!ctx)
return -ENOMEM;
- ctx->default_win = 0;
ctx->dev = dev;
if (of_get_child_by_name(dev->of_node, "i80-if-timings"))
ctx->i80_if = true;
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 0776f38..7a6c069 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -52,7 +52,6 @@ struct decon_context {
struct clk *eclk;
struct clk *vclk;
void __iomem *regs;
- unsigned int default_win;
unsigned long irq_flags;
bool i80_if;
int pipe;
@@ -631,7 +630,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
}
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
+ type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
DRM_PLANE_TYPE_OVERLAY;
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, decon_formats,
@@ -640,7 +639,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
return ret;
}
- exynos_plane = &ctx->planes[ctx->default_win];
+ exynos_plane = &ctx->planes[DEFAULT_WIN];
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
&decon_crtc_ops, ctx);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 5cb9bc3..058abd1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -22,6 +22,8 @@
#define MAX_PLANE 5
#define MAX_FB_BUFFER 4
+#define DEFAULT_WIN 0
+
#define to_exynos_crtc(x) container_of(x, struct exynos_drm_crtc, base)
#define to_exynos_plane(x) container_of(x, struct exynos_drm_plane, base)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index dc36e63..7776768 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -154,7 +154,6 @@ struct fimd_context {
struct clk *lcd_clk;
void __iomem *regs;
struct regmap *sysreg;
- unsigned int default_win;
unsigned long irq_flags;
u32 vidcon0;
u32 vidcon1;
@@ -910,7 +909,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
ctx->pipe = priv->pipe++;
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
+ type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
DRM_PLANE_TYPE_OVERLAY;
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, fimd_formats,
@@ -919,7 +918,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
return ret;
}
- exynos_plane = &ctx->planes[ctx->default_win];
+ exynos_plane = &ctx->planes[DEFAULT_WIN];
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
&fimd_crtc_ops, ctx);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 75718e1..fc57687 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -42,7 +42,6 @@ struct vidi_context {
struct exynos_drm_plane planes[WINDOWS_NR];
struct edid *raw_edid;
unsigned int clkdiv;
- unsigned int default_win;
unsigned long irq_flags;
unsigned int connected;
bool vblank_on;
@@ -446,7 +445,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
vidi_ctx_initialize(ctx, drm_dev);
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
+ type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
DRM_PLANE_TYPE_OVERLAY;
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, formats,
@@ -455,7 +454,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
return ret;
}
- exynos_plane = &ctx->planes[ctx->default_win];
+ exynos_plane = &ctx->planes[DEFAULT_WIN];
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI,
&vidi_crtc_ops, ctx);
@@ -507,7 +506,6 @@ static int vidi_probe(struct platform_device *pdev)
if (!ctx)
return -ENOMEM;
- ctx->default_win = 0;
ctx->pdev = pdev;
INIT_WORK(&ctx->work, vidi_fake_vblank_handler);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 853ad8f..a149153 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -42,7 +42,6 @@
#include "exynos_mixer.h"
#define MIXER_WIN_NR 3
-#define MIXER_DEFAULT_WIN 0
#define VP_DEFAULT_WIN 2
/* The pixelformats that are natively supported by the mixer. */
@@ -599,7 +598,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
/* setup display size */
if (ctx->mxr_ver == MXR_VER_128_0_0_184 &&
- win == MIXER_DEFAULT_WIN) {
+ win == DEFAULT_WIN) {
val = MXR_MXR_RES_HEIGHT(mode->vdisplay);
val |= MXR_MXR_RES_WIDTH(mode->hdisplay);
mixer_reg_write(res, MXR_RESOLUTION, val);
@@ -1134,7 +1133,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
const uint32_t *formats;
unsigned int fcount;
- type = (zpos == MIXER_DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
+ type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
DRM_PLANE_TYPE_OVERLAY;
if (zpos < VP_DEFAULT_WIN) {
formats = mixer_formats;
@@ -1151,7 +1150,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
return ret;
}
- exynos_plane = &ctx->planes[MIXER_DEFAULT_WIN];
+ exynos_plane = &ctx->planes[DEFAULT_WIN];
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI,
&mixer_crtc_ops, ctx);
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm/exynos: add cursor plane support
2015-09-04 22:05 [PATCH 1/2] drm/exynos: add global macro for the default primary plane Gustavo Padovan
@ 2015-09-04 22:05 ` Gustavo Padovan
2015-10-12 13:18 ` Inki Dae
2015-10-12 13:18 ` [PATCH 1/2] drm/exynos: add global macro for the default primary plane Inki Dae
1 sibling, 1 reply; 4+ messages in thread
From: Gustavo Padovan @ 2015-09-04 22:05 UTC (permalink / raw)
To: linux-samsung-soc
Cc: dri-devel, inki.dae, jy0922.shim, tjakobi, Gustavo Padovan
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Set one of the planes for each crtc driver as a cursor plane enabled
window managers to fully work on exynos.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
v2: use the top window for cursor on each crtc
---
drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++--
drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++--
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++--
drivers/gpu/drm/exynos/exynos_drm_plane.c | 11 +++++++++++
drivers/gpu/drm/exynos/exynos_drm_plane.h | 2 ++
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++--
drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++--
7 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 2f393b1..4b8dd7c 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -24,6 +24,7 @@
#include "exynos_drm_iommu.h"
#define WINDOWS_NR 3
+#define CURSOR_WIN 2
#define MIN_FB_WIDTH_FOR_16WORD_BURST 128
struct decon_context {
@@ -450,8 +451,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
ctx->pipe = priv->pipe++;
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
- DRM_PLANE_TYPE_OVERLAY;
+ type = exynos_plane_get_type(zpos, CURSOR_WIN);
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, decon_formats,
ARRAY_SIZE(decon_formats), zpos);
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 7a6c069..aa0ae79 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -41,6 +41,7 @@
#define MIN_FB_WIDTH_FOR_16WORD_BURST 128
#define WINDOWS_NR 2
+#define CURSOR_WIN 1
struct decon_context {
struct device *dev;
@@ -630,8 +631,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
}
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
- DRM_PLANE_TYPE_OVERLAY;
+ type = exynos_plane_get_type(zpos, CURSOR_WIN);
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, decon_formats,
ARRAY_SIZE(decon_formats), zpos);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 7776768..caa5255 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -88,6 +88,7 @@
/* FIMD has totally five hardware windows. */
#define WINDOWS_NR 5
+#define CURSOR_WIN 4
struct fimd_driver_data {
unsigned int timing_base;
@@ -909,8 +910,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
ctx->pipe = priv->pipe++;
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
- DRM_PLANE_TYPE_OVERLAY;
+ type = exynos_plane_get_type(zpos, CURSOR_WIN);
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, fimd_formats,
ARRAY_SIZE(fimd_formats), zpos);
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 7148224..80b2151 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -208,6 +208,17 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane,
drm_object_attach_property(&plane->base, prop, zpos);
}
+enum drm_plane_type exynos_plane_get_type(unsigned int zpos,
+ unsigned int cursor_win)
+{
+ if (zpos == DEFAULT_WIN)
+ return DRM_PLANE_TYPE_PRIMARY;
+ else if (zpos == cursor_win)
+ return DRM_PLANE_TYPE_CURSOR;
+ else
+ return DRM_PLANE_TYPE_OVERLAY;
+}
+
int exynos_plane_init(struct drm_device *dev,
struct exynos_drm_plane *exynos_plane,
unsigned long possible_crtcs, enum drm_plane_type type,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h
index 476c934..abb641e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
@@ -9,6 +9,8 @@
*
*/
+enum drm_plane_type exynos_plane_get_type(unsigned int zpos,
+ unsigned int cursor_win);
int exynos_plane_init(struct drm_device *dev,
struct exynos_drm_plane *exynos_plane,
unsigned long possible_crtcs, enum drm_plane_type type,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index fc57687..669362c 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -29,6 +29,7 @@
/* vidi has totally three virtual windows. */
#define WINDOWS_NR 3
+#define CURSOR_WIN 2
#define ctx_from_connector(c) container_of(c, struct vidi_context, \
connector)
@@ -445,8 +446,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
vidi_ctx_initialize(ctx, drm_dev);
for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
- type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
- DRM_PLANE_TYPE_OVERLAY;
+ type = exynos_plane_get_type(zpos, CURSOR_WIN);
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, formats,
ARRAY_SIZE(formats), zpos);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index a149153..61f71d6 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -43,6 +43,7 @@
#define MIXER_WIN_NR 3
#define VP_DEFAULT_WIN 2
+#define CURSOR_WIN 1
/* The pixelformats that are natively supported by the mixer. */
#define MXR_FORMAT_RGB565 4
@@ -1133,8 +1134,6 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
const uint32_t *formats;
unsigned int fcount;
- type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
- DRM_PLANE_TYPE_OVERLAY;
if (zpos < VP_DEFAULT_WIN) {
formats = mixer_formats;
fcount = ARRAY_SIZE(mixer_formats);
@@ -1143,6 +1142,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
fcount = ARRAY_SIZE(vp_formats);
}
+ type = exynos_plane_get_type(zpos, CURSOR_WIN);
ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
1 << ctx->pipe, type, formats, fcount,
zpos);
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] drm/exynos: add global macro for the default primary plane
2015-09-04 22:05 [PATCH 1/2] drm/exynos: add global macro for the default primary plane Gustavo Padovan
2015-09-04 22:05 ` [PATCH 2/2] drm/exynos: add cursor plane support Gustavo Padovan
@ 2015-10-12 13:18 ` Inki Dae
1 sibling, 0 replies; 4+ messages in thread
From: Inki Dae @ 2015-10-12 13:18 UTC (permalink / raw)
To: Gustavo Padovan, linux-samsung-soc
Cc: dri-devel, jy0922.shim, tjakobi, Gustavo Padovan
Hi Gustavo,
Merged.
Thanks,
Inki Dae
2015년 09월 05일 07:05에 Gustavo Padovan 이(가) 쓴 글:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Define DEFAULT_WIN as zero to help set the primary plane on all CRTCs.
> Some CRTCs were defining a variable to store the default window, but that
> is not necessary as the default (primary) window is always the window zero.
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
> drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 6 ++----
> drivers/gpu/drm/exynos/exynos7_drm_decon.c | 5 ++---
> drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 ++---
> drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 ++----
> drivers/gpu/drm/exynos/exynos_mixer.c | 7 +++----
> 6 files changed, 13 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 988df06..2f393b1 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -33,7 +33,6 @@ struct decon_context {
> struct exynos_drm_plane planes[WINDOWS_NR];
> void __iomem *addr;
> struct clk *clks[6];
> - unsigned int default_win;
> unsigned long irq_flags;
> int pipe;
>
> @@ -451,7 +450,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> ctx->pipe = priv->pipe++;
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
> + type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, decon_formats,
> @@ -460,7 +459,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> return ret;
> }
>
> - exynos_plane = &ctx->planes[ctx->default_win];
> + exynos_plane = &ctx->planes[DEFAULT_WIN];
> ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
> ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
> &decon_crtc_ops, ctx);
> @@ -557,7 +556,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev)
> if (!ctx)
> return -ENOMEM;
>
> - ctx->default_win = 0;
> ctx->dev = dev;
> if (of_get_child_by_name(dev->of_node, "i80-if-timings"))
> ctx->i80_if = true;
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 0776f38..7a6c069 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -52,7 +52,6 @@ struct decon_context {
> struct clk *eclk;
> struct clk *vclk;
> void __iomem *regs;
> - unsigned int default_win;
> unsigned long irq_flags;
> bool i80_if;
> int pipe;
> @@ -631,7 +630,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> }
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
> + type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, decon_formats,
> @@ -640,7 +639,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> return ret;
> }
>
> - exynos_plane = &ctx->planes[ctx->default_win];
> + exynos_plane = &ctx->planes[DEFAULT_WIN];
> ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
> ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
> &decon_crtc_ops, ctx);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> index 5cb9bc3..058abd1 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
> @@ -22,6 +22,8 @@
> #define MAX_PLANE 5
> #define MAX_FB_BUFFER 4
>
> +#define DEFAULT_WIN 0
> +
> #define to_exynos_crtc(x) container_of(x, struct exynos_drm_crtc, base)
> #define to_exynos_plane(x) container_of(x, struct exynos_drm_plane, base)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index dc36e63..7776768 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -154,7 +154,6 @@ struct fimd_context {
> struct clk *lcd_clk;
> void __iomem *regs;
> struct regmap *sysreg;
> - unsigned int default_win;
> unsigned long irq_flags;
> u32 vidcon0;
> u32 vidcon1;
> @@ -910,7 +909,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
> ctx->pipe = priv->pipe++;
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
> + type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, fimd_formats,
> @@ -919,7 +918,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
> return ret;
> }
>
> - exynos_plane = &ctx->planes[ctx->default_win];
> + exynos_plane = &ctx->planes[DEFAULT_WIN];
> ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
> ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD,
> &fimd_crtc_ops, ctx);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index 75718e1..fc57687 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -42,7 +42,6 @@ struct vidi_context {
> struct exynos_drm_plane planes[WINDOWS_NR];
> struct edid *raw_edid;
> unsigned int clkdiv;
> - unsigned int default_win;
> unsigned long irq_flags;
> unsigned int connected;
> bool vblank_on;
> @@ -446,7 +445,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
> vidi_ctx_initialize(ctx, drm_dev);
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == ctx->default_win) ? DRM_PLANE_TYPE_PRIMARY :
> + type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, formats,
> @@ -455,7 +454,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
> return ret;
> }
>
> - exynos_plane = &ctx->planes[ctx->default_win];
> + exynos_plane = &ctx->planes[DEFAULT_WIN];
> ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
> ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI,
> &vidi_crtc_ops, ctx);
> @@ -507,7 +506,6 @@ static int vidi_probe(struct platform_device *pdev)
> if (!ctx)
> return -ENOMEM;
>
> - ctx->default_win = 0;
> ctx->pdev = pdev;
>
> INIT_WORK(&ctx->work, vidi_fake_vblank_handler);
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 853ad8f..a149153 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -42,7 +42,6 @@
> #include "exynos_mixer.h"
>
> #define MIXER_WIN_NR 3
> -#define MIXER_DEFAULT_WIN 0
> #define VP_DEFAULT_WIN 2
>
> /* The pixelformats that are natively supported by the mixer. */
> @@ -599,7 +598,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
>
> /* setup display size */
> if (ctx->mxr_ver == MXR_VER_128_0_0_184 &&
> - win == MIXER_DEFAULT_WIN) {
> + win == DEFAULT_WIN) {
> val = MXR_MXR_RES_HEIGHT(mode->vdisplay);
> val |= MXR_MXR_RES_WIDTH(mode->hdisplay);
> mixer_reg_write(res, MXR_RESOLUTION, val);
> @@ -1134,7 +1133,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
> const uint32_t *formats;
> unsigned int fcount;
>
> - type = (zpos == MIXER_DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> + type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> DRM_PLANE_TYPE_OVERLAY;
> if (zpos < VP_DEFAULT_WIN) {
> formats = mixer_formats;
> @@ -1151,7 +1150,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
> return ret;
> }
>
> - exynos_plane = &ctx->planes[MIXER_DEFAULT_WIN];
> + exynos_plane = &ctx->planes[DEFAULT_WIN];
> ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
> ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI,
> &mixer_crtc_ops, ctx);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] drm/exynos: add cursor plane support
2015-09-04 22:05 ` [PATCH 2/2] drm/exynos: add cursor plane support Gustavo Padovan
@ 2015-10-12 13:18 ` Inki Dae
0 siblings, 0 replies; 4+ messages in thread
From: Inki Dae @ 2015-10-12 13:18 UTC (permalink / raw)
To: Gustavo Padovan, linux-samsung-soc; +Cc: tjakobi, Gustavo Padovan, dri-devel
Merged.
Thanks,
Inki Dae
2015년 09월 05일 07:05에 Gustavo Padovan 이(가) 쓴 글:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Set one of the planes for each crtc driver as a cursor plane enabled
> window managers to fully work on exynos.
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> ---
> v2: use the top window for cursor on each crtc
> ---
> drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++--
> drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_drm_plane.c | 11 +++++++++++
> drivers/gpu/drm/exynos/exynos_drm_plane.h | 2 ++
> drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++--
> drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++--
> 7 files changed, 23 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 2f393b1..4b8dd7c 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -24,6 +24,7 @@
> #include "exynos_drm_iommu.h"
>
> #define WINDOWS_NR 3
> +#define CURSOR_WIN 2
> #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
>
> struct decon_context {
> @@ -450,8 +451,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> ctx->pipe = priv->pipe++;
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> - DRM_PLANE_TYPE_OVERLAY;
> + type = exynos_plane_get_type(zpos, CURSOR_WIN);
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, decon_formats,
> ARRAY_SIZE(decon_formats), zpos);
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 7a6c069..aa0ae79 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -41,6 +41,7 @@
> #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
>
> #define WINDOWS_NR 2
> +#define CURSOR_WIN 1
>
> struct decon_context {
> struct device *dev;
> @@ -630,8 +631,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
> }
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> - DRM_PLANE_TYPE_OVERLAY;
> + type = exynos_plane_get_type(zpos, CURSOR_WIN);
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, decon_formats,
> ARRAY_SIZE(decon_formats), zpos);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 7776768..caa5255 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -88,6 +88,7 @@
>
> /* FIMD has totally five hardware windows. */
> #define WINDOWS_NR 5
> +#define CURSOR_WIN 4
>
> struct fimd_driver_data {
> unsigned int timing_base;
> @@ -909,8 +910,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
> ctx->pipe = priv->pipe++;
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> - DRM_PLANE_TYPE_OVERLAY;
> + type = exynos_plane_get_type(zpos, CURSOR_WIN);
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, fimd_formats,
> ARRAY_SIZE(fimd_formats), zpos);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> index 7148224..80b2151 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
> @@ -208,6 +208,17 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane,
> drm_object_attach_property(&plane->base, prop, zpos);
> }
>
> +enum drm_plane_type exynos_plane_get_type(unsigned int zpos,
> + unsigned int cursor_win)
> +{
> + if (zpos == DEFAULT_WIN)
> + return DRM_PLANE_TYPE_PRIMARY;
> + else if (zpos == cursor_win)
> + return DRM_PLANE_TYPE_CURSOR;
> + else
> + return DRM_PLANE_TYPE_OVERLAY;
> +}
> +
> int exynos_plane_init(struct drm_device *dev,
> struct exynos_drm_plane *exynos_plane,
> unsigned long possible_crtcs, enum drm_plane_type type,
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h
> index 476c934..abb641e 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h
> @@ -9,6 +9,8 @@
> *
> */
>
> +enum drm_plane_type exynos_plane_get_type(unsigned int zpos,
> + unsigned int cursor_win);
> int exynos_plane_init(struct drm_device *dev,
> struct exynos_drm_plane *exynos_plane,
> unsigned long possible_crtcs, enum drm_plane_type type,
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index fc57687..669362c 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -29,6 +29,7 @@
>
> /* vidi has totally three virtual windows. */
> #define WINDOWS_NR 3
> +#define CURSOR_WIN 2
>
> #define ctx_from_connector(c) container_of(c, struct vidi_context, \
> connector)
> @@ -445,8 +446,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
> vidi_ctx_initialize(ctx, drm_dev);
>
> for (zpos = 0; zpos < WINDOWS_NR; zpos++) {
> - type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> - DRM_PLANE_TYPE_OVERLAY;
> + type = exynos_plane_get_type(zpos, CURSOR_WIN);
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, formats,
> ARRAY_SIZE(formats), zpos);
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index a149153..61f71d6 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -43,6 +43,7 @@
>
> #define MIXER_WIN_NR 3
> #define VP_DEFAULT_WIN 2
> +#define CURSOR_WIN 1
>
> /* The pixelformats that are natively supported by the mixer. */
> #define MXR_FORMAT_RGB565 4
> @@ -1133,8 +1134,6 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
> const uint32_t *formats;
> unsigned int fcount;
>
> - type = (zpos == DEFAULT_WIN) ? DRM_PLANE_TYPE_PRIMARY :
> - DRM_PLANE_TYPE_OVERLAY;
> if (zpos < VP_DEFAULT_WIN) {
> formats = mixer_formats;
> fcount = ARRAY_SIZE(mixer_formats);
> @@ -1143,6 +1142,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data)
> fcount = ARRAY_SIZE(vp_formats);
> }
>
> + type = exynos_plane_get_type(zpos, CURSOR_WIN);
> ret = exynos_plane_init(drm_dev, &ctx->planes[zpos],
> 1 << ctx->pipe, type, formats, fcount,
> zpos);
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-12 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 22:05 [PATCH 1/2] drm/exynos: add global macro for the default primary plane Gustavo Padovan
2015-09-04 22:05 ` [PATCH 2/2] drm/exynos: add cursor plane support Gustavo Padovan
2015-10-12 13:18 ` Inki Dae
2015-10-12 13:18 ` [PATCH 1/2] drm/exynos: add global macro for the default primary plane Inki Dae
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.