Skip to content

Commit 671cc42

Browse files
committed
drm/msm/dpu: merge MAX_IMG_WIDTH/HEIGHT with DPU_MAX_IMG_WIDTH/HEIGHT
dpu_formats.c defines DPU_MAX_IMG_WIDTH and _HEIGHT, while dpu_hw_catalog.h defines just MAX_IMG_WIDTH and _HEIGHT. Merge these constants to remove duplication. 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/612255/ Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-14-617e1ecc4b7a@linaro.org
1 parent 707db37 commit 671cc42

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
#define DPU_UBWC_PLANE_SIZE_ALIGNMENT 4096
1515

16-
#define DPU_MAX_IMG_WIDTH 0x3FFF
17-
#define DPU_MAX_IMG_HEIGHT 0x3FFF
18-
1916
/*
2017
* struct dpu_media_color_map - maps drm format to media format
2118
* @format: DRM base pixel format

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
#define DPU_HW_BLK_NAME_LEN 16
2323

24-
#define MAX_IMG_WIDTH 0x3fff
25-
#define MAX_IMG_HEIGHT 0x3fff
24+
#define DPU_MAX_IMG_WIDTH 0x3fff
25+
#define DPU_MAX_IMG_HEIGHT 0x3fff
2626

2727
#define CRTC_DUAL_MIXERS 2
2828

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
843843
fb_rect.y2 = new_plane_state->fb->height;
844844

845845
/* Ensure fb size is supported */
846-
if (drm_rect_width(&fb_rect) > MAX_IMG_WIDTH ||
847-
drm_rect_height(&fb_rect) > MAX_IMG_HEIGHT) {
846+
if (drm_rect_width(&fb_rect) > DPU_MAX_IMG_WIDTH ||
847+
drm_rect_height(&fb_rect) > DPU_MAX_IMG_HEIGHT) {
848848
DPU_DEBUG_PLANE(pdpu, "invalid framebuffer " DRM_RECT_FMT "\n",
849849
DRM_RECT_ARG(&fb_rect));
850850
return -E2BIG;

0 commit comments

Comments
 (0)