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/amdgpu: Move test for fbdev GEM object into generic helper Date: Thu, 05 Mar 2026 13:27:24 +1000 Message-ID: In-Reply-To: <20260304130250.59008-2-tzimmermann@suse.de> References: <20260304130250.59008-1-tzimmermann@suse.de> <20260304130250.59008-2-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 **Overall**: Good patch. The new helper correctly generalizes the amdgpu-sp= ecific check and is more flexible by also supporting the `fb_helper->fb` pa= th (via `drm_gem_fb_get_obj`) when `buffer` isn't set. **EXPORT_SYMBOL_GPL vs EXPORT_SYMBOL**: Every other export in `drm_fb_helpe= r.c` uses `EXPORT_SYMBOL` (non-GPL). The new function uses: ```c EXPORT_SYMBOL_GPL(drm_fb_helper_gem_is_fb); ``` This should be `EXPORT_SYMBOL` for consistency with the rest of the file. W= hile both amdgpu and radeon are GPL-licensed so this works today, using `EX= PORT_SYMBOL_GPL` here is inconsistent and could trip up any hypothetical no= n-GPL consumer that uses the other fb_helper functions. **Typo in kdoc**: Minor typo in the documentation comment: ```c * Call drm_fb_helper_gem_is_fb to test is a DRM device's fbdev emulation ``` "test is" should be "test if". **Logic correctness**: The helper's fallback logic is sound: ```c if (fb_helper->buffer && fb_helper->buffer->gem) gem =3D fb_helper->buffer->gem; else if (fb_helper->fb) gem =3D drm_gem_fb_get_obj(fb_helper->fb, 0); ``` This correctly handles the two paths: drivers using client buffers (amdgpu'= s original path checked `buffer->gem`) and drivers using `fb` directly (rad= eon's original path used `drm_gem_fb_get_obj(fb_helper->fb, 0)`). The origi= nal amdgpu code only checked `buffer->gem`, and the new helper adds the `fb= ` fallback, which is a strict superset =E2=80=94 safe because if `buffer` i= s set, it will be checked first. **Scoping improvement**: Nice touch moving `robj` into the inner block wher= e it's actually used: ```c - robj =3D gem_to_amdgpu_bo(fb->obj[0]); - if (!amdgpu_display_robj_is_fb(adev, robj)) { + if (!drm_fb_helper_gem_is_fb(dev->fb_helper, fb->obj[0])) { + struct amdgpu_bo *robj =3D gem_to_amdgpu_bo(fb->obj[0]); ``` This avoids the unnecessary conversion when the object *is* the fbdev frame= buffer. **Header placement**: The `#else` static inline stub is correctly placed = =E2=80=94 the existing header had no `#else` for `CONFIG_DRM_FBDEV_EMULATIO= N`, and this adds one cleanly. --- Generated by Claude Code Patch Reviewer