sti_plane.h 1.7 KB
Newer Older
1 2 3 4 5 6
/*
 * Copyright (C) STMicroelectronics SA 2014
 * Author: Benjamin Gaignard <benjamin.gaignard@st.com> for STMicroelectronics.
 * License terms:  GNU General Public License (GPL), version 2
 */

7 8
#ifndef _STI_PLANE_H_
#define _STI_PLANE_H_
9 10

#include <drm/drmP.h>
11 12 13 14
#include <drm/drm_atomic_helper.h>
#include <drm/drm_plane_helper.h>

extern struct drm_plane_funcs sti_plane_helpers_funcs;
15

V
Vincent Abriou 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#define to_sti_plane(x) container_of(x, struct sti_plane, drm_plane)

#define STI_PLANE_TYPE_SHIFT 8
#define STI_PLANE_TYPE_MASK (~((1 << STI_PLANE_TYPE_SHIFT) - 1))

enum sti_plane_type {
	STI_GDP = 1 << STI_PLANE_TYPE_SHIFT,
	STI_VDP = 2 << STI_PLANE_TYPE_SHIFT,
	STI_CUR = 3 << STI_PLANE_TYPE_SHIFT,
	STI_BCK = 4 << STI_PLANE_TYPE_SHIFT
};

enum sti_plane_id_of_type {
	STI_ID_0 = 0,
	STI_ID_1 = 1,
	STI_ID_2 = 2,
	STI_ID_3 = 3
};

enum sti_plane_desc {
	STI_GDP_0       = STI_GDP | STI_ID_0,
	STI_GDP_1       = STI_GDP | STI_ID_1,
	STI_GDP_2       = STI_GDP | STI_ID_2,
	STI_GDP_3       = STI_GDP | STI_ID_3,
	STI_HQVDP_0     = STI_VDP | STI_ID_0,
	STI_CURSOR      = STI_CUR,
	STI_BACK        = STI_BCK
};

45 46 47 48 49 50 51 52
enum sti_plane_status {
	STI_PLANE_READY,
	STI_PLANE_UPDATED,
	STI_PLANE_DISABLING,
	STI_PLANE_FLUSHING,
	STI_PLANE_DISABLED,
};

V
Vincent Abriou 已提交
53 54 55 56 57
/**
 * STI plane structure
 *
 * @plane:              drm plane it is bound to (if any)
 * @desc:               plane type & id
58
 * @status:             to know the status of the plane
V
Vincent Abriou 已提交
59 60 61 62 63
 * @zorder:             plane z-order
 */
struct sti_plane {
	struct drm_plane drm_plane;
	enum sti_plane_desc desc;
64
	enum sti_plane_status status;
V
Vincent Abriou 已提交
65 66 67 68
	int zorder;
};

const char *sti_plane_to_str(struct sti_plane *plane);
69 70
void sti_plane_init_property(struct sti_plane *plane,
			     enum drm_plane_type type);
71
#endif