Skip to content

Commit 2261751

Browse files
committed
drm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c
Lift mode_config limits set by the DPU driver to the actual FB limits as handled by the dpu_plane.c. Move 2*max_lm_width check where it belongs, to the drm_crtc_helper_funcs::mode_valid() callback. Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280 Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/612259/ Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-15-617e1ecc4b7a@linaro.org
1 parent 671cc42 commit 2261751

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,19 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
12301230
return 0;
12311231
}
12321232

1233+
static enum drm_mode_status dpu_crtc_mode_valid(struct drm_crtc *crtc,
1234+
const struct drm_display_mode *mode)
1235+
{
1236+
struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(crtc);
1237+
1238+
/*
1239+
* max crtc width is equal to the max mixer width * 2 and max height is 4K
1240+
*/
1241+
return drm_mode_validate_size(mode,
1242+
2 * dpu_kms->catalog->caps->max_mixer_width,
1243+
4096);
1244+
}
1245+
12331246
int dpu_crtc_vblank(struct drm_crtc *crtc, bool en)
12341247
{
12351248
struct dpu_crtc *dpu_crtc = to_dpu_crtc(crtc);
@@ -1445,6 +1458,7 @@ static const struct drm_crtc_helper_funcs dpu_crtc_helper_funcs = {
14451458
.atomic_check = dpu_crtc_atomic_check,
14461459
.atomic_begin = dpu_crtc_atomic_begin,
14471460
.atomic_flush = dpu_crtc_atomic_flush,
1461+
.mode_valid = dpu_crtc_mode_valid,
14481462
.get_scanout_position = dpu_crtc_get_scanout_position,
14491463
};
14501464

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,13 +1201,8 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
12011201
dev->mode_config.min_width = 0;
12021202
dev->mode_config.min_height = 0;
12031203

1204-
/*
1205-
* max crtc width is equal to the max mixer width * 2 and max height is
1206-
* is 4K
1207-
*/
1208-
dev->mode_config.max_width =
1209-
dpu_kms->catalog->caps->max_mixer_width * 2;
1210-
dev->mode_config.max_height = 4096;
1204+
dev->mode_config.max_width = DPU_MAX_IMG_WIDTH;
1205+
dev->mode_config.max_height = DPU_MAX_IMG_HEIGHT;
12111206

12121207
dev->max_vblank_count = 0xffffffff;
12131208
/* Disable vblank irqs aggressively for power-saving */

0 commit comments

Comments
 (0)