dc_release_validate_context(core_dc->current_context);
- dc_retain_validate_context(context);
-
core_dc->current_context = context;
+ dc_retain_validate_context(core_dc->current_context);
+
return (result == DC_OK);
}
result = dc_commit_context_no_check(dc, context);
- return (result == DC_OK);
-
fail:
dc_release_validate_context(context);
enum dc_acpi_cm_power_state power_state)
{
struct core_dc *core_dc = DC_TO_CORE(dc);
+ int ref_count;
switch (power_state) {
case DC_ACPI_CM_POWER_STATE_D0:
* clean state, and dc hw programming optimizations will not
* cause any trouble.
*/
+
+ /* Preserve refcount */
+ ref_count = core_dc->current_context->ref_count;
+ dc_resource_validate_ctx_destruct(core_dc->current_context);
memset(core_dc->current_context, 0,
sizeof(*core_dc->current_context));
+ core_dc->current_context->ref_count = ref_count;
break;
}