mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amd/display: Update atomic state hooks.
Reimplement atomic_state_alloc and atomic_state_clear to release validate_ctx. Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e2c7bb1228
commit
89a1fc5924
2 changed files with 11 additions and 16 deletions
|
@ -648,34 +648,30 @@ dm_atomic_state_alloc(struct drm_device *dev)
|
|||
return &state->base;
|
||||
}
|
||||
|
||||
void dm_atomic_state_clear(struct drm_atomic_state *s)
|
||||
{
|
||||
struct dm_atomic_state *state = to_dm_atomic_state(s);
|
||||
drm_atomic_state_default_clear(&state->base);
|
||||
}
|
||||
|
||||
|
||||
static void dm_atomic_state_free(struct drm_atomic_state *state)
|
||||
void dm_atomic_state_clear(struct drm_atomic_state *state)
|
||||
{
|
||||
struct dm_atomic_state *dm_state = to_dm_atomic_state(state);
|
||||
int i, j;
|
||||
|
||||
drm_atomic_state_default_release(state);
|
||||
|
||||
for (i = 0; i < dm_state->set_count; i++) {
|
||||
for (j = 0; j < dm_state->set[i].surface_count; j++) {
|
||||
dc_surface_release(dm_state->set[i].surfaces[j]);
|
||||
dm_state->set[i].surfaces[j] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < dm_state->set_count; i++)
|
||||
dc_stream_release(dm_state->set[i].stream);
|
||||
dm_state->set[i].stream = NULL;
|
||||
}
|
||||
dm_state->set_count = 0;
|
||||
|
||||
kfree(dm_state);
|
||||
dc_resource_validate_ctx_destruct(dm_state->context);
|
||||
dm_free(dm_state->context);
|
||||
dm_state->context = NULL;
|
||||
|
||||
drm_atomic_state_default_clear(state);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = {
|
||||
.fb_create = amdgpu_user_framebuffer_create,
|
||||
.output_poll_changed = amdgpu_output_poll_changed,
|
||||
|
@ -683,7 +679,6 @@ static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = {
|
|||
.atomic_commit = drm_atomic_helper_commit,
|
||||
.atomic_state_alloc = dm_atomic_state_alloc,
|
||||
.atomic_state_clear = dm_atomic_state_clear,
|
||||
.atomic_state_free = dm_atomic_state_free,
|
||||
};
|
||||
|
||||
static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = {
|
||||
|
|
|
@ -2695,6 +2695,7 @@ void amdgpu_dm_atomic_commit_tail(
|
|||
/* DC is optimized not to do anything if 'streams' didn't change. */
|
||||
WARN_ON(!dc_commit_context(dm->dc, dm_state->context));
|
||||
|
||||
|
||||
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
|
||||
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
|
||||
|
||||
|
@ -3069,7 +3070,6 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
|
|||
__func__, acrtc->base.base.id);
|
||||
break;
|
||||
}
|
||||
new_stream->priv = acrtc;
|
||||
|
||||
new_streams[new_stream_count] = new_stream;
|
||||
dm_state->set_count = update_in_val_sets_stream(
|
||||
|
|
Loading…
Add table
Reference in a new issue