|
@@ -653,6 +653,7 @@ static void _sde_enc_phys_wb_detect_cwb(struct sde_encoder_phys *phys_enc,
|
|
|
struct drm_crtc_state *crtc_state)
|
|
|
{
|
|
|
struct sde_encoder_phys_wb *wb_enc = to_sde_encoder_phys_wb(phys_enc);
|
|
|
+ struct sde_crtc_state *cstate = to_sde_crtc_state(crtc_state);
|
|
|
const struct sde_wb_cfg *wb_cfg = wb_enc->hw_wb->caps;
|
|
|
u32 encoder_mask = 0;
|
|
|
|
|
@@ -662,9 +663,11 @@ static void _sde_enc_phys_wb_detect_cwb(struct sde_encoder_phys *phys_enc,
|
|
|
encoder_mask = crtc_state->encoder_mask;
|
|
|
encoder_mask &= ~drm_encoder_mask(phys_enc->parent);
|
|
|
}
|
|
|
- phys_enc->in_clone_mode = encoder_mask ? true : false;
|
|
|
|
|
|
- SDE_DEBUG("detect CWB(OR)DCWB - status:%d\n", phys_enc->in_clone_mode);
|
|
|
+ cstate->cwb_enc_mask = encoder_mask ? drm_encoder_mask(phys_enc->parent) : 0;
|
|
|
+
|
|
|
+ SDE_DEBUG("detect CWB - status:%d, phys state:%d in_clone_mode:%d\n",
|
|
|
+ cstate->cwb_enc_mask, phys_enc->enable_state, phys_enc->in_clone_mode);
|
|
|
}
|
|
|
|
|
|
static int _sde_enc_phys_wb_validate_cwb(struct sde_encoder_phys *phys_enc,
|
|
@@ -816,6 +819,7 @@ static int sde_encoder_phys_wb_atomic_check(
|
|
|
struct drm_connector_state *conn_state)
|
|
|
{
|
|
|
struct sde_encoder_phys_wb *wb_enc = to_sde_encoder_phys_wb(phys_enc);
|
|
|
+ struct sde_crtc_state *cstate = to_sde_crtc_state(crtc_state);
|
|
|
struct sde_hw_wb *hw_wb = wb_enc->hw_wb;
|
|
|
const struct sde_wb_cfg *wb_cfg = hw_wb->caps;
|
|
|
struct drm_framebuffer *fb;
|
|
@@ -843,7 +847,7 @@ static int sde_encoder_phys_wb_atomic_check(
|
|
|
|
|
|
_sde_enc_phys_wb_detect_cwb(phys_enc, crtc_state);
|
|
|
|
|
|
- if (clone_mode_curr && !phys_enc->in_clone_mode) {
|
|
|
+ if (clone_mode_curr && !cstate->cwb_enc_mask) {
|
|
|
SDE_ERROR("WB commit before CWB disable\n");
|
|
|
return -EINVAL;
|
|
|
}
|
|
@@ -902,7 +906,7 @@ static int sde_encoder_phys_wb_atomic_check(
|
|
|
crtc_state->mode_changed = true;
|
|
|
|
|
|
/* if in clone mode, return after cwb validation */
|
|
|
- if (phys_enc->in_clone_mode) {
|
|
|
+ if (cstate->cwb_enc_mask) {
|
|
|
rc = _sde_enc_phys_wb_validate_cwb(phys_enc, crtc_state,
|
|
|
conn_state);
|
|
|
if (rc)
|