@@ 8978,6 8978,8 @@ static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc,
struct drm_plane_state *new_plane_state,
struct drm_framebuffer *fb)
{
+ struct amdgpu_device *adev = drm_to_adev(new_acrtc->base.dev);
+ struct amdgpu_framebuffer *afb = to_amdgpu_framebuffer(fb);
unsigned int pitch;
if (fb->width > new_acrtc->max_cursor_width ||
@@ 9013,6 9015,18 @@ static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc,
return -EINVAL;
}
+ /* Core DRM takes care of checking FB modifiers, so we only need to
+ * check tiling flags when the FB doesn't have a modifier. */
+ if (!(fb->flags & DRM_MODE_FB_MODIFIERS)) {
+ /* Modifiers should always be set for GFX9+ */
+ BUG_ON(adev->family >= AMDGPU_FAMILY_AI);
+ if (AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != 0 ||
+ AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE) != 0) {
+ DRM_DEBUG_ATOMIC("Cursor FB not linear");
+ return -EINVAL;
+ }
+ }
+
return 0;
}