disp: msm: sde: Add roi region for spr
Provide spr_roi region for spr over fetch in partial update. Support different the roi size of connector and crtc. Change-Id: Ic78a20badcafefd353a97532281dae26e5a772de Signed-off-by: Qing Huang <quic_huangq@quicinc.com>
This commit is contained in:
@@ -977,9 +977,18 @@ static int _sde_crtc_set_roi_v1(struct drm_crtc_state *state,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cstate->user_roi_list.roi_feature_flags = roi_v1.roi_feature_flags;
|
||||
cstate->user_roi_list.num_rects = roi_v1.num_rects;
|
||||
for (i = 0; i < roi_v1.num_rects; ++i) {
|
||||
cstate->user_roi_list.roi[i] = roi_v1.roi[i];
|
||||
if (cstate->user_roi_list.roi_feature_flags & SDE_DRM_ROI_SPR_FLAG_EN)
|
||||
cstate->user_roi_list.spr_roi[i] = roi_v1.spr_roi[i];
|
||||
else
|
||||
/*
|
||||
* backward compatible, spr_roi has the same value with roi,
|
||||
* it will have the same behavior with before.
|
||||
*/
|
||||
cstate->user_roi_list.spr_roi[i] = roi_v1.roi[i];
|
||||
SDE_DEBUG("crtc%d: roi%d: roi (%d,%d) (%d,%d)\n",
|
||||
DRMID(crtc), i,
|
||||
cstate->user_roi_list.roi[i].x1,
|
||||
@@ -991,6 +1000,17 @@ static int _sde_crtc_set_roi_v1(struct drm_crtc_state *state,
|
||||
cstate->user_roi_list.roi[i].y1,
|
||||
cstate->user_roi_list.roi[i].x2,
|
||||
cstate->user_roi_list.roi[i].y2);
|
||||
SDE_DEBUG("crtc%d, roi_feature_flags %d: spr roi%d: spr roi (%d,%d) (%d,%d)\n",
|
||||
DRMID(crtc), roi_v1.roi_feature_flags, i,
|
||||
roi_v1.spr_roi[i].x1,
|
||||
roi_v1.spr_roi[i].y1,
|
||||
roi_v1.spr_roi[i].x2,
|
||||
roi_v1.spr_roi[i].y2);
|
||||
SDE_EVT32_VERBOSE(DRMID(crtc), roi_v1.roi_feature_flags,
|
||||
roi_v1.spr_roi[i].x1,
|
||||
roi_v1.spr_roi[i].y1,
|
||||
roi_v1.spr_roi[i].x2,
|
||||
roi_v1.spr_roi[i].y2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1055,13 +1075,15 @@ static int _sde_crtc_set_crtc_roi(struct drm_crtc *crtc,
|
||||
continue;
|
||||
|
||||
/*
|
||||
* current driver only supports same connector and crtc size,
|
||||
* but if support for different sizes is added, driver needs
|
||||
* to check the connector roi here to make sure is full screen
|
||||
* for dsc 3d-mux topology that doesn't support partial update.
|
||||
* When enable spr 2D filter in PU, it require over fetch lines.
|
||||
* In this case, the roi size of connector and crtc are different.
|
||||
* But the spr_roi is the original roi with over fetch lines,
|
||||
* that should same with connector size.
|
||||
*/
|
||||
if (memcmp(&sde_conn_state->rois, &crtc_state->user_roi_list,
|
||||
sizeof(crtc_state->user_roi_list))) {
|
||||
if (memcmp(&sde_conn_state->rois.roi, &crtc_state->user_roi_list.spr_roi,
|
||||
sizeof(crtc_state->user_roi_list.spr_roi)) &&
|
||||
(sde_conn_state->rois.num_rects !=
|
||||
crtc_state->user_roi_list.num_rects)) {
|
||||
SDE_ERROR("%s: crtc -> conn roi scaling unsupported\n",
|
||||
sde_crtc->name);
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user