Loading msm/sde/sde_crtc.c +44 −32 Original line number Diff line number Diff line Loading @@ -4176,8 +4176,7 @@ static int _sde_crtc_excl_dim_layer_check(struct drm_crtc_state *state, static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state pstates[], struct sde_crtc_state *cstate, struct sde_kms *sde_kms, int cnt, int secure, int fb_ns, int fb_sec, int fb_sec_dir, bool conn_secure, bool is_wb) int cnt, int secure, int fb_ns, int fb_sec, int fb_sec_dir) { struct drm_plane *plane; int i; Loading Loading @@ -4261,19 +4260,6 @@ static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc, } } /* * If any input buffers are secure, * the output buffer must also be secure. */ if (is_wb && fb_sec && !conn_secure) { SDE_ERROR( "crtc%d: input fb sec %d, output fb secure %d\n", DRMID(crtc), (fb_sec) ? 1 : 0, (conn_secure) ? 1 : 0); return -EINVAL; } return 0; } Loading Loading @@ -4338,9 +4324,43 @@ static int _sde_crtc_check_secure_state_smmu_translation(struct drm_crtc *crtc, return 0; } static int _sde_crtc_check_secure_conn(struct drm_crtc *crtc, struct drm_crtc_state *state, uint32_t fb_sec) { bool conn_secure = false, is_wb = false; struct drm_connector *conn; struct drm_connector_state *conn_state; int i; for_each_new_connector_in_state(state->state, conn, conn_state, i) { if (conn_state && conn_state->crtc == crtc) { if (conn->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) is_wb = true; if (sde_connector_get_property(conn_state, CONNECTOR_PROP_FB_TRANSLATION_MODE) == SDE_DRM_FB_SEC) conn_secure = true; } } /* * If any input buffers are secure for wb, * the output buffer must also be secure. */ if (is_wb && fb_sec && !conn_secure) { SDE_ERROR("crtc%d: input fb sec %d, output fb secure %d\n", DRMID(crtc), fb_sec, conn_secure); return -EINVAL; } return 0; } static int _sde_crtc_check_secure_state(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state pstates[], int cnt, bool conn_secure, bool is_wb) int cnt) { struct sde_crtc_state *cstate; struct sde_kms *sde_kms; Loading Loading @@ -4369,8 +4389,11 @@ static int _sde_crtc_check_secure_state(struct drm_crtc *crtc, return rc; rc = _sde_crtc_check_secure_blend_config(crtc, state, pstates, cstate, sde_kms, cnt, secure, fb_ns, fb_sec, fb_sec_dir, conn_secure, is_wb); sde_kms, cnt, secure, fb_ns, fb_sec, fb_sec_dir); if (rc) return rc; rc = _sde_crtc_check_secure_conn(crtc, state, fb_sec); if (rc) return rc; Loading Loading @@ -4586,8 +4609,7 @@ static int _sde_crtc_check_zpos(struct drm_crtc_state *state, static int _sde_crtc_atomic_check_pstates(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state *pstates, struct sde_multirect_plane_states *multirect_plane, bool conn_secure, bool is_wb) struct sde_multirect_plane_states *multirect_plane) { struct sde_crtc *sde_crtc; struct sde_crtc_state *cstate; Loading Loading @@ -4618,8 +4640,7 @@ static int _sde_crtc_atomic_check_pstates(struct drm_crtc *crtc, if (rc) return rc; rc = _sde_crtc_check_secure_state(crtc, state, pstates, cnt, conn_secure, is_wb); rc = _sde_crtc_check_secure_state(crtc, state, pstates, cnt); if (rc) return rc; Loading @@ -4645,7 +4666,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, struct sde_crtc_state *cstate; struct drm_display_mode *mode; int rc = 0; bool conn_secure = false, is_wb = false; struct sde_multirect_plane_states *multirect_plane = NULL; struct drm_connector *conn; struct drm_connector_list_iter conn_iter; Loading Loading @@ -4699,14 +4719,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, if (conn->state && conn->state->crtc == crtc && cstate->num_connectors < MAX_CONNECTORS) { cstate->connectors[cstate->num_connectors++] = conn; if (conn->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) is_wb = true; if (sde_connector_get_property(conn->state, CONNECTOR_PROP_FB_TRANSLATION_MODE) == SDE_DRM_FB_SEC) conn_secure = true; } drm_connector_list_iter_end(&conn_iter); Loading @@ -4714,7 +4726,7 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, _sde_crtc_setup_lm_bounds(crtc, state); rc = _sde_crtc_atomic_check_pstates(crtc, state, pstates, multirect_plane, conn_secure, is_wb); multirect_plane); if (rc) { SDE_ERROR("crtc%d failed pstate check %d\n", crtc->base.id, rc); goto end; Loading Loading
msm/sde/sde_crtc.c +44 −32 Original line number Diff line number Diff line Loading @@ -4176,8 +4176,7 @@ static int _sde_crtc_excl_dim_layer_check(struct drm_crtc_state *state, static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state pstates[], struct sde_crtc_state *cstate, struct sde_kms *sde_kms, int cnt, int secure, int fb_ns, int fb_sec, int fb_sec_dir, bool conn_secure, bool is_wb) int cnt, int secure, int fb_ns, int fb_sec, int fb_sec_dir) { struct drm_plane *plane; int i; Loading Loading @@ -4261,19 +4260,6 @@ static int _sde_crtc_check_secure_blend_config(struct drm_crtc *crtc, } } /* * If any input buffers are secure, * the output buffer must also be secure. */ if (is_wb && fb_sec && !conn_secure) { SDE_ERROR( "crtc%d: input fb sec %d, output fb secure %d\n", DRMID(crtc), (fb_sec) ? 1 : 0, (conn_secure) ? 1 : 0); return -EINVAL; } return 0; } Loading Loading @@ -4338,9 +4324,43 @@ static int _sde_crtc_check_secure_state_smmu_translation(struct drm_crtc *crtc, return 0; } static int _sde_crtc_check_secure_conn(struct drm_crtc *crtc, struct drm_crtc_state *state, uint32_t fb_sec) { bool conn_secure = false, is_wb = false; struct drm_connector *conn; struct drm_connector_state *conn_state; int i; for_each_new_connector_in_state(state->state, conn, conn_state, i) { if (conn_state && conn_state->crtc == crtc) { if (conn->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) is_wb = true; if (sde_connector_get_property(conn_state, CONNECTOR_PROP_FB_TRANSLATION_MODE) == SDE_DRM_FB_SEC) conn_secure = true; } } /* * If any input buffers are secure for wb, * the output buffer must also be secure. */ if (is_wb && fb_sec && !conn_secure) { SDE_ERROR("crtc%d: input fb sec %d, output fb secure %d\n", DRMID(crtc), fb_sec, conn_secure); return -EINVAL; } return 0; } static int _sde_crtc_check_secure_state(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state pstates[], int cnt, bool conn_secure, bool is_wb) int cnt) { struct sde_crtc_state *cstate; struct sde_kms *sde_kms; Loading Loading @@ -4369,8 +4389,11 @@ static int _sde_crtc_check_secure_state(struct drm_crtc *crtc, return rc; rc = _sde_crtc_check_secure_blend_config(crtc, state, pstates, cstate, sde_kms, cnt, secure, fb_ns, fb_sec, fb_sec_dir, conn_secure, is_wb); sde_kms, cnt, secure, fb_ns, fb_sec, fb_sec_dir); if (rc) return rc; rc = _sde_crtc_check_secure_conn(crtc, state, fb_sec); if (rc) return rc; Loading Loading @@ -4586,8 +4609,7 @@ static int _sde_crtc_check_zpos(struct drm_crtc_state *state, static int _sde_crtc_atomic_check_pstates(struct drm_crtc *crtc, struct drm_crtc_state *state, struct plane_state *pstates, struct sde_multirect_plane_states *multirect_plane, bool conn_secure, bool is_wb) struct sde_multirect_plane_states *multirect_plane) { struct sde_crtc *sde_crtc; struct sde_crtc_state *cstate; Loading Loading @@ -4618,8 +4640,7 @@ static int _sde_crtc_atomic_check_pstates(struct drm_crtc *crtc, if (rc) return rc; rc = _sde_crtc_check_secure_state(crtc, state, pstates, cnt, conn_secure, is_wb); rc = _sde_crtc_check_secure_state(crtc, state, pstates, cnt); if (rc) return rc; Loading @@ -4645,7 +4666,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, struct sde_crtc_state *cstate; struct drm_display_mode *mode; int rc = 0; bool conn_secure = false, is_wb = false; struct sde_multirect_plane_states *multirect_plane = NULL; struct drm_connector *conn; struct drm_connector_list_iter conn_iter; Loading Loading @@ -4699,14 +4719,6 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, if (conn->state && conn->state->crtc == crtc && cstate->num_connectors < MAX_CONNECTORS) { cstate->connectors[cstate->num_connectors++] = conn; if (conn->connector_type == DRM_MODE_CONNECTOR_VIRTUAL) is_wb = true; if (sde_connector_get_property(conn->state, CONNECTOR_PROP_FB_TRANSLATION_MODE) == SDE_DRM_FB_SEC) conn_secure = true; } drm_connector_list_iter_end(&conn_iter); Loading @@ -4714,7 +4726,7 @@ static int sde_crtc_atomic_check(struct drm_crtc *crtc, _sde_crtc_setup_lm_bounds(crtc, state); rc = _sde_crtc_atomic_check_pstates(crtc, state, pstates, multirect_plane, conn_secure, is_wb); multirect_plane); if (rc) { SDE_ERROR("crtc%d failed pstate check %d\n", crtc->base.id, rc); goto end; Loading