mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
This commit is contained in:
@@ -241,6 +241,10 @@ int msm_atomic_commit(struct drm_device *dev,
|
||||
|
||||
drm_atomic_helper_swap_state(state, true);
|
||||
|
||||
/* swap driver private state while still holding state_lock */
|
||||
if (to_kms_state(state)->state)
|
||||
priv->kms->funcs->swap_state(priv->kms, state);
|
||||
|
||||
/*
|
||||
* Everything below can be run asynchronously without the need to grab
|
||||
* any modeset locks at all under one conditions: It must be guaranteed
|
||||
@@ -271,3 +275,30 @@ error:
|
||||
drm_atomic_helper_cleanup_planes(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct drm_atomic_state *msm_atomic_state_alloc(struct drm_device *dev)
|
||||
{
|
||||
struct msm_kms_state *state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||
|
||||
if (!state || drm_atomic_state_init(dev, &state->base) < 0) {
|
||||
kfree(state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &state->base;
|
||||
}
|
||||
|
||||
void msm_atomic_state_clear(struct drm_atomic_state *s)
|
||||
{
|
||||
struct msm_kms_state *state = to_kms_state(s);
|
||||
drm_atomic_state_default_clear(&state->base);
|
||||
kfree(state->state);
|
||||
state->state = NULL;
|
||||
}
|
||||
|
||||
void msm_atomic_state_free(struct drm_atomic_state *state)
|
||||
{
|
||||
kfree(to_kms_state(state)->state);
|
||||
drm_atomic_state_default_release(state);
|
||||
kfree(state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user