modesetting: use MAX macro in more places

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
stefan11111
2025-09-20 18:23:02 +03:00
committed by Enrico Weigelt
parent 6730fd8251
commit 702625f028

View File

@@ -1852,7 +1852,7 @@ drmmode_cursor_get_pitch(drmmode_crtc_private_ptr drmmode_crtc, int idx)
struct dumb_bo *bo = dumb_bo_create(drmmode->fd, width, height, drmmode->kbpp);
if (!bo) {
/* We couldn't allocate a bo, so we try to guess the pitch */
return width > 64 ? width : 64;
return MAX(width, 64);
}
ret = bo->pitch / drmmode->cpp;
@@ -1870,7 +1870,7 @@ drmmode_cursor_get_pitch(drmmode_crtc_private_ptr drmmode_crtc, int idx)
struct dumb_bo *bo = dumb_bo_create(drmmode->fd, width, height, drmmode->kbpp);
if (!bo) {
/* We couldn't allocate a bo, so we try to guess the pitch */
return width > 64 ? width : 64;
return MAX(width, 64);
}
drmmode_crtc->cursor_pitches[idx] = bo->pitch / drmmode->cpp;