Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 323db0ed authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Inki Dae
Browse files

drm/exynos: add cursor plane support



Set one of the planes for each crtc driver as a cursor plane enabled
window managers to fully work on exynos.

Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 5d3d0995
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 {
@@ -500,8 +501,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);
+2 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#define MIN_FB_WIDTH_FOR_16WORD_BURST 128

#define WINDOWS_NR	2
#define CURSOR_WIN	1

struct decon_context {
	struct device			*dev;
@@ -689,8 +690,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);
+2 −2
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@

/* FIMD has totally five hardware windows. */
#define WINDOWS_NR	5
#define CURSOR_WIN	4

struct fimd_driver_data {
	unsigned int timing_base;
@@ -948,8 +949,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);
+11 −0
Original line number Diff line number Diff line
@@ -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,
+2 −0
Original line number Diff line number Diff line
@@ -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,
Loading