summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_kms.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-11-04 13:51:42 -0400
committerRob Clark <robdclark@gmail.com>2016-11-27 11:32:27 -0500
commit870d738acb7ebb0d4f6192c9d328cae95479715b (patch)
tree9d8ad211c6b5d82cfb2cf4122a99ffc81c9c3f23 /drivers/gpu/drm/msm/msm_kms.h
parentc056b55dc672cbc42e8814ef45726ca22e01ef9e (diff)
drm/msm: subclass drm_atomic_state
This will give the kms backends a slot to stash their own hw specific global state. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_kms.h')
-rw-r--r--drivers/gpu/drm/msm/msm_kms.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h
index 40e41e5cdbc6..cb9758bcadfd 100644
--- a/drivers/gpu/drm/msm/msm_kms.h
+++ b/drivers/gpu/drm/msm/msm_kms.h
@@ -40,6 +40,8 @@ struct msm_kms_funcs {
irqreturn_t (*irq)(struct msm_kms *kms);
int (*enable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);
void (*disable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc);
+ /* swap global atomic state: */
+ void (*swap_state)(struct msm_kms *kms, struct drm_atomic_state *state);
/* modeset, bracketing atomic_commit(): */
void (*prepare_commit)(struct msm_kms *kms, struct drm_atomic_state *state);
void (*complete_commit)(struct msm_kms *kms, struct drm_atomic_state *state);
@@ -65,6 +67,18 @@ struct msm_kms {
int irq;
};
+/**
+ * Subclass of drm_atomic_state, to allow kms backend to have driver
+ * private global state. The kms backend can do whatever it wants
+ * with the ->state ptr. On ->atomic_state_clear() the ->state ptr
+ * is kfree'd and set back to NULL.
+ */
+struct msm_kms_state {
+ struct drm_atomic_state base;
+ void *state;
+};
+#define to_kms_state(x) container_of(x, struct msm_kms_state, base)
+
static inline void msm_kms_init(struct msm_kms *kms,
const struct msm_kms_funcs *funcs)
{