[RFC 4/5] drm/exynos: mixer: do blending setup in mixer_cfg_layer()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This updates the blending setup when the layer configuration
changes (triggered by mixer_win_{commit,disable}).

Extra care has to be taken for the layer that is currently
being enabled/disabled.

Signed-off-by: Tobias Jakobi <tjakobi@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 3eec9ce..809f840 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -178,6 +178,18 @@ static inline bool is_alpha_format(const struct mixer_context* ctx, unsigned int
 	}
 }
 
+static inline unsigned int layer_bitmask(const struct mixer_context* ctx)
+{
+	unsigned int i, mask = 0;
+
+	for (i = 0; i < MIXER_WIN_NR; ++i) {
+		if (ctx->planes[i].enabled)
+			mask |= (1 << i);
+	}
+
+	return mask;
+}
+
 static inline u32 vp_reg_read(struct mixer_resources *res, u32 reg_id)
 {
 	return readl(res->vp_regs + reg_id);
@@ -490,6 +502,7 @@ static void mixer_cfg_rgb_fmt(struct mixer_context *ctx, unsigned int height)
 static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
 {
 	struct mixer_resources *res = &ctx->mixer_res;
+	unsigned int enable_state;
 	u32 val = enable ? ~0 : 0;
 
 	switch (win) {
@@ -507,6 +520,16 @@ static void mixer_cfg_layer(struct mixer_context *ctx, int win, bool enable)
 		}
 		break;
 	}
+
+	/* Determine the current enabled/disabled state of the layers. */
+	enable_state = layer_bitmask(ctx);
+	if (enable)
+		enable_state |= (1 << win);
+	else
+		enable_state &= ~(1 << win);
+
+	/* Layer configuration has changed, update blending setup. */
+	mixer_layer_blending(ctx, enable_state);
 }
 
 static void mixer_run(struct mixer_context *ctx)
-- 
2.0.5

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux