disp: msm: sde: avoid caching color processing properties in validate

Recent investigation shows that color processing properties are
incorrectly being cached in validate. This can result in unwanted
color processing properties being applied if a previous commit
failed or was validate only.

Add color processing properties to sde crtc state instead of marking
them dirty in color processing driver. When atomic commit is called
properties from state will be marked as dirty and applied.

Change-Id: If231a1f028e4cbd0b50eb0a947f4d58f94390a0c
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Christopher Braga <cbraga@codeaurora.org>
This commit is contained in:
Gopikrishnaiah Anandan
2020-06-03 11:55:20 -07:00
父節點 dd4b08a47f
當前提交 320ae88cf1
共有 5 個文件被更改,包括 407 次插入159 次删除

查看文件

@@ -3367,7 +3367,7 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
struct sde_kms *sde_kms;
struct drm_plane *plane;
struct sde_splash_display *splash_display;
bool cont_splash_enabled = false, apply_cp_prop = false;
bool cont_splash_enabled = false;
size_t i;
if (!crtc) {
@@ -3449,12 +3449,12 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
cont_splash_enabled = true;
}
apply_cp_prop = sde_kms->catalog->trusted_vm_env ?
true : sde_crtc->enabled;
if (sde_kms_is_cp_operation_allowed(sde_kms) &&
(cont_splash_enabled || apply_cp_prop))
if (sde_kms_is_cp_operation_allowed(sde_kms))
sde_cp_crtc_apply_properties(crtc);
if (!sde_crtc->enabled)
sde_cp_crtc_suspend(crtc);
/*
* PP_DONE irq is only used by command mode for now.
* It is better to request pending before FLUSH and START trigger
@@ -3601,12 +3601,12 @@ static void sde_crtc_destroy_state(struct drm_crtc *crtc,
SDE_ERROR("invalid sde_kms\n");
return;
}
SDE_DEBUG("crtc%d\n", crtc->base.id);
drm_for_each_encoder_mask(enc, crtc->dev, state->encoder_mask)
sde_rm_release(&sde_kms->rm, enc, true);
sde_cp_clear_state_info(state, true);
__drm_atomic_helper_crtc_destroy_state(state);
/* destroy value helper */
@@ -4010,11 +4010,11 @@ static struct drm_crtc_state *sde_crtc_duplicate_state(struct drm_crtc *crtc)
SDE_ERROR("failed to allocate state\n");
return NULL;
}
/* duplicate value helper */
msm_property_duplicate_state(&sde_crtc->property_info,
old_cstate, cstate,
&cstate->property_state, cstate->property_values);
sde_cp_clear_state_info(&cstate->base, false);
/* duplicate base helper */
__drm_atomic_helper_crtc_duplicate_state(crtc, &cstate->base);
@@ -4061,7 +4061,6 @@ static void sde_crtc_reset(struct drm_crtc *crtc)
msm_property_reset_state(&sde_crtc->property_info, cstate,
&cstate->property_state,
cstate->property_values);
_sde_crtc_set_input_fence_timeout(cstate);
cstate->base.crtc = crtc;
@@ -5740,7 +5739,7 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
SDE_ATRACE_BEGIN("sde_crtc_atomic_set_property");
/* check with cp property system first */
ret = sde_cp_crtc_set_property(crtc, property, val);
ret = sde_cp_crtc_set_property(crtc, state, property, val);
if (ret != -ENOENT)
goto exit;