From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/exynos: fbdev: Calculate buffer geometry with format helpers Date: Sat, 16 May 2026 15:38:05 +1000 Message-ID: In-Reply-To: <20260511115538.57884-4-tzimmermann@suse.de> References: <20260511115538.57884-1-tzimmermann@suse.de> <20260511115538.57884-4-tzimmermann@suse.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Status: Good, one minor note** This replaces the hand-rolled geometry calculation with proper DRM format h= elpers. The v3 error checks are thorough: ```c fourcc =3D drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_dep= th); if (fourcc =3D=3D DRM_FORMAT_INVALID) return -EINVAL; format =3D drm_get_format_info(dev, fourcc, DRM_FORMAT_MOD_LINEAR); if (!format) return -EINVAL; pitch =3D drm_format_info_min_pitch(format, 0, sizes->surface_width); if (!pitch) return -EINVAL; if (check_mul_overflow(pitch, sizes->surface_height, &size)) return -EINVAL; size =3D ALIGN(size, PAGE_SIZE); if (size < PAGE_SIZE) return -EINVAL; ``` **Minor note on types:** `drm_format_info_min_pitch()` returns `uint64_t` b= ut `pitch` is declared as `u32`. For fbdev surface sizes this is never a pr= actical issue, and the resulting pitch is consumed by `mode_cmd.pitches[0]`= (also `u32`) and `drm_client_buffer_create(..., u32 pitch)`, so `u32` is t= he right type for the interface contract. The `!pitch` check catches the de= generate case where the return was 0. If the pitch somehow exceeded 32 bits= (theoretically impossible for reasonable fbdev sizes), it would silently t= runcate, but this matches the existing API constraints. The switch to `obj->size` for `screen_size` and `fix.smem_len` is correct = =E2=80=94 it reflects the actual allocated size (which may be larger than t= he requested size after GEM allocation alignment): ```c + info->screen_size =3D obj->size; + info->fix.smem_len =3D obj->size; ``` No blocking concerns. --- --- Generated by Claude Code Patch Reviewer