Needed by objs in dm_atomic_state
Signed-off-by: Harry Wentland <harry.wentland@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>
static void dm_atomic_state_free(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]);
+ }
+ }
+
+ for (i = 0; i < dm_state->set_count; i++)
+ dc_stream_release(dm_state->set[i].stream);
+
kfree(dm_state);
}
}
val_sets[i].stream = new_stream;
+ dc_stream_retain(new_stream);
crtcs[i] = crtc;
if (i == set_count) {
/* nothing found. add new one to the end */
return set_count + 1;
+ } else {
+ /* update. relase old stream */
+ dc_stream_release(old_stream);
}
return set_count;
return set_count;
}
+ dc_stream_release(stream);
set_count--;
for (; i < set_count; i++) {
struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
if (acrtc->stream) {
+ dc_stream_retain(acrtc->stream);
dm_state->set[dm_state->set_count].stream = acrtc->stream;
crtc_set[dm_state->set_count] = crtc;
++dm_state->set_count;